History

fs: copy BTRFS_IOC_[SG]ET_FSLABEL to vfs

This retains 256 chars as the maximum size through the interface, which is the btrfs limit and AFAIK exceeds any other filesystem's maximum label size. This just copies the ioctl for now and leaves it in place for btrfs for the time being. A later patch will allow btrfs to use the new common ioctl definition, but it may be sent after this is merged. (Note, Reviewed-by's were originally given for the combined vfs+btrfs patch, some license taken here.)

Eric Sandeen committed 8 years ago

Commit 62750d01 parent 49dd56f2 files · +8 −3Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/fs.h+6−2
@@ -242,6 +242,8 @@ struct fsxattr { · 241 unmodified lines
242242 #define FICLONERANGE _IOW(0x94, 13, struct file_clone_range)
243243 #define FIDEDUPERANGE _IOWR(0x94, 54, struct file_dedupe_range)
244244
245+#define FSLABEL_MAX 256 /* Max chars for the interface; each fs may differ */
246+
245247 #define FS_IOC_GETFLAGS _IOR('f', 1, long)
246248 #define FS_IOC_SETFLAGS _IOW('f', 2, long)
247249 #define FS_IOC_GETVERSION _IOR('v', 1, long)
@@ -251,8 +253,10 @@ struct fsxattr { · 3 unmodified lines
251253 #define FS_IOC32_SETFLAGS _IOW('f', 2, int)
252254 #define FS_IOC32_GETVERSION _IOR('v', 1, int)
253255 #define FS_IOC32_SETVERSION _IOW('v', 2, int)
254−#define FS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr)
255−#define FS_IOC_FSSETXATTR _IOW ('X', 32, struct fsxattr)
256+#define FS_IOC_FSGETXATTR _IOR('X', 31, struct fsxattr)
257+#define FS_IOC_FSSETXATTR _IOW('X', 32, struct fsxattr)
258+#define FS_IOC_GETFSLABEL _IOR(0x94, 49, char[FSLABEL_MAX])
259+#define FS_IOC_SETFSLABEL _IOW(0x94, 50, char[FSLABEL_MAX])
256260
257261 /*
258262 * File system encryption support