Re: [PATCH] btrfs-progs: ins: Add v2 ioctl support in logical-resolve

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2018年07月19日 13:59, Lu Fengqi wrote:
> On Thu, Jul 19, 2018 at 01:51:59PM +0800, Qu Wenruo wrote:
>>
>>
>> On 2018年07月19日 13:15, Misono Tomohiro wrote:
>>> Add -i (ignore offset) option to logical-resolve command
>>> to show how BTRFS_IOC_LOGICAL_INO_V2 ioctl works
>>> (returns every ref to the extent of given logical address).
>>>
>>> [Example]
>>> $ mkfs.btrfs -f $DEV
>>> $ mount $DEV /mnt
>>>
>>> $ dd if=ev/urandom of=/mnt/file bs=4k count0
>>> # split above extent
>>> $ dd if=ev/urandom of=/mnt/file bs=4k seek count=1 conv=notrunc
>>> $ btrfs filesystem sync
>>>
>>> # v1
>>> $ btrfs inspect-internal logical-resolve -P 13631488 /mnt
>>> inode 257 offset 0 root 5
>>>
>>> # v2
>>> $ btrfs inspect-internal logical-resolve -iP 13631488 /mnt
>>> inode 257 offset 0 root 5
>>> inode 257 offset 45056 root 5
>>>
>>> Signed-off-by: Misono Tomohiro <misono.tomohiro@xxxxxxxxxxxxxx>
>>> ---
>>>  Documentation/btrfs-inspect-internal.asciidoc |  4 ++++
>>>  cmds-inspect.c                                | 17 +++++++++++++++--
>>>  ioctl.h                                       | 10 +++++++++-
>>>  libbtrfsutil/btrfs.h                          | 10 +++++++++-
>>
>> Not related to this patch itself, but I'm wondering could we just use
>> /usr/include/linux/btrfs.h?
>>
>> So we could save 2 same copies of headers here.
> 
> If we want to compile the newest btrfs-progs, but the older
> /usr/include/linux/btrfs.h maybe doesn't have already defined the ioctl,
> this will cause the compile error.

Makes sense.

> I am curious about why the
> libbtrfsutil need to copy the part of ioctl.h instead of including the
> ioctl.h directly?

Maybe for distribution purpose? Some binding may be delivered as
independent package just as Omar tries to do.
So in that case independent header makes sense.

Thanks,
Qu

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux