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 =
{
ext2_open,
ext2_read,
ext2_seek,
- ext2_close
+ ext2_close,
+ ext2_ino_size,
};
/* IO manager structure for the ext2 library */
DEBUG_LEAVE(FILE_ERR_FSBUSY);
return FILE_ERR_FSBUSY;
}
- if (file->device_kind != FILE_DEVICE_BLOCK) {
+ if (file->device_kind != FILE_DEVICE_BLOCK
+ && file->device_kind != FILE_DEVICE_ISCSI) {
DEBUG_LEAVE(FILE_ERR_BADDEV);
return FILE_ERR_BADDEV;
}
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;