sb_bread cannot read last block

From: Jonathan Moore (writetojon_at_hotmail.com)
Date: 08/27/04

  • Next message: Dave: "Re: Linux Admin help."
    Date: 27 Aug 2004 03:58:45 -0700
    
    

    I want to

      mount -t myfs -o loop myfile /mnt/somewhere

    In my myfs module I'd like to get access to the data in myfile and
    mess with it and create an inode/directory structure that I can look
    at in /mnt/somewhere based on the data in myfile.

    It is my first venture with file_operations, inodes, block_devices and
    the like and I can't read the last block of myfile unless the file
    size is a multiple of 1024. Is there a way around this?

    So far I have

    long blocks = sb->s_bdev->bd_inode->i_size / 1024; // i_blocks always
    returns zero

    for (i = 0; i < blocks; i++) {
            bh = bread(sb, i);
    }
    bh = bread(sb, i); // To read the final block ... fails

    Thanks

    Jonathan


  • Next message: Dave: "Re: Linux Admin help."