X-Git-Url: http://git.ozlabs.org/?p=yaboot.git;a=blobdiff_plain;f=second%2Ffs_ext2.c;h=c86907ebb89464681194da73c951bc56ad0981eb;hp=d24450d5c92b5b0105a7597907b54ef2ee2f2fc5;hb=f9631a4c18c659a6144a697e0c629fe63a44970f;hpb=6f27cd4ad3feeba79cac882ef3f7177224a5935b diff --git a/second/fs_ext2.c b/second/fs_ext2.c index d24450d..c86907e 100644 --- a/second/fs_ext2.c +++ b/second/fs_ext2.c @@ -54,6 +54,7 @@ static int ext2_read( struct boot_file_t* file, static int ext2_seek( struct boot_file_t* file, unsigned int newpos); static int ext2_close( struct boot_file_t* file); +static unsigned int ext2_ino_size(struct boot_file_t *file); struct fs_t ext2_filesystem = { @@ -61,7 +62,8 @@ struct fs_t ext2_filesystem = ext2_open, ext2_read, ext2_seek, - ext2_close + ext2_close, + ext2_ino_size, }; /* IO manager structure for the ext2 library */ @@ -564,6 +566,16 @@ ext2_close( struct boot_file_t* file) return 0; } +static unsigned int ext2_ino_size(struct boot_file_t *file) +{ + struct ext2_inode ei; + + if (ext2fs_read_inode(fs, file->inode, &ei)) + return 0; + + return ei.i_size; +} + static errcode_t linux_open (const char *name, int flags, io_channel * channel) { io_channel io;