On Tue, Nov 08, 2005 at 02:12:24PM -0500, Parag Warudkar wrote:
>
> On Nov 8, 2005, at 1:49 PM, Theodore Ts'o wrote:
>
> >e2fsprogs falls back to using a
> >binary search using SEEK_SET to find the device size.
>
> Binary search of what?
Of the device size; it doubles the guessed size of the disk until
lseek+read returns an error, and then uses binary search to figure out
the size of the disk. I did this because it works on pretty much any
OS.
> I tried to read the relevant code in getsize.c
> but apart from suspecting that the binary search thing might be
> specific to ext2fs I didn't quite understand what's going on in the
> code. (Will it work irrespective of the file system presence on the
> device?)
Yes, it works irrespective of what's on the disk. In fact, if the
Linux-specific ioctl's are not available, it's what will be used by
mke2fs to figure out the size of the device.
- Ted
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]