History

fs: XFS_IOC_FS[SG]SETXATTR to FS_IOC_FS[SG]ETXATTR promotion

Hoist the ioctl definitions for the XFS_IOC_FS[SG]SETXATTR API from fs/xfs/libxfs/xfs_fs.h to include/uapi/linux/fs.h so that the ioctls can be used by all filesystems, not just XFS. This enables (initially) ext4 to use the ioctl to set project IDs on inodes.

Dave Chinner committed 10 years ago

Commit 334e5801 parent 16830982 files · +50 −33Browse files

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

Unified · Split

include/uapi/linux/fs.h+32−0
@@ -110,6 +110,36 @@ struct inodes_stat_t { · 109 unmodified lines
110110 #define MS_MGC_VAL 0xC0ED0000
111111 #define MS_MGC_MSK 0xffff0000
112112
113+/*
114+ * Structure for FS_IOC_FSGETXATTR[A] and FS_IOC_FSSETXATTR.
115+ */
116+struct fsxattr {
117+ __u32 fsx_xflags; /* xflags field value (get/set) */
118+ __u32 fsx_extsize; /* extsize field value (get/set)*/
119+ __u32 fsx_nextents; /* nextents field value (get) */
120+ __u32 fsx_projid; /* project identifier (get/set) */
121+ unsigned char fsx_pad[12];
122+};
123+
124+/*
125+ * Flags for the fsx_xflags field
126+ */
127+#define FS_XFLAG_REALTIME 0x00000001 /* data in realtime volume */
128+#define FS_XFLAG_PREALLOC 0x00000002 /* preallocated file extents */
129+#define FS_XFLAG_IMMUTABLE 0x00000008 /* file cannot be modified */
130+#define FS_XFLAG_APPEND 0x00000010 /* all writes append */
131+#define FS_XFLAG_SYNC 0x00000020 /* all writes synchronous */
132+#define FS_XFLAG_NOATIME 0x00000040 /* do not update access time */
133+#define FS_XFLAG_NODUMP 0x00000080 /* do not include in backups */
134+#define FS_XFLAG_RTINHERIT 0x00000100 /* create with rt bit set */
135+#define FS_XFLAG_PROJINHERIT 0x00000200 /* create with parents projid */
136+#define FS_XFLAG_NOSYMLINKS 0x00000400 /* disallow symlink creation */
137+#define FS_XFLAG_EXTSIZE 0x00000800 /* extent size allocator hint */
138+#define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */
139+#define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */
140+#define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */
141+#define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */
142+
113143 /* the read-only stuff doesn't really belong here, but any other place is
114144 probably as bad and I don't want to create yet another include file. */
115145
@@ -169,6 +199,8 @@ struct inodes_stat_t { · 53 unmodified lines
169199 #define FS_IOC32_SETFLAGS _IOW('f', 2, int)
170200 #define FS_IOC32_GETVERSION _IOR('v', 1, int)
171201 #define FS_IOC32_SETVERSION _IOW('v', 2, int)
202+#define FS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr)
203+#define FS_IOC_FSSETXATTR _IOW ('X', 32, struct fsxattr)
172204
173205 /*
174206 * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t