static int read_disk_block( struct boot_file_t *file, __u32 block, __u32 start, __u32 length, void *buf ) { __u16 fs_blocksize = INFO->blocksize == 0 ? REISERFS_OLD_BLOCKSIZE : INFO->blocksize; unsigned long long pos = (unsigned long long)block * (unsigned long long)fs_blocksize; pos += (unsigned long long)INFO->partition_offset + (unsigned long long)start; DEBUG_F( "Reading %u bytes, starting at block %u, disk offset %Lu\n", length, block, pos ); if (!prom_lseek( file->of_device, pos )) { DEBUG_F("prom_lseek failed\n"); return 0; } return prom_read( file->of_device, buf, length ); }
int lseek(int fd, int offset, int whence) { // XXX: This whence addition seems wrong .. return prom_lseek((void *)fd, whence + offset); }