On Sat, 2009-04-18 at 23:56 -0400, Chris Ball wrote: > Hi, > > > We need to add an ioctl that reports on the actual size of the > > compressed file. > > Here's an attempt at that ioctl, please review. The search code is > based on the clone ioctl. Some specific questions: > Thanks for doing this. > * Is the first while() loop necessary? Not really, you could just do: btrfs_wait_ordered_range(inode, 0, (u64)-1); > * Are the semantics of returning -EINVAL when called on an FS with > compression disabled desirable? > Instead of calling it the compressed size, I'd call it the size used on disk. For a compressed file, this will be smaller than the size in ram, otherwise it'll be the same. But, the ioctl is returning an unsigned long, which isn't quite big enough to hold the total possible size of the file on disk. I'd have it return the answer in a u64 instead. -chris -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
