]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: probe the scrub ioctl
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 17 Nov 2017 04:11:31 +0000 (22:11 -0600)
committerEric Sandeen <sandeen@redhat.com>
Fri, 17 Nov 2017 04:11:31 +0000 (22:11 -0600)
Source kernel commit: dcb660f9222fd9f607e7e05f4755b39b809ca19f

Create a probe scrubber with id 0.  This will be used by xfs_scrub to
probe the kernel's abilities to scrub (and repair) the metadata.  We do
this by validating the ioctl inputs from userspace, preparing the
filesystem for a scrub (or a repair) operation, and immediately
returning to userspace.  Userspace can use the returned errno and
structure state to decide (in broad terms) if scrub/repair are
supported by the running kernel.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_fs.h

index be235e82621b2a61f309bd6d333f027f274312e9..cff4358d9f455f35eddf7e518f1d12a5690c62af 100644 (file)
@@ -504,9 +504,10 @@ struct xfs_scrub_metadata {
  */
 
 /* Scrub subcommands. */
+#define XFS_SCRUB_TYPE_PROBE   0       /* presence test ioctl */
 
 /* Number of scrub subcommands. */
-#define XFS_SCRUB_TYPE_NR      0
+#define XFS_SCRUB_TYPE_NR      1
 
 /* i: Repair this metadata. */
 #define XFS_SCRUB_IFLAG_REPAIR         (1 << 0)