ioctl icon indicating copy to clipboard operation
ioctl copied to clipboard

XFS ioctls not being included

Open robbat2 opened this issue 8 years ago • 3 comments

fs/xfs/libxfs/xfs_fs.h contains all of the XFS ioctls, which don't seem to get included in in the building of the list.

I'm most interested in being able to run XFS_IOC_GOINGDOWN.

robbat2 avatar Apr 05 '17 22:04 robbat2

Just to make sure, you are generating a new ioctl_list.c and not using the included one, right? Try deleting the file and running make.

flarn2006 avatar Jul 18 '17 20:07 flarn2006

Yes, I did regenerate it.

25 entries missing:

robbat2@bohr-int:/tmp/ioctl $ grep '^#define.*XFS_IOC.*\<_IO' /usr/src/linux/fs/xfs/libxfs/xfs_fs.h |wc -l
41
robbat2@bohr-int:/tmp/ioctl $ grep XFS ioctls_list.c |sort | uniq |wc -l
16

Regen details:

robbat2@bohr-int:/tmp/ioctl $ rm ioctls_list.c ; time make ioctls_list.c
bash gen_ioctls_list.sh gcc > ioctls_list.c

real	0m6.574s
user	0m4.849s
sys	0m1.807s
robbat2@bohr-int:/tmp/ioctl $ grep XFS_IOC_GOINGDOWN ioctls_list.c /usr/src/linux/fs/xfs/libxfs/xfs_fs.h
/usr/src/linux/fs/xfs/libxfs/xfs_fs.h:#define XFS_IOC_GOINGDOWN	     _IOR ('X', 125, __uint32_t)
robbat2@bohr-int:/tmp/ioctl $ grep XFS *
ioctls_list.c:    { "XFS_IOC_GETBMAP", XFS_IOC_GETBMAP, -1, -1 }, // xfs/xfs_fs.h:512
ioctls_list.c:    { "XFS_IOC_GETBMAPA", XFS_IOC_GETBMAPA, -1, -1 }, // xfs/xfs_fs.h:518
ioctls_list.c:    { "XFS_IOC_GETBMAPX", XFS_IOC_GETBMAPX, -1, -1 }, // xfs/xfs_fs.h:522
ioctls_list.c:    { "XFS_IOC_FSBULKSTAT", XFS_IOC_FSBULKSTAT, -1, -1 }, // xfs/xfs_fs.h:530
ioctls_list.c:    { "XFS_IOC_FSBULKSTAT_SINGLE", XFS_IOC_FSBULKSTAT_SINGLE, -1, -1 }, // xfs/xfs_fs.h:531
ioctls_list.c:    { "XFS_IOC_FSINUMBERS", XFS_IOC_FSINUMBERS, -1, -1 }, // xfs/xfs_fs.h:532
ioctls_list.c:    { "XFS_IOC_PATH_TO_FSHANDLE", XFS_IOC_PATH_TO_FSHANDLE, -1, -1 }, // xfs/xfs_fs.h:533
ioctls_list.c:    { "XFS_IOC_PATH_TO_HANDLE", XFS_IOC_PATH_TO_HANDLE, -1, -1 }, // xfs/xfs_fs.h:534
ioctls_list.c:    { "XFS_IOC_FD_TO_HANDLE", XFS_IOC_FD_TO_HANDLE, -1, -1 }, // xfs/xfs_fs.h:535
ioctls_list.c:    { "XFS_IOC_OPEN_BY_HANDLE", XFS_IOC_OPEN_BY_HANDLE, -1, -1 }, // xfs/xfs_fs.h:536
ioctls_list.c:    { "XFS_IOC_READLINK_BY_HANDLE", XFS_IOC_READLINK_BY_HANDLE, -1, -1 }, // xfs/xfs_fs.h:537
ioctls_list.c:    { "XFS_IOC_SWAPEXT", XFS_IOC_SWAPEXT, -1, -1 }, // xfs/xfs_fs.h:538
ioctls_list.c:    { "XFS_IOC_SET_RESBLKS", XFS_IOC_SET_RESBLKS, -1, -1 }, // xfs/xfs_fs.h:543
ioctls_list.c:    { "XFS_IOC_FREEZE", XFS_IOC_FREEZE, -1, -1 }, // xfs/xfs_fs.h:549
ioctls_list.c:    { "XFS_IOC_THAW", XFS_IOC_THAW, -1, -1 }, // xfs/xfs_fs.h:550
ioctls_list.c:    { "XFS_IOC_FILE_EXTENT_SAME", XFS_IOC_FILE_EXTENT_SAME, -1, -1 }, // xfs/xfs_fs.h:599
ioctls_list.c:    { "XFS_IOC_FSBULKSTAT", XFS_IOC_FSBULKSTAT, -1, -1 }, // xfs/xfs_fs.h:530
ioctls_list.c:    { "XFS_IOC_FSBULKSTAT_SINGLE", XFS_IOC_FSBULKSTAT_SINGLE, -1, -1 }, // xfs/xfs_fs.h:531
ioctls_list.c:    { "XFS_IOC_FSINUMBERS", XFS_IOC_FSINUMBERS, -1, -1 }, // xfs/xfs_fs.h:532
ioctls_list.c:    { "XFS_IOC_PATH_TO_FSHANDLE", XFS_IOC_PATH_TO_FSHANDLE, -1, -1 }, // xfs/xfs_fs.h:533
ioctls_list.c:    { "XFS_IOC_PATH_TO_HANDLE", XFS_IOC_PATH_TO_HANDLE, -1, -1 }, // xfs/xfs_fs.h:534
ioctls_list.c:    { "XFS_IOC_FD_TO_HANDLE", XFS_IOC_FD_TO_HANDLE, -1, -1 }, // xfs/xfs_fs.h:535
ioctls_list.c:    { "XFS_IOC_OPEN_BY_HANDLE", XFS_IOC_OPEN_BY_HANDLE, -1, -1 }, // xfs/xfs_fs.h:536
ioctls_list.c:    { "XFS_IOC_READLINK_BY_HANDLE", XFS_IOC_READLINK_BY_HANDLE, -1, -1 }, // xfs/xfs_fs.h:537
ioctls_list.c:    { "XFS_IOC_SWAPEXT", XFS_IOC_SWAPEXT, -1, -1 }, // xfs/xfs_fs.h:538
ioctls_list.c:    { "XFS_IOC_SET_RESBLKS", XFS_IOC_SET_RESBLKS, -1, -1 }, // xfs/xfs_fs.h:543
ioctls_list.c:    { "XFS_IOC_FREEZE", XFS_IOC_FREEZE, -1, -1 }, // xfs/xfs_fs.h:549
ioctls_list.c:    { "XFS_IOC_THAW", XFS_IOC_THAW, -1, -1 }, // xfs/xfs_fs.h:550
ioctls_list.c:    { "XFS_IOC_FILE_EXTENT_SAME", XFS_IOC_FILE_EXTENT_SAME, -1, -1 }, // xfs/xfs_fs.h:599

robbat2 avatar Jul 24 '17 18:07 robbat2

From my point of view, kernel maintainer of xfs should export their headers to the userspace (by placing them in include/uapi).

As workaround, you will have to update ioctls_list.c manually.

jerome-pouiller avatar May 06 '20 16:05 jerome-pouiller