#include "ext2fs/ext2fs.h"
static int ext2_open( struct boot_file_t* file,
- const char* dev_name,
struct partition_t* part,
- const char* file_name);
+ struct boot_fspec_t* fspec);
static int ext2_read( struct boot_file_t* file,
unsigned int size,
void* buffer);
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 */
static int
ext2_open( struct boot_file_t* file,
- const char* dev_name,
struct partition_t* part,
- const char* file_name)
+ struct boot_fspec_t* fspec)
{
int result = 0;
int error = FILE_ERR_NOTFOUND;
static char buffer[1024];
int ofopened = 0;
+ char *dev_name = fspec->dev;
+ char *file_name = fspec->file;
DEBUG_ENTER;
DEBUG_OPEN;
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;