Whamcloud - gitweb
Add {read,write}_blk64 to inode_io.c
authorJose R. Santos <jrs@us.ibm.com>
Mon, 3 Mar 2008 16:41:29 +0000 (10:41 -0600)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 13 Mar 2008 17:47:05 +0000 (13:47 -0400)
Add 64-bit block capable routines to inode IO manager.  Since fileio.c
does not yet have 64bit support, these routines will not handle 64bit
block numbers correctly yet.

Signed-off-by: Jose R. Santos <jrs@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/ext2fs/inode_io.c

index b5c08b9..0e23494 100644 (file)
@@ -56,7 +56,11 @@ static errcode_t inode_write_blk(io_channel channel, unsigned long block,
 static errcode_t inode_flush(io_channel channel);
 static errcode_t inode_write_byte(io_channel channel, unsigned long offset,
                                int size, const void *data);
-
+static errcode_t inode_read_blk64(io_channel channel, 
+                               unsigned long long block, int count, void *data);
+static errcode_t inode_write_blk64(io_channel channel, 
+                               unsigned long long block, int count, const void *data);
+                               
 static struct struct_io_manager struct_inode_manager = {
        EXT2_ET_MAGIC_IO_MANAGER,
        "Inode I/O Manager",
@@ -66,7 +70,11 @@ static struct struct_io_manager struct_inode_manager = {
        inode_read_blk,
        inode_write_blk,
        inode_flush,
-       inode_write_byte
+       inode_write_byte,
+       NULL,
+       NULL,
+       inode_read_blk64,
+       inode_write_blk64
 };
 
 io_manager inode_io_manager = &struct_inode_manager;
@@ -197,8 +205,8 @@ static errcode_t inode_set_blksize(io_channel channel, int blksize)
 }
 
 
-static errcode_t inode_read_blk(io_channel channel, unsigned long block,
-                              int count, void *buf)
+static errcode_t inode_read_blk64(io_channel channel,
+                               unsigned long long block, int count, void *buf)
 {
        struct inode_private_data *data;
        errcode_t       retval;
@@ -217,8 +225,14 @@ static errcode_t inode_read_blk(io_channel channel, unsigned long block,
        return ext2fs_file_read(data->file, buf, count, 0);
 }
 
-static errcode_t inode_write_blk(io_channel channel, unsigned long block,
-                               int count, const void *buf)
+static errcode_t inode_read_blk(io_channel channel, unsigned long block,
+                              int count, void *buf)
+{
+       return inode_read_blk64(channel, block, count, buf);
+}
+
+static errcode_t inode_write_blk64(io_channel channel,
+                               unsigned long long block, int count, const void *buf)
 {
        struct inode_private_data *data;
        errcode_t       retval;
@@ -237,6 +251,12 @@ static errcode_t inode_write_blk(io_channel channel, unsigned long block,
        return ext2fs_file_write(data->file, buf, count, 0);
 }
 
+static errcode_t inode_write_blk(io_channel channel, unsigned long block, 
+                               int count, const void *buf)
+{
+       return inode_write_blk64(channel, block, count, buf);
+}
+
 static errcode_t inode_write_byte(io_channel channel, unsigned long offset,
                                 int size, const void *buf)
 {