Re: fs/read_write.c : default_llseek() with /dev/hda

imel... (imel96@puspa.cs.ui.ac.id)
Mon, 13 Dec 1999 12:40:24 +0000 (GMT)


that maybe an explanation to why nbd-server fail to find
out the size of a block device.
the other methods fail on me too. so is there a method to
get size of a block device?

imel

On Tue, 7 Dec 1999, Thomas Waldmann wrote:
> If you do a llseek(fh, 0, SEEK_END) on normal file, you get the new position
> (== end of file == size of file) as return value. So this is an easy method
> for getting the size of a file.
>
> If you try that with /dev/hda (e.g. 15GB), it doesn't behave like that, you
> just get 0 as return value, because in
>
> loff_t default_llseek(struct file *file, loff_t offset, int origin)
> {
> long long retval;
>
> switch (origin) {
> case 2:
> offset += file->f_dentry->d_inode->i_size;
> break;
> ...
>
> the value of file->f_dentry->d_inode->i_size is zero !?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/