]> git.ozlabs.org Git - yaboot.git/blobdiff - second/fs_ext2.c
Enhance network stack detection on IBM pSeries
[yaboot.git] / second / fs_ext2.c
index a8bdf6bdf6d8de71a3bdf11275317eb9d6f234b5..41a3c79cce2096ac513e9135ccb677b072a67f4f 100644 (file)
@@ -54,7 +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);
+static int ext2_ino_size(struct boot_file_t *file, unsigned int *size);
 
 struct fs_t ext2_filesystem =
 {
@@ -109,7 +109,7 @@ static unsigned long read_total;
 static unsigned long read_max;
 static struct boot_file_t* read_cur_file;
 static errcode_t read_result;
-static char* read_buffer;
+static unsigned char* read_buffer;
 
 static int read_dump_range(void);
 static int read_iterator(ext2_filsys fs, blk_t *blocknr, int lg_block, void *private);
@@ -567,14 +567,15 @@ ext2_close(       struct boot_file_t*     file)
      return 0;
 }
 
-static unsigned int ext2_ino_size(struct boot_file_t *file)
+static int ext2_ino_size(struct boot_file_t *file, unsigned int *size)
 {
     struct ext2_inode ei;
 
     if (ext2fs_read_inode(fs, file->inode, &ei))
-       return 0;
+       return FILE_IOERR;
 
-    return ei.i_size;
+    *size = ei.i_size;
+    return FILE_ERR_OK;
 }
 
 static errcode_t linux_open (const char *name, int flags, io_channel * channel)