Merge branch 'netboot'
[yaboot.git] / include / ext2fs / ext2_io.h
index 9568866964cf201b039d6d717025fe821f318791..124215415c6bd1552c8467789d628cabe3862bae 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * io.h --- the I/O manager abstraction
- * 
+ *
  * Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.
  *
  * %Begin-Header%
@@ -27,6 +27,8 @@ ext2_loff_t ext2fs_llseek (int, ext2_loff_t, int);
 typedef struct struct_io_manager *io_manager;
 typedef struct struct_io_channel *io_channel;
 
+#define CHANNEL_FLAGS_WRITETHROUGH     0x01
+
 struct struct_io_channel {
        errcode_t       magic;
        io_manager      manager;
@@ -47,7 +49,8 @@ struct struct_io_channel {
                                       int actual_bytes_written,
                                       errcode_t error);
        int             refcount;
-       int             reserved[15];
+       int             flags;
+       int             reserved[14];
        void            *private_data;
        void            *app_data;
 };
@@ -63,7 +66,9 @@ struct struct_io_manager {
        errcode_t (*write_blk)(io_channel channel, unsigned long block,
                               int count, const void *data);
        errcode_t (*flush)(io_channel channel);
-       int             reserved[16];
+       errcode_t (*write_byte)(io_channel channel, unsigned long offset,
+                               int count, const void *data);
+       int             reserved[15];
 };
 
 #define IO_FLAG_RW     1
@@ -76,8 +81,9 @@ struct struct_io_manager {
 #define io_channel_read_blk(c,b,n,d)   ((c)->manager->read_blk((c),b,n,d))
 #define io_channel_write_blk(c,b,n,d)  ((c)->manager->write_blk((c),b,n,d))
 #define io_channel_flush(c)            ((c)->manager->flush((c)))
+#define io_channel_write_byte(c,b,n,d) ((c)->manager->write_byte((c),b,n,d))
 #define io_channel_bumpcount(c)                ((c)->refcount++)
-       
+
 /* unix_io.c */
 extern io_manager unix_io_manager;
 
@@ -91,4 +97,4 @@ extern void (*test_io_cb_set_blksize)
        (int blksize, errcode_t err);
 
 #endif /* _EXT2FS_EXT2_IO_H */
-       
+