From 0a0c3bcc124eb6f44d16a8e9a8f145f547c2039b Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Tue, 11 Jan 2022 15:55:24 -0800 Subject: [PATCH] xfs: remove the XFS_IOC_FSSETDM definitions Source kernel commit: eb6504d3746b280c8bb1d763e3135c9d5725c3f7 Remove the definitions for these ioctls, since the functionality (and, weirdly, the 32-bit compat ioctl definitions) were removed from the kernel in November 2019. Signed-off-by: Darrick J. Wong --- libhandle/handle.c | 20 ++------------------ libxfs/xfs_fs.h | 29 ++++------------------------- man/man3/handle.3 | 1 + man/man3/xfsctl.3 | 2 ++ 4 files changed, 9 insertions(+), 43 deletions(-) diff --git a/libhandle/handle.c b/libhandle/handle.c index 27abc6b2a..4a05e4130 100644 --- a/libhandle/handle.c +++ b/libhandle/handle.c @@ -442,24 +442,8 @@ fssetdm_by_handle( size_t hlen, struct fsdmidata *fsdmidata) { - int fd; - char *path; - xfs_fsop_setdm_handlereq_t dmhreq; - - if ((fd = handle_to_fsfd(hanp, &path)) < 0) - return -1; - - dmhreq.hreq.fd = 0; - dmhreq.hreq.path = NULL; - dmhreq.hreq.oflags = O_LARGEFILE; - dmhreq.hreq.ihandle = hanp; - dmhreq.hreq.ihandlen = hlen; - dmhreq.hreq.ohandle = NULL; - dmhreq.hreq.ohandlen = NULL; - - dmhreq.data = fsdmidata; - - return xfsctl(path, fd, XFS_IOC_FSSETDM_BY_HANDLE, &dmhreq); + errno = EOPNOTSUPP; + return -1; } /*ARGSUSED1*/ diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h index 49c0e583d..505533c43 100644 --- a/libxfs/xfs_fs.h +++ b/libxfs/xfs_fs.h @@ -92,21 +92,6 @@ struct getbmapx { #define XFS_FMR_OWN_COW FMR_OWNER('X', 7) /* cow staging */ #define XFS_FMR_OWN_DEFECTIVE FMR_OWNER('X', 8) /* bad blocks */ -/* - * Structure for XFS_IOC_FSSETDM. - * For use by backup and restore programs to set the XFS on-disk inode - * fields di_dmevmask and di_dmstate. These must be set to exactly and - * only values previously obtained via xfs_bulkstat! (Specifically the - * struct xfs_bstat fields bs_dmevmask and bs_dmstate.) - */ -#ifndef HAVE_FSDMIDATA -struct fsdmidata { - __u32 fsd_dmevmask; /* corresponds to di_dmevmask */ - __u16 fsd_padding; - __u16 fsd_dmstate; /* corresponds to di_dmstate */ -}; -#endif - /* * File segment locking set data type for 64 bit access. * Also used for all the RESV/FREE interfaces. @@ -562,16 +547,10 @@ typedef struct xfs_fsop_handlereq { /* * Compound structures for passing args through Handle Request interfaces - * xfs_fssetdm_by_handle, xfs_attrlist_by_handle, xfs_attrmulti_by_handle - * - ioctls: XFS_IOC_FSSETDM_BY_HANDLE, XFS_IOC_ATTRLIST_BY_HANDLE, and - * XFS_IOC_ATTRMULTI_BY_HANDLE + * xfs_attrlist_by_handle, xfs_attrmulti_by_handle + * - ioctls: XFS_IOC_ATTRLIST_BY_HANDLE, and XFS_IOC_ATTRMULTI_BY_HANDLE */ -typedef struct xfs_fsop_setdm_handlereq { - struct xfs_fsop_handlereq hreq; /* handle information */ - struct fsdmidata __user *data; /* DMAPI data */ -} xfs_fsop_setdm_handlereq_t; - /* * Flags passed in xfs_attr_multiop.am_flags for the attr ioctl interface. * @@ -789,7 +768,7 @@ struct xfs_scrub_metadata { /* 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) +/* XFS_IOC_FSSETDM ------- deprecated 39 */ #define XFS_IOC_RESVSP _IOW ('X', 40, struct xfs_flock64) #define XFS_IOC_UNRESVSP _IOW ('X', 41, struct xfs_flock64) #define XFS_IOC_RESVSP64 _IOW ('X', 42, struct xfs_flock64) @@ -831,7 +810,7 @@ struct xfs_scrub_metadata { #define XFS_IOC_FREEZE _IOWR('X', 119, int) /* aka FIFREEZE */ #define XFS_IOC_THAW _IOWR('X', 120, int) /* aka FITHAW */ -#define XFS_IOC_FSSETDM_BY_HANDLE _IOW ('X', 121, struct xfs_fsop_setdm_handlereq) +/* XFS_IOC_FSSETDM_BY_HANDLE -- deprecated 121 */ #define XFS_IOC_ATTRLIST_BY_HANDLE _IOW ('X', 122, struct xfs_fsop_attrlist_handlereq) #define XFS_IOC_ATTRMULTI_BY_HANDLE _IOW ('X', 123, struct xfs_fsop_attrmulti_handlereq) #define XFS_IOC_FSGEOMETRY_V4 _IOR ('X', 124, struct xfs_fsop_geom_v4) diff --git a/man/man3/handle.3 b/man/man3/handle.3 index 154c0f298..2eb2bbcde 100644 --- a/man/man3/handle.3 +++ b/man/man3/handle.3 @@ -124,6 +124,7 @@ and fields in an XFS on-disk inode. It is analogous to the .BR "XFS_IOC_FSSETDM xfsctl" (3) command, except that a handle is specified instead of a file. +This function is not supported on Linux. .PP The .BR free_handle () diff --git a/man/man3/xfsctl.3 b/man/man3/xfsctl.3 index a591e61a7..4a0d4d08d 100644 --- a/man/man3/xfsctl.3 +++ b/man/man3/xfsctl.3 @@ -104,6 +104,7 @@ This command is restricted to root or to processes with device management capabilities. Its sole purpose is to allow backup and restore programs to restore the aforementioned critical on-disk inode fields. +This ioctl is not supported as of Linux 5.5. .TP .B XFS_IOC_DIOINFO @@ -318,6 +319,7 @@ functions (see .BR open_by_handle (3)). They are all subject to change and should not be called directly by applications. +XFS_IOC_FSSETDM_BY_HANDLE is not supported as of Linux 5.5. .SS Filesystem Operations In order to effect one of the following operations, the pathname -- 2.47.3