xfs
[Top] [All Lists]

[PATCH 1/4] fs: hoist [GS]ET_FSLABEL to vfs

To: xfs@xxxxxxxxxxx
Subject: [PATCH 1/4] fs: hoist [GS]ET_FSLABEL to vfs
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Thu, 9 Jun 2016 11:38:40 -0500
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <c1922d3d-208c-3699-0a36-26108a4f44de@xxxxxxxxxxx>
References: <c1922d3d-208c-3699-0a36-26108a4f44de@xxxxxxxxxxx>
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.1
Move the btrfs label ioctls up to the vfs for general use.

Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
---

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 053e677..b23be4e 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -5431,6 +5431,10 @@ long btrfs_ioctl(struct file *file, unsigned int
                return btrfs_ioctl_setflags(file, argp);
        case FS_IOC_GETVERSION:
                return btrfs_ioctl_getversion(file, argp);
+       case FS_IOC_GET_FSLABEL:
+               return btrfs_ioctl_get_fslabel(file, argp);
+       case FS_IOC_SET_FSLABEL:
+               return btrfs_ioctl_set_fslabel(file, argp);
        case FITRIM:
                return btrfs_ioctl_fitrim(file, argp);
        case BTRFS_IOC_SNAP_CREATE:
@@ -5538,10 +5542,6 @@ long btrfs_ioctl(struct file *file, unsigned int
                return btrfs_ioctl_quota_rescan_wait(file, argp);
        case BTRFS_IOC_DEV_REPLACE:
                return btrfs_ioctl_dev_replace(root, argp);
-       case BTRFS_IOC_GET_FSLABEL:
-               return btrfs_ioctl_get_fslabel(file, argp);
-       case BTRFS_IOC_SET_FSLABEL:
-               return btrfs_ioctl_set_fslabel(file, argp);
        case BTRFS_IOC_GET_SUPPORTED_FEATURES:
                return btrfs_ioctl_get_supported_features(argp);
        case BTRFS_IOC_GET_FEATURES:
diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h
index a079d50..fca64f2 100644
--- a/include/uapi/linux/fs.h
+++ b/include/uapi/linux/fs.h
@@ -234,6 +234,8 @@ struct fsxattr {
 #define FICLONERANGE   _IOW(0x94, 13, struct file_clone_range)
 #define FIDEDUPERANGE  _IOWR(0x94, 54, struct file_dedupe_range)
 
+#define FSLABEL_MAX 256        /* Max chars for the interface; each fs may 
differ */
+
 #define        FS_IOC_GETFLAGS                 _IOR('f', 1, long)
 #define        FS_IOC_SETFLAGS                 _IOW('f', 2, long)
 #define        FS_IOC_GETVERSION               _IOR('v', 1, long)
@@ -243,8 +245,10 @@ struct fsxattr {
 #define FS_IOC32_SETFLAGS              _IOW('f', 2, int)
 #define FS_IOC32_GETVERSION            _IOR('v', 1, int)
 #define FS_IOC32_SETVERSION            _IOW('v', 2, int)
-#define FS_IOC_FSGETXATTR              _IOR ('X', 31, struct fsxattr)
-#define FS_IOC_FSSETXATTR              _IOW ('X', 32, struct fsxattr)
+#define FS_IOC_FSGETXATTR              _IOR('X', 31, struct fsxattr)
+#define FS_IOC_FSSETXATTR              _IOW('X', 32, struct fsxattr)
+#define FS_IOC_GET_FSLABEL             _IOR(0x94, 49, char[FSLABEL_MAX])
+#define FS_IOC_SET_FSLABEL             _IOW(0x94, 50, char[FSLABEL_MAX])
 
 /*
  * File system encryption support

<Prev in Thread] Current Thread [Next in Thread>