History

tree-wide: s/struct fileattr/struct file_kattr/g

Now that we expose struct file_attr as our uapi struct rename all the internal struct to struct file_kattr to clearly communicate that it is a kernel internal struct. This is similar to struct mount_{k}attr and others.

Christian Brauner committed 1 year ago

Commit ca115d71 parent 662416543 files · +122 −122Browse files

Unified · Split

43 files
  1. Documentation/filesystems/locking.rst +2 −2
  2. Documentation/filesystems/vfs.rst +2 −2
  3. fs/bcachefs/fs.c +2 −2
  4. fs/btrfs/ioctl.c +2 −2
  5. fs/btrfs/ioctl.h +3 −3
  6. fs/ecryptfs/inode.c +2 −2
  7. fs/efivarfs/inode.c +2 −2
  8. fs/ext2/ext2.h +2 −2
  9. fs/ext2/ioctl.c +2 −2
  10. fs/ext4/ext4.h +2 −2
  11. fs/ext4/ioctl.c +2 −2
  12. fs/f2fs/f2fs.h +2 −2
  13. fs/f2fs/file.c +2 −2
  14. fs/file_attr.c +17 −17
  15. fs/fuse/fuse_i.h +2 −2
  16. fs/fuse/ioctl.c +2 −2
  17. fs/gfs2/file.c +2 −2
  18. fs/gfs2/inode.h +2 −2
  19. fs/hfsplus/hfsplus_fs.h +2 −2
  20. fs/hfsplus/inode.c +2 −2
  21. fs/jfs/ioctl.c +2 −2
  22. fs/jfs/jfs_inode.h +2 −2
  23. fs/nilfs2/ioctl.c +2 −2
  24. fs/nilfs2/nilfs.h +2 −2
  25. fs/ocfs2/ioctl.c +2 −2
  26. fs/ocfs2/ioctl.h +2 −2
  27. fs/orangefs/inode.c +2 −2
  28. fs/overlayfs/copy_up.c +2 −2
  29. fs/overlayfs/inode.c +6 −6
  30. fs/overlayfs/overlayfs.h +5 −5
  31. fs/overlayfs/util.c +1 −1
  32. fs/ubifs/ioctl.c +2 −2
  33. fs/ubifs/ubifs.h +2 −2
  34. fs/xfs/xfs_ioctl.c +9 −9
  35. fs/xfs/xfs_ioctl.h +2 −2
  36. include/linux/fileattr.h +7 −7
  37. include/linux/fs.h +3 −3
  38. include/linux/lsm_hook_defs.h +2 −2
  39. include/linux/security.h +4 −4
  40. include/uapi/linux/fs.h +1 −1
  41. mm/shmem.c +2 −2
  42. security/security.c +2 −2
  43. security/selinux/hooks.c +2 −2
Documentation/filesystems/locking.rst+2−2
@@ -87,8 +87,8 @@ prototypes:: · 86 unmodified lines
87 int (*tmpfile) (struct mnt_idmap *, struct inode *,87 int (*tmpfile) (struct mnt_idmap *, struct inode *,
88 struct file *, umode_t);88 struct file *, umode_t);
89 int (*fileattr_set)(struct mnt_idmap *idmap,89 int (*fileattr_set)(struct mnt_idmap *idmap,
90 struct dentry *dentry, struct fileattr *fa);90 struct dentry *dentry, struct file_kattr *fa);
91 int (*fileattr_get)(struct dentry *dentry, struct fileattr *fa);91 int (*fileattr_get)(struct dentry *dentry, struct file_kattr *fa);
92 struct posix_acl * (*get_acl)(struct mnt_idmap *, struct dentry *, int);92 struct posix_acl * (*get_acl)(struct mnt_idmap *, struct dentry *, int);
93 struct offset_ctx *(*get_offset_ctx)(struct inode *inode);93 struct offset_ctx *(*get_offset_ctx)(struct inode *inode);
94 94
Documentation/filesystems/vfs.rst+2−2
@@ -515,8 +515,8 @@ As of kernel 2.6.22, the following members are defined: · 514 unmodified lines
515 struct posix_acl * (*get_acl)(struct mnt_idmap *, struct dentry *, int);515 struct posix_acl * (*get_acl)(struct mnt_idmap *, struct dentry *, int);
516 int (*set_acl)(struct mnt_idmap *, struct dentry *, struct posix_acl *, int);516 int (*set_acl)(struct mnt_idmap *, struct dentry *, struct posix_acl *, int);
517 int (*fileattr_set)(struct mnt_idmap *idmap,517 int (*fileattr_set)(struct mnt_idmap *idmap,
518 struct dentry *dentry, struct fileattr *fa);518 struct dentry *dentry, struct file_kattr *fa);
519 int (*fileattr_get)(struct dentry *dentry, struct fileattr *fa);519 int (*fileattr_get)(struct dentry *dentry, struct file_kattr *fa);
520 struct offset_ctx *(*get_offset_ctx)(struct inode *inode);520 struct offset_ctx *(*get_offset_ctx)(struct inode *inode);
521 };521 };
522 522
fs/bcachefs/fs.c+2−2
@@ -1619,7 +1619,7 @@ static const __maybe_unused unsigned bch_flags_to_xflags[] = { · 1618 unmodified lines
1619};1619};
1620 1620
1621static int bch2_fileattr_get(struct dentry *dentry,1621static int bch2_fileattr_get(struct dentry *dentry,
1622 struct fileattr *fa)1622 struct file_kattr *fa)
1623{1623{
1624 struct bch_inode_info *inode = to_bch_ei(d_inode(dentry));1624 struct bch_inode_info *inode = to_bch_ei(d_inode(dentry));
1625 struct bch_fs *c = inode->v.i_sb->s_fs_info;1625 struct bch_fs *c = inode->v.i_sb->s_fs_info;
@@ -1682,7 +1682,7 @@ static int fssetxattr_inode_update_fn(struct btree_trans *trans, · 56 unmodified lines
1682 1682
1683static int bch2_fileattr_set(struct mnt_idmap *idmap,1683static int bch2_fileattr_set(struct mnt_idmap *idmap,
1684 struct dentry *dentry,1684 struct dentry *dentry,
1685 struct fileattr *fa)1685 struct file_kattr *fa)
1686{1686{
1687 struct bch_inode_info *inode = to_bch_ei(d_inode(dentry));1687 struct bch_inode_info *inode = to_bch_ei(d_inode(dentry));
1688 struct bch_fs *c = inode->v.i_sb->s_fs_info;1688 struct bch_fs *c = inode->v.i_sb->s_fs_info;
fs/btrfs/ioctl.c+2−2
@@ -245,7 +245,7 @@ static int btrfs_check_ioctl_vol_args2_subvol_name(const struct btrfs_ioctl_vol_ · 244 unmodified lines
245 * Set flags/xflags from the internal inode flags. The remaining items of245 * Set flags/xflags from the internal inode flags. The remaining items of
246 * fsxattr are zeroed.246 * fsxattr are zeroed.
247 */247 */
248int btrfs_fileattr_get(struct dentry *dentry, struct fileattr *fa)248int btrfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa)
249{249{
250 const struct btrfs_inode *inode = BTRFS_I(d_inode(dentry));250 const struct btrfs_inode *inode = BTRFS_I(d_inode(dentry));
251 251
@@ -254,7 +254,7 @@ int btrfs_fileattr_get(struct dentry *dentry, struct fileattr *fa) · 2 unmodified lines
254}254}
255 255
256int btrfs_fileattr_set(struct mnt_idmap *idmap,256int btrfs_fileattr_set(struct mnt_idmap *idmap,
257 struct dentry *dentry, struct fileattr *fa)257 struct dentry *dentry, struct file_kattr *fa)
258{258{
259 struct btrfs_inode *inode = BTRFS_I(d_inode(dentry));259 struct btrfs_inode *inode = BTRFS_I(d_inode(dentry));
260 struct btrfs_root *root = inode->root;260 struct btrfs_root *root = inode->root;
fs/btrfs/ioctl.h+3−3
@@ -8,7 +8,7 @@ · 7 unmodified lines
8struct file;8struct file;
9struct dentry;9struct dentry;
10struct mnt_idmap;10struct mnt_idmap;
11struct fileattr;11struct file_kattr;
12struct io_uring_cmd;12struct io_uring_cmd;
13struct btrfs_inode;13struct btrfs_inode;
14struct btrfs_fs_info;14struct btrfs_fs_info;
@@ -16,9 +16,9 @@ struct btrfs_ioctl_balance_args; · 1 unmodified line
16 16
17long btrfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg);17long btrfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
18long btrfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg);18long btrfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
19int btrfs_fileattr_get(struct dentry *dentry, struct fileattr *fa);19int btrfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa);
20int btrfs_fileattr_set(struct mnt_idmap *idmap,20int btrfs_fileattr_set(struct mnt_idmap *idmap,
21 struct dentry *dentry, struct fileattr *fa);21 struct dentry *dentry, struct file_kattr *fa);
22int btrfs_ioctl_get_supported_features(void __user *arg);22int btrfs_ioctl_get_supported_features(void __user *arg);
23void btrfs_sync_inode_flags_to_i_flags(struct btrfs_inode *inode);23void btrfs_sync_inode_flags_to_i_flags(struct btrfs_inode *inode);
24void btrfs_update_ioctl_balance_args(struct btrfs_fs_info *fs_info,24void btrfs_update_ioctl_balance_args(struct btrfs_fs_info *fs_info,
fs/ecryptfs/inode.c+2−2
@@ -1124,13 +1124,13 @@ out: · 1123 unmodified lines
1124 return rc;1124 return rc;
1125}1125}
1126 1126
1127static int ecryptfs_fileattr_get(struct dentry *dentry, struct fileattr *fa)1127static int ecryptfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa)
1128{1128{
1129 return vfs_fileattr_get(ecryptfs_dentry_to_lower(dentry), fa);1129 return vfs_fileattr_get(ecryptfs_dentry_to_lower(dentry), fa);
1130}1130}
1131 1131
1132static int ecryptfs_fileattr_set(struct mnt_idmap *idmap,1132static int ecryptfs_fileattr_set(struct mnt_idmap *idmap,
1133 struct dentry *dentry, struct fileattr *fa)1133 struct dentry *dentry, struct file_kattr *fa)
1134{1134{
1135 struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry);1135 struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry);
1136 int rc;1136 int rc;
fs/efivarfs/inode.c+2−2
@@ -138,7 +138,7 @@ const struct inode_operations efivarfs_dir_inode_operations = { · 137 unmodified lines
138};138};
139 139
140static int140static int
141efivarfs_fileattr_get(struct dentry *dentry, struct fileattr *fa)141efivarfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa)
142{142{
143 unsigned int i_flags;143 unsigned int i_flags;
144 unsigned int flags = 0;144 unsigned int flags = 0;
@@ -154,7 +154,7 @@ efivarfs_fileattr_get(struct dentry *dentry, struct fileattr *fa) · 9 unmodified lines
154 154
155static int155static int
156efivarfs_fileattr_set(struct mnt_idmap *idmap,156efivarfs_fileattr_set(struct mnt_idmap *idmap,
157 struct dentry *dentry, struct fileattr *fa)157 struct dentry *dentry, struct file_kattr *fa)
158{158{
159 unsigned int i_flags = 0;159 unsigned int i_flags = 0;
160 160
fs/ext2/ext2.h+2−2
@@ -750,9 +750,9 @@ extern int ext2_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, · 749 unmodified lines
750 u64 start, u64 len);750 u64 start, u64 len);
751 751
752/* ioctl.c */752/* ioctl.c */
753extern int ext2_fileattr_get(struct dentry *dentry, struct fileattr *fa);753extern int ext2_fileattr_get(struct dentry *dentry, struct file_kattr *fa);
754extern int ext2_fileattr_set(struct mnt_idmap *idmap,754extern int ext2_fileattr_set(struct mnt_idmap *idmap,
755 struct dentry *dentry, struct fileattr *fa);755 struct dentry *dentry, struct file_kattr *fa);
756extern long ext2_ioctl(struct file *, unsigned int, unsigned long);756extern long ext2_ioctl(struct file *, unsigned int, unsigned long);
757extern long ext2_compat_ioctl(struct file *, unsigned int, unsigned long);757extern long ext2_compat_ioctl(struct file *, unsigned int, unsigned long);
758 758
fs/ext2/ioctl.c+2−2
@@ -18,7 +18,7 @@ · 17 unmodified lines
18#include <linux/uaccess.h>18#include <linux/uaccess.h>
19#include <linux/fileattr.h>19#include <linux/fileattr.h>
20 20
21int ext2_fileattr_get(struct dentry *dentry, struct fileattr *fa)21int ext2_fileattr_get(struct dentry *dentry, struct file_kattr *fa)
22{22{
23 struct ext2_inode_info *ei = EXT2_I(d_inode(dentry));23 struct ext2_inode_info *ei = EXT2_I(d_inode(dentry));
24 24
@@ -28,7 +28,7 @@ int ext2_fileattr_get(struct dentry *dentry, struct fileattr *fa) · 3 unmodified lines
28}28}
29 29
30int ext2_fileattr_set(struct mnt_idmap *idmap,30int ext2_fileattr_set(struct mnt_idmap *idmap,
31 struct dentry *dentry, struct fileattr *fa)31 struct dentry *dentry, struct file_kattr *fa)
32{32{
33 struct inode *inode = d_inode(dentry);33 struct inode *inode = d_inode(dentry);
34 struct ext2_inode_info *ei = EXT2_I(inode);34 struct ext2_inode_info *ei = EXT2_I(inode);
fs/ext4/ext4.h+2−2
@@ -3103,8 +3103,8 @@ extern int ext4_ind_remove_space(handle_t *handle, struct inode *inode, · 3102 unmodified lines
3103extern long ext4_ioctl(struct file *, unsigned int, unsigned long);3103extern long ext4_ioctl(struct file *, unsigned int, unsigned long);
3104extern long ext4_compat_ioctl(struct file *, unsigned int, unsigned long);3104extern long ext4_compat_ioctl(struct file *, unsigned int, unsigned long);
3105int ext4_fileattr_set(struct mnt_idmap *idmap,3105int ext4_fileattr_set(struct mnt_idmap *idmap,
3106 struct dentry *dentry, struct fileattr *fa);3106 struct dentry *dentry, struct file_kattr *fa);
3107int ext4_fileattr_get(struct dentry *dentry, struct fileattr *fa);3107int ext4_fileattr_get(struct dentry *dentry, struct file_kattr *fa);
3108extern void ext4_reset_inode_seed(struct inode *inode);3108extern void ext4_reset_inode_seed(struct inode *inode);
3109int ext4_update_overhead(struct super_block *sb, bool force);3109int ext4_update_overhead(struct super_block *sb, bool force);
3110int ext4_force_shutdown(struct super_block *sb, u32 flags);3110int ext4_force_shutdown(struct super_block *sb, u32 flags);
fs/ext4/ioctl.c+2−2
@@ -980,7 +980,7 @@ group_add_out: · 979 unmodified lines
980 return err;980 return err;
981}981}
982 982
983int ext4_fileattr_get(struct dentry *dentry, struct fileattr *fa)983int ext4_fileattr_get(struct dentry *dentry, struct file_kattr *fa)
984{984{
985 struct inode *inode = d_inode(dentry);985 struct inode *inode = d_inode(dentry);
986 struct ext4_inode_info *ei = EXT4_I(inode);986 struct ext4_inode_info *ei = EXT4_I(inode);
@@ -997,7 +997,7 @@ int ext4_fileattr_get(struct dentry *dentry, struct fileattr *fa) · 10 unmodified lines
997}997}
998 998
999int ext4_fileattr_set(struct mnt_idmap *idmap,999int ext4_fileattr_set(struct mnt_idmap *idmap,
1000 struct dentry *dentry, struct fileattr *fa)1000 struct dentry *dentry, struct file_kattr *fa)
1001{1001{
1002 struct inode *inode = d_inode(dentry);1002 struct inode *inode = d_inode(dentry);
1003 u32 flags = fa->flags;1003 u32 flags = fa->flags;
fs/f2fs/f2fs.h+2−2
@@ -3615,9 +3615,9 @@ void f2fs_truncate_data_blocks_range(struct dnode_of_data *dn, int count); · 3614 unmodified lines
3615int f2fs_do_shutdown(struct f2fs_sb_info *sbi, unsigned int flag,3615int f2fs_do_shutdown(struct f2fs_sb_info *sbi, unsigned int flag,
3616 bool readonly, bool need_lock);3616 bool readonly, bool need_lock);
3617int f2fs_precache_extents(struct inode *inode);3617int f2fs_precache_extents(struct inode *inode);
3618int f2fs_fileattr_get(struct dentry *dentry, struct fileattr *fa);3618int f2fs_fileattr_get(struct dentry *dentry, struct file_kattr *fa);
3619int f2fs_fileattr_set(struct mnt_idmap *idmap,3619int f2fs_fileattr_set(struct mnt_idmap *idmap,
3620 struct dentry *dentry, struct fileattr *fa);3620 struct dentry *dentry, struct file_kattr *fa);
3621long f2fs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);3621long f2fs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
3622long f2fs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg);3622long f2fs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
3623int f2fs_transfer_project_quota(struct inode *inode, kprojid_t kprojid);3623int f2fs_transfer_project_quota(struct inode *inode, kprojid_t kprojid);
fs/f2fs/file.c+2−2
@@ -3356,7 +3356,7 @@ static int f2fs_ioc_setproject(struct inode *inode, __u32 projid) · 3355 unmodified lines
3356}3356}
3357#endif3357#endif
3358 3358
3359int f2fs_fileattr_get(struct dentry *dentry, struct fileattr *fa)3359int f2fs_fileattr_get(struct dentry *dentry, struct file_kattr *fa)
3360{3360{
3361 struct inode *inode = d_inode(dentry);3361 struct inode *inode = d_inode(dentry);
3362 struct f2fs_inode_info *fi = F2FS_I(inode);3362 struct f2fs_inode_info *fi = F2FS_I(inode);
@@ -3380,7 +3380,7 @@ int f2fs_fileattr_get(struct dentry *dentry, struct fileattr *fa) · 17 unmodified lines
3380}3380}
3381 3381
3382int f2fs_fileattr_set(struct mnt_idmap *idmap,3382int f2fs_fileattr_set(struct mnt_idmap *idmap,
3383 struct dentry *dentry, struct fileattr *fa)3383 struct dentry *dentry, struct file_kattr *fa)
3384{3384{
3385 struct inode *inode = d_inode(dentry);3385 struct inode *inode = d_inode(dentry);
3386 u32 fsflags = fa->flags, mask = F2FS_SETTABLE_FS_FL;3386 u32 fsflags = fa->flags, mask = F2FS_SETTABLE_FS_FL;
fs/file_attr.c+17−17
@@ -17,7 +17,7 @@ · 16 unmodified lines
17 * Set ->fsx_xflags, ->fsx_valid and ->flags (translated xflags). All17 * Set ->fsx_xflags, ->fsx_valid and ->flags (translated xflags). All
18 * other fields are zeroed.18 * other fields are zeroed.
19 */19 */
20void fileattr_fill_xflags(struct fileattr *fa, u32 xflags)20void fileattr_fill_xflags(struct file_kattr *fa, u32 xflags)
21{21{
22 memset(fa, 0, sizeof(*fa));22 memset(fa, 0, sizeof(*fa));
23 fa->fsx_valid = true;23 fa->fsx_valid = true;
@@ -47,7 +47,7 @@ EXPORT_SYMBOL(fileattr_fill_xflags); · 23 unmodified lines
47 * Set ->flags, ->flags_valid and ->fsx_xflags (translated flags).47 * Set ->flags, ->flags_valid and ->fsx_xflags (translated flags).
48 * All other fields are zeroed.48 * All other fields are zeroed.
49 */49 */
50void fileattr_fill_flags(struct fileattr *fa, u32 flags)50void fileattr_fill_flags(struct file_kattr *fa, u32 flags)
51{51{
52 memset(fa, 0, sizeof(*fa));52 memset(fa, 0, sizeof(*fa));
53 fa->flags_valid = true;53 fa->flags_valid = true;
@@ -78,7 +78,7 @@ EXPORT_SYMBOL(fileattr_fill_flags); · 24 unmodified lines
78 *78 *
79 * Return: 0 on success, or a negative error on failure.79 * Return: 0 on success, or a negative error on failure.
80 */80 */
81int vfs_fileattr_get(struct dentry *dentry, struct fileattr *fa)81int vfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa)
82{82{
83 struct inode *inode = d_inode(dentry);83 struct inode *inode = d_inode(dentry);
84 int error;84 int error;
@@ -94,7 +94,7 @@ int vfs_fileattr_get(struct dentry *dentry, struct fileattr *fa) · 9 unmodified lines
94}94}
95EXPORT_SYMBOL(vfs_fileattr_get);95EXPORT_SYMBOL(vfs_fileattr_get);
96 96
97static void fileattr_to_file_attr(const struct fileattr *fa,97static void fileattr_to_file_attr(const struct file_kattr *fa,
98 struct file_attr *fattr)98 struct file_attr *fattr)
99{99{
100 __u32 mask = FS_XFLAGS_MASK;100 __u32 mask = FS_XFLAGS_MASK;
@@ -114,7 +114,7 @@ static void fileattr_to_file_attr(const struct fileattr *fa, · 13 unmodified lines
114 *114 *
115 * Return: 0 on success, or -EFAULT on failure.115 * Return: 0 on success, or -EFAULT on failure.
116 */116 */
117int copy_fsxattr_to_user(const struct fileattr *fa, struct fsxattr __user *ufa)117int copy_fsxattr_to_user(const struct file_kattr *fa, struct fsxattr __user *ufa)
118{118{
119 struct fsxattr xfa;119 struct fsxattr xfa;
120 __u32 mask = FS_XFLAGS_MASK;120 __u32 mask = FS_XFLAGS_MASK;
@@ -134,7 +134,7 @@ int copy_fsxattr_to_user(const struct fileattr *fa, struct fsxattr __user *ufa) · 13 unmodified lines
134EXPORT_SYMBOL(copy_fsxattr_to_user);134EXPORT_SYMBOL(copy_fsxattr_to_user);
135 135
136static int file_attr_to_fileattr(const struct file_attr *fattr,136static int file_attr_to_fileattr(const struct file_attr *fattr,
137 struct fileattr *fa)137 struct file_kattr *fa)
138{138{
139 __u32 mask = FS_XFLAGS_MASK;139 __u32 mask = FS_XFLAGS_MASK;
140 140
@@ -150,7 +150,7 @@ static int file_attr_to_fileattr(const struct file_attr *fattr, · 9 unmodified lines
150 return 0;150 return 0;
151}151}
152 152
153static int copy_fsxattr_from_user(struct fileattr *fa,153static int copy_fsxattr_from_user(struct file_kattr *fa,
154 struct fsxattr __user *ufa)154 struct fsxattr __user *ufa)
155{155{
156 struct fsxattr xfa;156 struct fsxattr xfa;
@@ -179,8 +179,8 @@ static int copy_fsxattr_from_user(struct fileattr *fa, · 22 unmodified lines
179 * Note: must be called with inode lock held.179 * Note: must be called with inode lock held.
180 */180 */
181static int fileattr_set_prepare(struct inode *inode,181static int fileattr_set_prepare(struct inode *inode,
182 const struct fileattr *old_ma,182 const struct file_kattr *old_ma,
183 struct fileattr *fa)183 struct file_kattr *fa)
184{184{
185 int err;185 int err;
186 186
@@ -263,10 +263,10 @@ static int fileattr_set_prepare(struct inode *inode, · 76 unmodified lines
263 * Return: 0 on success, or a negative error on failure.263 * Return: 0 on success, or a negative error on failure.
264 */264 */
265int vfs_fileattr_set(struct mnt_idmap *idmap, struct dentry *dentry,265int vfs_fileattr_set(struct mnt_idmap *idmap, struct dentry *dentry,
266 struct fileattr *fa)266 struct file_kattr *fa)
267{267{
268 struct inode *inode = d_inode(dentry);268 struct inode *inode = d_inode(dentry);
269 struct fileattr old_ma = {};269 struct file_kattr old_ma = {};
270 int err;270 int err;
271 271
272 if (!inode->i_op->fileattr_set)272 if (!inode->i_op->fileattr_set)
@@ -308,7 +308,7 @@ EXPORT_SYMBOL(vfs_fileattr_set); · 35 unmodified lines
308 308
309int ioctl_getflags(struct file *file, unsigned int __user *argp)309int ioctl_getflags(struct file *file, unsigned int __user *argp)
310{310{
311 struct fileattr fa = { .flags_valid = true }; /* hint only */311 struct file_kattr fa = { .flags_valid = true }; /* hint only */
312 int err;312 int err;
313 313
314 err = vfs_fileattr_get(file->f_path.dentry, &fa);314 err = vfs_fileattr_get(file->f_path.dentry, &fa);
@@ -324,7 +324,7 @@ int ioctl_setflags(struct file *file, unsigned int __user *argp) · 9 unmodified lines
324{324{
325 struct mnt_idmap *idmap = file_mnt_idmap(file);325 struct mnt_idmap *idmap = file_mnt_idmap(file);
326 struct dentry *dentry = file->f_path.dentry;326 struct dentry *dentry = file->f_path.dentry;
327 struct fileattr fa;327 struct file_kattr fa;
328 unsigned int flags;328 unsigned int flags;
329 int err;329 int err;
330 330
@@ -345,7 +345,7 @@ EXPORT_SYMBOL(ioctl_setflags); · 14 unmodified lines
345 345
346int ioctl_fsgetxattr(struct file *file, void __user *argp)346int ioctl_fsgetxattr(struct file *file, void __user *argp)
347{347{
348 struct fileattr fa = { .fsx_valid = true }; /* hint only */348 struct file_kattr fa = { .fsx_valid = true }; /* hint only */
349 int err;349 int err;
350 350
351 err = vfs_fileattr_get(file->f_path.dentry, &fa);351 err = vfs_fileattr_get(file->f_path.dentry, &fa);
@@ -362,7 +362,7 @@ int ioctl_fssetxattr(struct file *file, void __user *argp) · 10 unmodified lines
362{362{
363 struct mnt_idmap *idmap = file_mnt_idmap(file);363 struct mnt_idmap *idmap = file_mnt_idmap(file);
364 struct dentry *dentry = file->f_path.dentry;364 struct dentry *dentry = file->f_path.dentry;
365 struct fileattr fa;365 struct file_kattr fa;
366 int err;366 int err;
367 367
368 err = copy_fsxattr_from_user(&fa, argp);368 err = copy_fsxattr_from_user(&fa, argp);
@@ -387,7 +387,7 @@ SYSCALL_DEFINE5(file_getattr, int, dfd, const char __user *, filename, · 18 unmodified lines
387 struct filename *name __free(putname) = NULL;387 struct filename *name __free(putname) = NULL;
388 unsigned int lookup_flags = 0;388 unsigned int lookup_flags = 0;
389 struct file_attr fattr;389 struct file_attr fattr;
390 struct fileattr fa;390 struct file_kattr fa;
391 int error;391 int error;
392 392
393 BUILD_BUG_ON(sizeof(struct file_attr) < FILE_ATTR_SIZE_VER0);393 BUILD_BUG_ON(sizeof(struct file_attr) < FILE_ATTR_SIZE_VER0);
@@ -442,7 +442,7 @@ SYSCALL_DEFINE5(file_setattr, int, dfd, const char __user *, filename, · 48 unmodified lines
442 struct filename *name __free(putname) = NULL;442 struct filename *name __free(putname) = NULL;
443 unsigned int lookup_flags = 0;443 unsigned int lookup_flags = 0;
444 struct file_attr fattr;444 struct file_attr fattr;
445 struct fileattr fa;445 struct file_kattr fa;
446 int error;446 int error;
447 447
448 BUILD_BUG_ON(sizeof(struct file_attr) < FILE_ATTR_SIZE_VER0);448 BUILD_BUG_ON(sizeof(struct file_attr) < FILE_ATTR_SIZE_VER0);
fs/fuse/fuse_i.h+2−2
@@ -1486,9 +1486,9 @@ void fuse_dax_cancel_work(struct fuse_conn *fc); · 1485 unmodified lines
1486long fuse_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg);1486long fuse_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
1487long fuse_file_compat_ioctl(struct file *file, unsigned int cmd,1487long fuse_file_compat_ioctl(struct file *file, unsigned int cmd,
1488 unsigned long arg);1488 unsigned long arg);
1489int fuse_fileattr_get(struct dentry *dentry, struct fileattr *fa);1489int fuse_fileattr_get(struct dentry *dentry, struct file_kattr *fa);
1490int fuse_fileattr_set(struct mnt_idmap *idmap,1490int fuse_fileattr_set(struct mnt_idmap *idmap,
1491 struct dentry *dentry, struct fileattr *fa);1491 struct dentry *dentry, struct file_kattr *fa);
1492 1492
1493/* iomode.c */1493/* iomode.c */
1494int fuse_file_cached_io_open(struct inode *inode, struct fuse_file *ff);1494int fuse_file_cached_io_open(struct inode *inode, struct fuse_file *ff);
fs/fuse/ioctl.c+2−2
@@ -502,7 +502,7 @@ static void fuse_priv_ioctl_cleanup(struct inode *inode, struct fuse_file *ff) · 501 unmodified lines
502 fuse_file_release(inode, ff, O_RDONLY, NULL, S_ISDIR(inode->i_mode));502 fuse_file_release(inode, ff, O_RDONLY, NULL, S_ISDIR(inode->i_mode));
503}503}
504 504
505int fuse_fileattr_get(struct dentry *dentry, struct fileattr *fa)505int fuse_fileattr_get(struct dentry *dentry, struct file_kattr *fa)
506{506{
507 struct inode *inode = d_inode(dentry);507 struct inode *inode = d_inode(dentry);
508 struct fuse_file *ff;508 struct fuse_file *ff;
@@ -542,7 +542,7 @@ cleanup: · 33 unmodified lines
542}542}
543 543
544int fuse_fileattr_set(struct mnt_idmap *idmap,544int fuse_fileattr_set(struct mnt_idmap *idmap,
545 struct dentry *dentry, struct fileattr *fa)545 struct dentry *dentry, struct file_kattr *fa)
546{546{
547 struct inode *inode = d_inode(dentry);547 struct inode *inode = d_inode(dentry);
548 struct fuse_file *ff;548 struct fuse_file *ff;
fs/gfs2/file.c+2−2
@@ -155,7 +155,7 @@ static inline u32 gfs2_gfsflags_to_fsflags(struct inode *inode, u32 gfsflags) · 154 unmodified lines
155 return fsflags;155 return fsflags;
156}156}
157 157
158int gfs2_fileattr_get(struct dentry *dentry, struct fileattr *fa)158int gfs2_fileattr_get(struct dentry *dentry, struct file_kattr *fa)
159{159{
160 struct inode *inode = d_inode(dentry);160 struct inode *inode = d_inode(dentry);
161 struct gfs2_inode *ip = GFS2_I(inode);161 struct gfs2_inode *ip = GFS2_I(inode);
@@ -276,7 +276,7 @@ out: · 114 unmodified lines
276}276}
277 277
278int gfs2_fileattr_set(struct mnt_idmap *idmap,278int gfs2_fileattr_set(struct mnt_idmap *idmap,
279 struct dentry *dentry, struct fileattr *fa)279 struct dentry *dentry, struct file_kattr *fa)
280{280{
281 struct inode *inode = d_inode(dentry);281 struct inode *inode = d_inode(dentry);
282 u32 fsflags = fa->flags, gfsflags = 0;282 u32 fsflags = fa->flags, gfsflags = 0;
fs/gfs2/inode.h+2−2
@@ -107,9 +107,9 @@ loff_t gfs2_seek_hole(struct file *file, loff_t offset); · 106 unmodified lines
107extern const struct file_operations gfs2_file_fops_nolock;107extern const struct file_operations gfs2_file_fops_nolock;
108extern const struct file_operations gfs2_dir_fops_nolock;108extern const struct file_operations gfs2_dir_fops_nolock;
109 109
110int gfs2_fileattr_get(struct dentry *dentry, struct fileattr *fa);110int gfs2_fileattr_get(struct dentry *dentry, struct file_kattr *fa);
111int gfs2_fileattr_set(struct mnt_idmap *idmap,111int gfs2_fileattr_set(struct mnt_idmap *idmap,
112 struct dentry *dentry, struct fileattr *fa);112 struct dentry *dentry, struct file_kattr *fa);
113void gfs2_set_inode_flags(struct inode *inode);113void gfs2_set_inode_flags(struct inode *inode);
114 114
115#ifdef CONFIG_GFS2_FS_LOCKING_DLM115#ifdef CONFIG_GFS2_FS_LOCKING_DLM
fs/hfsplus/hfsplus_fs.h+2−2
@@ -489,9 +489,9 @@ int hfsplus_getattr(struct mnt_idmap *idmap, const struct path *path, · 488 unmodified lines
489 unsigned int query_flags);489 unsigned int query_flags);
490int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end,490int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end,
491 int datasync);491 int datasync);
492int hfsplus_fileattr_get(struct dentry *dentry, struct fileattr *fa);492int hfsplus_fileattr_get(struct dentry *dentry, struct file_kattr *fa);
493int hfsplus_fileattr_set(struct mnt_idmap *idmap,493int hfsplus_fileattr_set(struct mnt_idmap *idmap,
494 struct dentry *dentry, struct fileattr *fa);494 struct dentry *dentry, struct file_kattr *fa);
495 495
496/* ioctl.c */496/* ioctl.c */
497long hfsplus_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);497long hfsplus_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
fs/hfsplus/inode.c+2−2
@@ -654,7 +654,7 @@ out: · 653 unmodified lines
654 return res;654 return res;
655}655}
656 656
657int hfsplus_fileattr_get(struct dentry *dentry, struct fileattr *fa)657int hfsplus_fileattr_get(struct dentry *dentry, struct file_kattr *fa)
658{658{
659 struct inode *inode = d_inode(dentry);659 struct inode *inode = d_inode(dentry);
660 struct hfsplus_inode_info *hip = HFSPLUS_I(inode);660 struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
@@ -673,7 +673,7 @@ int hfsplus_fileattr_get(struct dentry *dentry, struct fileattr *fa) · 12 unmodified lines
673}673}
674 674
675int hfsplus_fileattr_set(struct mnt_idmap *idmap,675int hfsplus_fileattr_set(struct mnt_idmap *idmap,
676 struct dentry *dentry, struct fileattr *fa)676 struct dentry *dentry, struct file_kattr *fa)
677{677{
678 struct inode *inode = d_inode(dentry);678 struct inode *inode = d_inode(dentry);
679 struct hfsplus_inode_info *hip = HFSPLUS_I(inode);679 struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
fs/jfs/ioctl.c+2−2
@@ -57,7 +57,7 @@ static long jfs_map_ext2(unsigned long flags, int from) · 56 unmodified lines
57 return mapped;57 return mapped;
58}58}
59 59
60int jfs_fileattr_get(struct dentry *dentry, struct fileattr *fa)60int jfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa)
61{61{
62 struct jfs_inode_info *jfs_inode = JFS_IP(d_inode(dentry));62 struct jfs_inode_info *jfs_inode = JFS_IP(d_inode(dentry));
63 unsigned int flags = jfs_inode->mode2 & JFS_FL_USER_VISIBLE;63 unsigned int flags = jfs_inode->mode2 & JFS_FL_USER_VISIBLE;
@@ -71,7 +71,7 @@ int jfs_fileattr_get(struct dentry *dentry, struct fileattr *fa) · 7 unmodified lines
71}71}
72 72
73int jfs_fileattr_set(struct mnt_idmap *idmap,73int jfs_fileattr_set(struct mnt_idmap *idmap,
74 struct dentry *dentry, struct fileattr *fa)74 struct dentry *dentry, struct file_kattr *fa)
75{75{
76 struct inode *inode = d_inode(dentry);76 struct inode *inode = d_inode(dentry);
77 struct jfs_inode_info *jfs_inode = JFS_IP(inode);77 struct jfs_inode_info *jfs_inode = JFS_IP(inode);
fs/jfs/jfs_inode.h+2−2
@@ -9,9 +9,9 @@ struct fid; · 8 unmodified lines
9 9
10extern struct inode *ialloc(struct inode *, umode_t);10extern struct inode *ialloc(struct inode *, umode_t);
11extern int jfs_fsync(struct file *, loff_t, loff_t, int);11extern int jfs_fsync(struct file *, loff_t, loff_t, int);
12extern int jfs_fileattr_get(struct dentry *dentry, struct fileattr *fa);12extern int jfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa);
13extern int jfs_fileattr_set(struct mnt_idmap *idmap,13extern int jfs_fileattr_set(struct mnt_idmap *idmap,
14 struct dentry *dentry, struct fileattr *fa);14 struct dentry *dentry, struct file_kattr *fa);
15extern long jfs_ioctl(struct file *, unsigned int, unsigned long);15extern long jfs_ioctl(struct file *, unsigned int, unsigned long);
16extern struct inode *jfs_iget(struct super_block *, unsigned long);16extern struct inode *jfs_iget(struct super_block *, unsigned long);
17extern int jfs_commit_inode(struct inode *, int);17extern int jfs_commit_inode(struct inode *, int);
fs/nilfs2/ioctl.c+2−2
@@ -118,7 +118,7 @@ static int nilfs_ioctl_wrap_copy(struct the_nilfs *nilfs, · 117 unmodified lines
118 *118 *
119 * Return: always 0 as success.119 * Return: always 0 as success.
120 */120 */
121int nilfs_fileattr_get(struct dentry *dentry, struct fileattr *fa)121int nilfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa)
122{122{
123 struct inode *inode = d_inode(dentry);123 struct inode *inode = d_inode(dentry);
124 124
@@ -136,7 +136,7 @@ int nilfs_fileattr_get(struct dentry *dentry, struct fileattr *fa) · 11 unmodified lines
136 * Return: 0 on success, or a negative error code on failure.136 * Return: 0 on success, or a negative error code on failure.
137 */137 */
138int nilfs_fileattr_set(struct mnt_idmap *idmap,138int nilfs_fileattr_set(struct mnt_idmap *idmap,
139 struct dentry *dentry, struct fileattr *fa)139 struct dentry *dentry, struct file_kattr *fa)
140{140{
141 struct inode *inode = d_inode(dentry);141 struct inode *inode = d_inode(dentry);
142 struct nilfs_transaction_info ti;142 struct nilfs_transaction_info ti;
fs/nilfs2/nilfs.h+2−2
@@ -268,9 +268,9 @@ int nilfs_set_link(struct inode *dir, struct nilfs_dir_entry *de, · 267 unmodified lines
268extern int nilfs_sync_file(struct file *, loff_t, loff_t, int);268extern int nilfs_sync_file(struct file *, loff_t, loff_t, int);
269 269
270/* ioctl.c */270/* ioctl.c */
271int nilfs_fileattr_get(struct dentry *dentry, struct fileattr *m);271int nilfs_fileattr_get(struct dentry *dentry, struct file_kattr *m);
272int nilfs_fileattr_set(struct mnt_idmap *idmap,272int nilfs_fileattr_set(struct mnt_idmap *idmap,
273 struct dentry *dentry, struct fileattr *fa);273 struct dentry *dentry, struct file_kattr *fa);
274long nilfs_ioctl(struct file *, unsigned int, unsigned long);274long nilfs_ioctl(struct file *, unsigned int, unsigned long);
275long nilfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg);275long nilfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
276int nilfs_ioctl_prepare_clean_segments(struct the_nilfs *, struct nilfs_argv *,276int nilfs_ioctl_prepare_clean_segments(struct the_nilfs *, struct nilfs_argv *,
fs/ocfs2/ioctl.c+2−2
@@ -62,7 +62,7 @@ static inline int o2info_coherent(struct ocfs2_info_request *req) · 61 unmodified lines
62 return (!(req->ir_flags & OCFS2_INFO_FL_NON_COHERENT));62 return (!(req->ir_flags & OCFS2_INFO_FL_NON_COHERENT));
63}63}
64 64
65int ocfs2_fileattr_get(struct dentry *dentry, struct fileattr *fa)65int ocfs2_fileattr_get(struct dentry *dentry, struct file_kattr *fa)
66{66{
67 struct inode *inode = d_inode(dentry);67 struct inode *inode = d_inode(dentry);
68 unsigned int flags;68 unsigned int flags;
@@ -83,7 +83,7 @@ int ocfs2_fileattr_get(struct dentry *dentry, struct fileattr *fa) · 14 unmodified lines
83}83}
84 84
85int ocfs2_fileattr_set(struct mnt_idmap *idmap,85int ocfs2_fileattr_set(struct mnt_idmap *idmap,
86 struct dentry *dentry, struct fileattr *fa)86 struct dentry *dentry, struct file_kattr *fa)
87{87{
88 struct inode *inode = d_inode(dentry);88 struct inode *inode = d_inode(dentry);
89 unsigned int flags = fa->flags;89 unsigned int flags = fa->flags;
fs/ocfs2/ioctl.h+2−2
@@ -11,9 +11,9 @@ · 10 unmodified lines
11#ifndef OCFS2_IOCTL_PROTO_H11#ifndef OCFS2_IOCTL_PROTO_H
12#define OCFS2_IOCTL_PROTO_H12#define OCFS2_IOCTL_PROTO_H
13 13
14int ocfs2_fileattr_get(struct dentry *dentry, struct fileattr *fa);14int ocfs2_fileattr_get(struct dentry *dentry, struct file_kattr *fa);
15int ocfs2_fileattr_set(struct mnt_idmap *idmap,15int ocfs2_fileattr_set(struct mnt_idmap *idmap,
16 struct dentry *dentry, struct fileattr *fa);16 struct dentry *dentry, struct file_kattr *fa);
17long ocfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);17long ocfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
18long ocfs2_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg);18long ocfs2_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg);
19 19
fs/orangefs/inode.c+2−2
@@ -887,7 +887,7 @@ int orangefs_update_time(struct inode *inode, int flags) · 886 unmodified lines
887 return __orangefs_setattr(inode, &iattr);887 return __orangefs_setattr(inode, &iattr);
888}888}
889 889
890static int orangefs_fileattr_get(struct dentry *dentry, struct fileattr *fa)890static int orangefs_fileattr_get(struct dentry *dentry, struct file_kattr *fa)
891{891{
892 u64 val = 0;892 u64 val = 0;
893 int ret;893 int ret;
@@ -908,7 +908,7 @@ static int orangefs_fileattr_get(struct dentry *dentry, struct fileattr *fa) · 14 unmodified lines
908}908}
909 909
910static int orangefs_fileattr_set(struct mnt_idmap *idmap,910static int orangefs_fileattr_set(struct mnt_idmap *idmap,
911 struct dentry *dentry, struct fileattr *fa)911 struct dentry *dentry, struct file_kattr *fa)
912{912{
913 u64 val = 0;913 u64 val = 0;
914 914
fs/overlayfs/copy_up.c+2−2
@@ -171,8 +171,8 @@ out: · 170 unmodified lines
171static int ovl_copy_fileattr(struct inode *inode, const struct path *old,171static int ovl_copy_fileattr(struct inode *inode, const struct path *old,
172 const struct path *new)172 const struct path *new)
173{173{
174 struct fileattr oldfa = { .flags_valid = true };174 struct file_kattr oldfa = { .flags_valid = true };
175 struct fileattr newfa = { .flags_valid = true };175 struct file_kattr newfa = { .flags_valid = true };
176 int err;176 int err;
177 177
178 err = ovl_real_fileattr_get(old, &oldfa);178 err = ovl_real_fileattr_get(old, &oldfa);
fs/overlayfs/inode.c+6−6
@@ -610,7 +610,7 @@ static int ovl_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, · 609 unmodified lines
610 * Introducing security_inode_fileattr_get/set() hooks would solve this issue610 * Introducing security_inode_fileattr_get/set() hooks would solve this issue
611 * properly.611 * properly.
612 */612 */
613static int ovl_security_fileattr(const struct path *realpath, struct fileattr *fa,613static int ovl_security_fileattr(const struct path *realpath, struct file_kattr *fa,
614 bool set)614 bool set)
615{615{
616 struct file *file;616 struct file *file;
@@ -637,7 +637,7 @@ static int ovl_security_fileattr(const struct path *realpath, struct fileattr *f · 20 unmodified lines
637 return err;637 return err;
638}638}
639 639
640int ovl_real_fileattr_set(const struct path *realpath, struct fileattr *fa)640int ovl_real_fileattr_set(const struct path *realpath, struct file_kattr *fa)
641{641{
642 int err;642 int err;
643 643
@@ -649,7 +649,7 @@ int ovl_real_fileattr_set(const struct path *realpath, struct fileattr *fa) · 5 unmodified lines
649}649}
650 650
651int ovl_fileattr_set(struct mnt_idmap *idmap,651int ovl_fileattr_set(struct mnt_idmap *idmap,
652 struct dentry *dentry, struct fileattr *fa)652 struct dentry *dentry, struct file_kattr *fa)
653{653{
654 struct inode *inode = d_inode(dentry);654 struct inode *inode = d_inode(dentry);
655 struct path upperpath;655 struct path upperpath;
@@ -697,7 +697,7 @@ out: · 41 unmodified lines
697}697}
698 698
699/* Convert inode protection flags to fileattr flags */699/* Convert inode protection flags to fileattr flags */
700static void ovl_fileattr_prot_flags(struct inode *inode, struct fileattr *fa)700static void ovl_fileattr_prot_flags(struct inode *inode, struct file_kattr *fa)
701{701{
702 BUILD_BUG_ON(OVL_PROT_FS_FLAGS_MASK & ~FS_COMMON_FL);702 BUILD_BUG_ON(OVL_PROT_FS_FLAGS_MASK & ~FS_COMMON_FL);
703 BUILD_BUG_ON(OVL_PROT_FSX_FLAGS_MASK & ~FS_XFLAG_COMMON);703 BUILD_BUG_ON(OVL_PROT_FSX_FLAGS_MASK & ~FS_XFLAG_COMMON);
@@ -712,7 +712,7 @@ static void ovl_fileattr_prot_flags(struct inode *inode, struct fileattr *fa) · 8 unmodified lines
712 }712 }
713}713}
714 714
715int ovl_real_fileattr_get(const struct path *realpath, struct fileattr *fa)715int ovl_real_fileattr_get(const struct path *realpath, struct file_kattr *fa)
716{716{
717 int err;717 int err;
718 718
@@ -723,7 +723,7 @@ int ovl_real_fileattr_get(const struct path *realpath, struct fileattr *fa) · 4 unmodified lines
723 return vfs_fileattr_get(realpath->dentry, fa);723 return vfs_fileattr_get(realpath->dentry, fa);
724}724}
725 725
726int ovl_fileattr_get(struct dentry *dentry, struct fileattr *fa)726int ovl_fileattr_get(struct dentry *dentry, struct file_kattr *fa)
727{727{
728 struct inode *inode = d_inode(dentry);728 struct inode *inode = d_inode(dentry);
729 struct path realpath;729 struct path realpath;
fs/overlayfs/overlayfs.h+5−5
@@ -815,7 +815,7 @@ void ovl_copyattr(struct inode *to); · 814 unmodified lines
815 815
816void ovl_check_protattr(struct inode *inode, struct dentry *upper);816void ovl_check_protattr(struct inode *inode, struct dentry *upper);
817int ovl_set_protattr(struct inode *inode, struct dentry *upper,817int ovl_set_protattr(struct inode *inode, struct dentry *upper,
818 struct fileattr *fa);818 struct file_kattr *fa);
819 819
820static inline void ovl_copyflags(struct inode *from, struct inode *to)820static inline void ovl_copyflags(struct inode *from, struct inode *to)
821{821{
@@ -847,11 +847,11 @@ struct dentry *ovl_create_temp(struct ovl_fs *ofs, struct dentry *workdir, · 25 unmodified lines
847 847
848/* file.c */848/* file.c */
849extern const struct file_operations ovl_file_operations;849extern const struct file_operations ovl_file_operations;
850int ovl_real_fileattr_get(const struct path *realpath, struct fileattr *fa);850int ovl_real_fileattr_get(const struct path *realpath, struct file_kattr *fa);
851int ovl_real_fileattr_set(const struct path *realpath, struct fileattr *fa);851int ovl_real_fileattr_set(const struct path *realpath, struct file_kattr *fa);
852int ovl_fileattr_get(struct dentry *dentry, struct fileattr *fa);852int ovl_fileattr_get(struct dentry *dentry, struct file_kattr *fa);
853int ovl_fileattr_set(struct mnt_idmap *idmap,853int ovl_fileattr_set(struct mnt_idmap *idmap,
854 struct dentry *dentry, struct fileattr *fa);854 struct dentry *dentry, struct file_kattr *fa);
855struct ovl_file;855struct ovl_file;
856struct ovl_file *ovl_file_alloc(struct file *realfile);856struct ovl_file *ovl_file_alloc(struct file *realfile);
857void ovl_file_free(struct ovl_file *of);857void ovl_file_free(struct ovl_file *of);
fs/overlayfs/util.c+1−1
@@ -959,7 +959,7 @@ void ovl_check_protattr(struct inode *inode, struct dentry *upper) · 958 unmodified lines
959}959}
960 960
961int ovl_set_protattr(struct inode *inode, struct dentry *upper,961int ovl_set_protattr(struct inode *inode, struct dentry *upper,
962 struct fileattr *fa)962 struct file_kattr *fa)
963{963{
964 struct ovl_fs *ofs = OVL_FS(inode->i_sb);964 struct ovl_fs *ofs = OVL_FS(inode->i_sb);
965 char buf[OVL_PROTATTR_MAX];965 char buf[OVL_PROTATTR_MAX];
fs/ubifs/ioctl.c+2−2
@@ -130,7 +130,7 @@ static int setflags(struct inode *inode, int flags) · 129 unmodified lines
130 return err;130 return err;
131}131}
132 132
133int ubifs_fileattr_get(struct dentry *dentry, struct fileattr *fa)133int ubifs_fileattr_get(struct dentry *dentry, struct file_kattr *fa)
134{134{
135 struct inode *inode = d_inode(dentry);135 struct inode *inode = d_inode(dentry);
136 int flags = ubifs2ioctl(ubifs_inode(inode)->flags);136 int flags = ubifs2ioctl(ubifs_inode(inode)->flags);
@@ -145,7 +145,7 @@ int ubifs_fileattr_get(struct dentry *dentry, struct fileattr *fa) · 8 unmodified lines
145}145}
146 146
147int ubifs_fileattr_set(struct mnt_idmap *idmap,147int ubifs_fileattr_set(struct mnt_idmap *idmap,
148 struct dentry *dentry, struct fileattr *fa)148 struct dentry *dentry, struct file_kattr *fa)
149{149{
150 struct inode *inode = d_inode(dentry);150 struct inode *inode = d_inode(dentry);
151 int flags = fa->flags;151 int flags = fa->flags;
fs/ubifs/ubifs.h+2−2
@@ -2073,9 +2073,9 @@ int ubifs_recover_size(struct ubifs_info *c, bool in_place); · 2072 unmodified lines
2073void ubifs_destroy_size_tree(struct ubifs_info *c);2073void ubifs_destroy_size_tree(struct ubifs_info *c);
2074 2074
2075/* ioctl.c */2075/* ioctl.c */
2076int ubifs_fileattr_get(struct dentry *dentry, struct fileattr *fa);2076int ubifs_fileattr_get(struct dentry *dentry, struct file_kattr *fa);
2077int ubifs_fileattr_set(struct mnt_idmap *idmap,2077int ubifs_fileattr_set(struct mnt_idmap *idmap,
2078 struct dentry *dentry, struct fileattr *fa);2078 struct dentry *dentry, struct file_kattr *fa);
2079long ubifs_ioctl(struct file *file, unsigned int cmd, unsigned long arg);2079long ubifs_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
2080void ubifs_set_inode_flags(struct inode *inode);2080void ubifs_set_inode_flags(struct inode *inode);
2081#ifdef CONFIG_COMPAT2081#ifdef CONFIG_COMPAT
fs/xfs/xfs_ioctl.c+9−9
@@ -444,7 +444,7 @@ static void · 443 unmodified lines
444xfs_fill_fsxattr(444xfs_fill_fsxattr(
445 struct xfs_inode *ip,445 struct xfs_inode *ip,
446 int whichfork,446 int whichfork,
447 struct fileattr *fa)447 struct file_kattr *fa)
448{448{
449 struct xfs_mount *mp = ip->i_mount;449 struct xfs_mount *mp = ip->i_mount;
450 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);450 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);
@@ -496,7 +496,7 @@ xfs_ioc_fsgetxattra( · 45 unmodified lines
496 xfs_inode_t *ip,496 xfs_inode_t *ip,
497 void __user *arg)497 void __user *arg)
498{498{
499 struct fileattr fa;499 struct file_kattr fa;
500 500
501 xfs_ilock(ip, XFS_ILOCK_SHARED);501 xfs_ilock(ip, XFS_ILOCK_SHARED);
502 xfs_fill_fsxattr(ip, XFS_ATTR_FORK, &fa);502 xfs_fill_fsxattr(ip, XFS_ATTR_FORK, &fa);
@@ -508,7 +508,7 @@ xfs_ioc_fsgetxattra( · 5 unmodified lines
508int508int
509xfs_fileattr_get(509xfs_fileattr_get(
510 struct dentry *dentry,510 struct dentry *dentry,
511 struct fileattr *fa)511 struct file_kattr *fa)
512{512{
513 struct xfs_inode *ip = XFS_I(d_inode(dentry));513 struct xfs_inode *ip = XFS_I(d_inode(dentry));
514 514
@@ -526,7 +526,7 @@ static int · 11 unmodified lines
526xfs_ioctl_setattr_xflags(526xfs_ioctl_setattr_xflags(
527 struct xfs_trans *tp,527 struct xfs_trans *tp,
528 struct xfs_inode *ip,528 struct xfs_inode *ip,
529 struct fileattr *fa)529 struct file_kattr *fa)
530{530{
531 struct xfs_mount *mp = ip->i_mount;531 struct xfs_mount *mp = ip->i_mount;
532 bool rtflag = (fa->fsx_xflags & FS_XFLAG_REALTIME);532 bool rtflag = (fa->fsx_xflags & FS_XFLAG_REALTIME);
@@ -582,7 +582,7 @@ xfs_ioctl_setattr_xflags( · 49 unmodified lines
582static void582static void
583xfs_ioctl_setattr_prepare_dax(583xfs_ioctl_setattr_prepare_dax(
584 struct xfs_inode *ip,584 struct xfs_inode *ip,
585 struct fileattr *fa)585 struct file_kattr *fa)
586{586{
587 struct xfs_mount *mp = ip->i_mount;587 struct xfs_mount *mp = ip->i_mount;
588 struct inode *inode = VFS_I(ip);588 struct inode *inode = VFS_I(ip);
@@ -642,7 +642,7 @@ out_error: · 53 unmodified lines
642static int642static int
643xfs_ioctl_setattr_check_extsize(643xfs_ioctl_setattr_check_extsize(
644 struct xfs_inode *ip,644 struct xfs_inode *ip,
645 struct fileattr *fa)645 struct file_kattr *fa)
646{646{
647 struct xfs_mount *mp = ip->i_mount;647 struct xfs_mount *mp = ip->i_mount;
648 xfs_failaddr_t failaddr;648 xfs_failaddr_t failaddr;
@@ -684,7 +684,7 @@ xfs_ioctl_setattr_check_extsize( · 35 unmodified lines
684static int684static int
685xfs_ioctl_setattr_check_cowextsize(685xfs_ioctl_setattr_check_cowextsize(
686 struct xfs_inode *ip,686 struct xfs_inode *ip,
687 struct fileattr *fa)687 struct file_kattr *fa)
688{688{
689 struct xfs_mount *mp = ip->i_mount;689 struct xfs_mount *mp = ip->i_mount;
690 xfs_failaddr_t failaddr;690 xfs_failaddr_t failaddr;
@@ -709,7 +709,7 @@ xfs_ioctl_setattr_check_cowextsize( · 18 unmodified lines
709static int709static int
710xfs_ioctl_setattr_check_projid(710xfs_ioctl_setattr_check_projid(
711 struct xfs_inode *ip,711 struct xfs_inode *ip,
712 struct fileattr *fa)712 struct file_kattr *fa)
713{713{
714 if (!fa->fsx_valid)714 if (!fa->fsx_valid)
715 return 0;715 return 0;
@@ -725,7 +725,7 @@ int · 9 unmodified lines
725xfs_fileattr_set(725xfs_fileattr_set(
726 struct mnt_idmap *idmap,726 struct mnt_idmap *idmap,
727 struct dentry *dentry,727 struct dentry *dentry,
728 struct fileattr *fa)728 struct file_kattr *fa)
729{729{
730 struct xfs_inode *ip = XFS_I(d_inode(dentry));730 struct xfs_inode *ip = XFS_I(d_inode(dentry));
731 struct xfs_mount *mp = ip->i_mount;731 struct xfs_mount *mp = ip->i_mount;
fs/xfs/xfs_ioctl.h+2−2
@@ -17,13 +17,13 @@ xfs_ioc_swapext( · 16 unmodified lines
17extern int17extern int
18xfs_fileattr_get(18xfs_fileattr_get(
19 struct dentry *dentry,19 struct dentry *dentry,
20 struct fileattr *fa);20 struct file_kattr *fa);
21 21
22extern int22extern int
23xfs_fileattr_set(23xfs_fileattr_set(
24 struct mnt_idmap *idmap,24 struct mnt_idmap *idmap,
25 struct dentry *dentry,25 struct dentry *dentry,
26 struct fileattr *fa);26 struct file_kattr *fa);
27 27
28extern long28extern long
29xfs_file_ioctl(29xfs_file_ioctl(
include/linux/fileattr.h+7−7
@@ -40,7 +40,7 @@ · 39 unmodified lines
40 * is handled by the VFS helpers, so filesystems are free to implement just one40 * is handled by the VFS helpers, so filesystems are free to implement just one
41 * or both of these sub-interfaces.41 * or both of these sub-interfaces.
42 */42 */
43struct fileattr {43struct file_kattr {
44 u32 flags; /* flags (FS_IOC_GETFLAGS/FS_IOC_SETFLAGS) */44 u32 flags; /* flags (FS_IOC_GETFLAGS/FS_IOC_SETFLAGS) */
45 /* struct fsxattr: */45 /* struct fsxattr: */
46 u32 fsx_xflags; /* xflags field value (get/set) */46 u32 fsx_xflags; /* xflags field value (get/set) */
@@ -53,10 +53,10 @@ struct fileattr { · 6 unmodified lines
53 bool fsx_valid:1;53 bool fsx_valid:1;
54};54};
55 55
56int copy_fsxattr_to_user(const struct fileattr *fa, struct fsxattr __user *ufa);56int copy_fsxattr_to_user(const struct file_kattr *fa, struct fsxattr __user *ufa);
57 57
58void fileattr_fill_xflags(struct fileattr *fa, u32 xflags);58void fileattr_fill_xflags(struct file_kattr *fa, u32 xflags);
59void fileattr_fill_flags(struct fileattr *fa, u32 flags);59void fileattr_fill_flags(struct file_kattr *fa, u32 flags);
60 60
61/**61/**
62 * fileattr_has_fsx - check for extended flags/attributes62 * fileattr_has_fsx - check for extended flags/attributes
@@ -65,16 +65,16 @@ void fileattr_fill_flags(struct fileattr *fa, u32 flags); · 2 unmodified lines
65 * Return: true if any attributes are present that are not represented in65 * Return: true if any attributes are present that are not represented in
66 * ->flags.66 * ->flags.
67 */67 */
68static inline bool fileattr_has_fsx(const struct fileattr *fa)68static inline bool fileattr_has_fsx(const struct file_kattr *fa)
69{69{
70 return fa->fsx_valid &&70 return fa->fsx_valid &&
71 ((fa->fsx_xflags & ~FS_XFLAG_COMMON) || fa->fsx_extsize != 0 ||71 ((fa->fsx_xflags & ~FS_XFLAG_COMMON) || fa->fsx_extsize != 0 ||
72 fa->fsx_projid != 0 || fa->fsx_cowextsize != 0);72 fa->fsx_projid != 0 || fa->fsx_cowextsize != 0);
73}73}
74 74
75int vfs_fileattr_get(struct dentry *dentry, struct fileattr *fa);75int vfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa);
76int vfs_fileattr_set(struct mnt_idmap *idmap, struct dentry *dentry,76int vfs_fileattr_set(struct mnt_idmap *idmap, struct dentry *dentry,
77 struct fileattr *fa);77 struct file_kattr *fa);
78int ioctl_getflags(struct file *file, unsigned int __user *argp);78int ioctl_getflags(struct file *file, unsigned int __user *argp);
79int ioctl_setflags(struct file *file, unsigned int __user *argp);79int ioctl_setflags(struct file *file, unsigned int __user *argp);
80int ioctl_fsgetxattr(struct file *file, void __user *argp);80int ioctl_fsgetxattr(struct file *file, void __user *argp);
include/linux/fs.h+3−3
@@ -80,7 +80,7 @@ struct fsnotify_mark_connector; · 79 unmodified lines
80struct fsnotify_sb_info;80struct fsnotify_sb_info;
81struct fs_context;81struct fs_context;
82struct fs_parameter_spec;82struct fs_parameter_spec;
83struct fileattr;83struct file_kattr;
84struct iomap_ops;84struct iomap_ops;
85 85
86extern void __init inode_init(void);86extern void __init inode_init(void);
@@ -2254,8 +2254,8 @@ struct inode_operations { · 2167 unmodified lines
2254 int (*set_acl)(struct mnt_idmap *, struct dentry *,2254 int (*set_acl)(struct mnt_idmap *, struct dentry *,
2255 struct posix_acl *, int);2255 struct posix_acl *, int);
2256 int (*fileattr_set)(struct mnt_idmap *idmap,2256 int (*fileattr_set)(struct mnt_idmap *idmap,
2257 struct dentry *dentry, struct fileattr *fa);2257 struct dentry *dentry, struct file_kattr *fa);
2258 int (*fileattr_get)(struct dentry *dentry, struct fileattr *fa);2258 int (*fileattr_get)(struct dentry *dentry, struct file_kattr *fa);
2259 struct offset_ctx *(*get_offset_ctx)(struct inode *inode);2259 struct offset_ctx *(*get_offset_ctx)(struct inode *inode);
2260} ____cacheline_aligned;2260} ____cacheline_aligned;
2261 2261
include/linux/lsm_hook_defs.h+2−2
@@ -157,8 +157,8 @@ LSM_HOOK(int, 0, inode_removexattr, struct mnt_idmap *idmap, · 156 unmodified lines
157 struct dentry *dentry, const char *name)157 struct dentry *dentry, const char *name)
158LSM_HOOK(void, LSM_RET_VOID, inode_post_removexattr, struct dentry *dentry,158LSM_HOOK(void, LSM_RET_VOID, inode_post_removexattr, struct dentry *dentry,
159 const char *name)159 const char *name)
160LSM_HOOK(int, 0, inode_file_setattr, struct dentry *dentry, struct fileattr *fa)160LSM_HOOK(int, 0, inode_file_setattr, struct dentry *dentry, struct file_kattr *fa)
161LSM_HOOK(int, 0, inode_file_getattr, struct dentry *dentry, struct fileattr *fa)161LSM_HOOK(int, 0, inode_file_getattr, struct dentry *dentry, struct file_kattr *fa)
162LSM_HOOK(int, 0, inode_set_acl, struct mnt_idmap *idmap,162LSM_HOOK(int, 0, inode_set_acl, struct mnt_idmap *idmap,
163 struct dentry *dentry, const char *acl_name, struct posix_acl *kacl)163 struct dentry *dentry, const char *acl_name, struct posix_acl *kacl)
164LSM_HOOK(void, LSM_RET_VOID, inode_post_set_acl, struct dentry *dentry,164LSM_HOOK(void, LSM_RET_VOID, inode_post_set_acl, struct dentry *dentry,
include/linux/security.h+4−4
@@ -452,9 +452,9 @@ int security_inode_removexattr(struct mnt_idmap *idmap, · 451 unmodified lines
452 struct dentry *dentry, const char *name);452 struct dentry *dentry, const char *name);
453void security_inode_post_removexattr(struct dentry *dentry, const char *name);453void security_inode_post_removexattr(struct dentry *dentry, const char *name);
454int security_inode_file_setattr(struct dentry *dentry,454int security_inode_file_setattr(struct dentry *dentry,
455 struct fileattr *fa);455 struct file_kattr *fa);
456int security_inode_file_getattr(struct dentry *dentry,456int security_inode_file_getattr(struct dentry *dentry,
457 struct fileattr *fa);457 struct file_kattr *fa);
458int security_inode_need_killpriv(struct dentry *dentry);458int security_inode_need_killpriv(struct dentry *dentry);
459int security_inode_killpriv(struct mnt_idmap *idmap, struct dentry *dentry);459int security_inode_killpriv(struct mnt_idmap *idmap, struct dentry *dentry);
460int security_inode_getsecurity(struct mnt_idmap *idmap,460int security_inode_getsecurity(struct mnt_idmap *idmap,
@@ -1057,13 +1057,13 @@ static inline void security_inode_post_removexattr(struct dentry *dentry, · 596 unmodified lines
1057{ }1057{ }
1058 1058
1059static inline int security_inode_file_setattr(struct dentry *dentry,1059static inline int security_inode_file_setattr(struct dentry *dentry,
1060 struct fileattr *fa)1060 struct file_kattr *fa)
1061{1061{
1062 return 0;1062 return 0;
1063}1063}
1064 1064
1065static inline int security_inode_file_getattr(struct dentry *dentry,1065static inline int security_inode_file_getattr(struct dentry *dentry,
1066 struct fileattr *fa)1066 struct file_kattr *fa)
1067{1067{
1068 return 0;1068 return 0;
1069}1069}
include/uapi/linux/fs.h+1−1
@@ -151,7 +151,7 @@ struct fsxattr { · 150 unmodified lines
151/*151/*
152 * Variable size structure for file_[sg]et_attr().152 * Variable size structure for file_[sg]et_attr().
153 *153 *
154 * Note. This is alternative to the structure 'struct fileattr'/'struct fsxattr'.154 * Note. This is alternative to the structure 'struct file_kattr'/'struct fsxattr'.
155 * As this structure is passed to/from userspace with its size, this can155 * As this structure is passed to/from userspace with its size, this can
156 * be versioned based on the size.156 * be versioned based on the size.
157 */157 */
mm/shmem.c+2−2
@@ -4183,7 +4183,7 @@ static const char *shmem_get_link(struct dentry *dentry, struct inode *inode, · 4182 unmodified lines
4183 4183
4184#ifdef CONFIG_TMPFS_XATTR4184#ifdef CONFIG_TMPFS_XATTR
4185 4185
4186static int shmem_fileattr_get(struct dentry *dentry, struct fileattr *fa)4186static int shmem_fileattr_get(struct dentry *dentry, struct file_kattr *fa)
4187{4187{
4188 struct shmem_inode_info *info = SHMEM_I(d_inode(dentry));4188 struct shmem_inode_info *info = SHMEM_I(d_inode(dentry));
4189 4189
@@ -4193,7 +4193,7 @@ static int shmem_fileattr_get(struct dentry *dentry, struct fileattr *fa) · 3 unmodified lines
4193}4193}
4194 4194
4195static int shmem_fileattr_set(struct mnt_idmap *idmap,4195static int shmem_fileattr_set(struct mnt_idmap *idmap,
4196 struct dentry *dentry, struct fileattr *fa)4196 struct dentry *dentry, struct file_kattr *fa)
4197{4197{
4198 struct inode *inode = d_inode(dentry);4198 struct inode *inode = d_inode(dentry);
4199 struct shmem_inode_info *info = SHMEM_I(inode);4199 struct shmem_inode_info *info = SHMEM_I(inode);
security/security.c+2−2
@@ -2632,7 +2632,7 @@ void security_inode_post_removexattr(struct dentry *dentry, const char *name) · 2631 unmodified lines
2632 *2632 *
2633 * Return: Returns 0 if permission is granted.2633 * Return: Returns 0 if permission is granted.
2634 */2634 */
2635int security_inode_file_setattr(struct dentry *dentry, struct fileattr *fa)2635int security_inode_file_setattr(struct dentry *dentry, struct file_kattr *fa)
2636{2636{
2637 return call_int_hook(inode_file_setattr, dentry, fa);2637 return call_int_hook(inode_file_setattr, dentry, fa);
2638}2638}
@@ -2647,7 +2647,7 @@ int security_inode_file_setattr(struct dentry *dentry, struct fileattr *fa) · 8 unmodified lines
2647 *2647 *
2648 * Return: Returns 0 if permission is granted.2648 * Return: Returns 0 if permission is granted.
2649 */2649 */
2650int security_inode_file_getattr(struct dentry *dentry, struct fileattr *fa)2650int security_inode_file_getattr(struct dentry *dentry, struct file_kattr *fa)
2651{2651{
2652 return call_int_hook(inode_file_getattr, dentry, fa);2652 return call_int_hook(inode_file_getattr, dentry, fa);
2653}2653}
security/selinux/hooks.c+2−2
@@ -3481,13 +3481,13 @@ static int selinux_inode_removexattr(struct mnt_idmap *idmap, · 3480 unmodified lines
3481}3481}
3482 3482
3483static int selinux_inode_file_setattr(struct dentry *dentry,3483static int selinux_inode_file_setattr(struct dentry *dentry,
3484 struct fileattr *fa)3484 struct file_kattr *fa)
3485{3485{
3486 return dentry_has_perm(current_cred(), dentry, FILE__SETATTR);3486 return dentry_has_perm(current_cred(), dentry, FILE__SETATTR);
3487}3487}
3488 3488
3489static int selinux_inode_file_getattr(struct dentry *dentry,3489static int selinux_inode_file_getattr(struct dentry *dentry,
3490 struct fileattr *fa)3490 struct file_kattr *fa)
3491{3491{
3492 return dentry_has_perm(current_cred(), dentry, FILE__GETATTR);3492 return dentry_has_perm(current_cred(), dentry, FILE__GETATTR);
3493}3493}