Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Link: https://lore.kernel.org/20250703-restlaufzeit-baurecht-9ed44552b481@brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>

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