Re: [PATCH 2/2] xfs: hide the XFS_IOC_{ALLOC,FREE}SP* definitions

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

 



On 1/10/22 11:51 AM, Darrick J. Wong wrote:
From: Darrick J. Wong <djwong@xxxxxxxxxx>

Now that we've made these ioctls defunct, move them from xfs_fs.h to
xfs_ioctl.c, which effectively removes them from the publicly supported
ioctl interfaces for XFS.

You pointed out on IRC that you need to hide the 32-bit/compat ones too,
so I'll wait for a V2 on that?  (XFS_IOC_ALLOCSP_32 & friends).

But the approach seems fine.

Thanks,
-Eric

Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx>
---
  fs/xfs/libxfs/xfs_fs.h |    8 ++++----
  fs/xfs/xfs_ioctl.c     |    9 +++++++++
  2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_fs.h b/fs/xfs/libxfs/xfs_fs.h
index c43877c8a279..49c0e583d6bb 100644
--- a/fs/xfs/libxfs/xfs_fs.h
+++ b/fs/xfs/libxfs/xfs_fs.h
@@ -781,13 +781,13 @@ struct xfs_scrub_metadata {
   * For 'documentation' purposed more than anything else,
   * the "cmd #" field reflects the IRIX fcntl number.
   */
-#define XFS_IOC_ALLOCSP		_IOW ('X', 10, struct xfs_flock64)
-#define XFS_IOC_FREESP		_IOW ('X', 11, struct xfs_flock64)
+/*	XFS_IOC_ALLOCSP ------- deprecated 10	 */
+/*	XFS_IOC_FREESP -------- deprecated 11	 */
  #define XFS_IOC_DIOINFO		_IOR ('X', 30, struct dioattr)
  #define XFS_IOC_FSGETXATTR	FS_IOC_FSGETXATTR
  #define XFS_IOC_FSSETXATTR	FS_IOC_FSSETXATTR
-#define XFS_IOC_ALLOCSP64	_IOW ('X', 36, struct xfs_flock64)
-#define XFS_IOC_FREESP64	_IOW ('X', 37, struct xfs_flock64)
+/*	XFS_IOC_ALLOCSP64 ----- deprecated 36	 */
+/*	XFS_IOC_FREESP64 ------ deprecated 37	 */
  #define XFS_IOC_GETBMAP		_IOWR('X', 38, struct getbmap)
  #define XFS_IOC_FSSETDM		_IOW ('X', 39, struct fsdmidata)
  #define XFS_IOC_RESVSP		_IOW ('X', 40, struct xfs_flock64)
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index 38b2a1e881a6..15ec3d4a1516 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -1854,6 +1854,15 @@ xfs_fs_eofblocks_from_user(
  	return 0;
  }
+/*
+ * These long-unused ioctls were removed from the official ioctl API in 5.17,
+ * but retain these definitions so that we can log warnings about them.
+ */
+#define XFS_IOC_ALLOCSP		_IOW ('X', 10, struct xfs_flock64)
+#define XFS_IOC_FREESP		_IOW ('X', 11, struct xfs_flock64)
+#define XFS_IOC_ALLOCSP64	_IOW ('X', 36, struct xfs_flock64)
+#define XFS_IOC_FREESP64	_IOW ('X', 37, struct xfs_flock64)
+
  /*
   * Note: some of the ioctl's return positive numbers as a
   * byte count indicating success, such as readlink_by_handle.





[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux