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

Configure Feed

Select the types of activity you want to include in your feed.

Merge patch series "trivial ->setattr cleanups"

Christoph Hellwig <hch@lst.de> says:

I've been looking into changes to ->setattr and noticed that we still
have a few instances where the method has the ages old notify_change
name. Fix this up and include dusting off outdated comments.

* patches from https://patch.msgid.link/20260325063711.3298685-1-hch@lst.de:
proc: rename proc_notify_change to proc_setattr
proc: rename proc_setattr to proc_nochmod_setattr
affs: rename affs_notify_change to affs_setattr
adfs: rename adfs_notify_change to adfs_setattr
hfs: update comments on hfs_inode_setattr

Link: https://patch.msgid.link/20260325063711.3298685-1-hch@lst.de
Signed-off-by: Christian Brauner <brauner@kernel.org>

+37 -57
+2 -2
fs/adfs/adfs.h
··· 144 144 /* Inode stuff */ 145 145 struct inode *adfs_iget(struct super_block *sb, struct object_info *obj); 146 146 int adfs_write_inode(struct inode *inode, struct writeback_control *wbc); 147 - int adfs_notify_change(struct mnt_idmap *idmap, struct dentry *dentry, 148 - struct iattr *attr); 147 + int adfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, 148 + struct iattr *attr); 149 149 150 150 /* map.c */ 151 151 int adfs_map_lookup(struct super_block *sb, u32 frag_id, unsigned int offset);
+1 -1
fs/adfs/dir.c
··· 454 454 */ 455 455 const struct inode_operations adfs_dir_inode_operations = { 456 456 .lookup = adfs_lookup, 457 - .setattr = adfs_notify_change, 457 + .setattr = adfs_setattr, 458 458 };
+1 -1
fs/adfs/file.c
··· 32 32 }; 33 33 34 34 const struct inode_operations adfs_file_inode_operations = { 35 - .setattr = adfs_notify_change, 35 + .setattr = adfs_setattr, 36 36 };
+2 -4
fs/adfs/inode.c
··· 299 299 * later. 300 300 */ 301 301 int 302 - adfs_notify_change(struct mnt_idmap *idmap, struct dentry *dentry, 303 - struct iattr *attr) 302 + adfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, struct iattr *attr) 304 303 { 305 304 struct inode *inode = d_inode(dentry); 306 305 struct super_block *sb = inode->i_sb; ··· 354 355 355 356 /* 356 357 * write an existing inode back to the directory, and therefore the disk. 357 - * The adfs-specific inode data has already been updated by 358 - * adfs_notify_change() 358 + * The adfs-specific inode data has already been updated by * adfs_setattr(). 359 359 */ 360 360 int adfs_write_inode(struct inode *inode, struct writeback_control *wbc) 361 361 {
+1 -1
fs/affs/affs.h
··· 184 184 /* inode.c */ 185 185 186 186 extern struct inode *affs_new_inode(struct inode *dir); 187 - extern int affs_notify_change(struct mnt_idmap *idmap, 187 + extern int affs_setattr(struct mnt_idmap *idmap, 188 188 struct dentry *dentry, struct iattr *attr); 189 189 extern void affs_evict_inode(struct inode *inode); 190 190 extern struct inode *affs_iget(struct super_block *sb,
+1 -1
fs/affs/dir.c
··· 71 71 .mkdir = affs_mkdir, 72 72 .rmdir = affs_rmdir, 73 73 .rename = affs_rename2, 74 - .setattr = affs_notify_change, 74 + .setattr = affs_setattr, 75 75 }; 76 76 77 77 static int
+1 -1
fs/affs/file.c
··· 1013 1013 }; 1014 1014 1015 1015 const struct inode_operations affs_file_inode_operations = { 1016 - .setattr = affs_notify_change, 1016 + .setattr = affs_setattr, 1017 1017 };
+2 -3
fs/affs/inode.c
··· 213 213 } 214 214 215 215 int 216 - affs_notify_change(struct mnt_idmap *idmap, struct dentry *dentry, 217 - struct iattr *attr) 216 + affs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, struct iattr *attr) 218 217 { 219 218 struct inode *inode = d_inode(dentry); 220 219 int error; 221 220 222 - pr_debug("notify_change(%lu,0x%x)\n", inode->i_ino, attr->ia_valid); 221 + pr_debug("setattr(%lu,0x%x)\n", inode->i_ino, attr->ia_valid); 223 222 224 223 error = setattr_prepare(&nop_mnt_idmap, dentry, attr); 225 224 if (error)
+1 -1
fs/affs/symlink.c
··· 71 71 72 72 const struct inode_operations affs_symlink_inode_operations = { 73 73 .get_link = page_get_link, 74 - .setattr = affs_notify_change, 74 + .setattr = affs_setattr, 75 75 };
+2 -19
fs/hfs/inode.c
··· 622 622 return 0; 623 623 } 624 624 625 - /* 626 - * hfs_notify_change() 627 - * 628 - * Based very closely on fs/msdos/inode.c by Werner Almesberger 629 - * 630 - * This is the notify_change() field in the super_operations structure 631 - * for HFS file systems. The purpose is to take that changes made to 632 - * an inode and apply then in a filesystem-dependent manner. In this 633 - * case the process has a few of tasks to do: 634 - * 1) prevent changes to the i_uid and i_gid fields. 635 - * 2) map file permissions to the closest allowable permissions 636 - * 3) Since multiple Linux files can share the same on-disk inode under 637 - * HFS (for instance the data and resource forks of a file) a change 638 - * to permissions must be applied to all other in-core inodes which 639 - * correspond to the same HFS file. 640 - */ 641 - 642 625 int hfs_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry, 643 626 struct iattr *attr) 644 627 { ··· 629 646 struct hfs_sb_info *hsb = HFS_SB(inode->i_sb); 630 647 int error; 631 648 632 - error = setattr_prepare(&nop_mnt_idmap, dentry, 633 - attr); /* basic permission checks */ 649 + error = setattr_prepare(&nop_mnt_idmap, dentry, attr); 634 650 if (error) 635 651 return error; 636 652 ··· 645 663 return hsb->s_quiet ? 0 : error; 646 664 } 647 665 666 + /* map file permissions to the closest allowable permissions in HFS */ 648 667 if (attr->ia_valid & ATTR_MODE) { 649 668 /* Only the 'w' bits can ever change and only all together. */ 650 669 if (attr->ia_mode & S_IWUSR)
+11 -11
fs/proc/base.c
··· 721 721 return allowed; 722 722 } 723 723 724 - int proc_setattr(struct mnt_idmap *idmap, struct dentry *dentry, 724 + int proc_nochmod_setattr(struct mnt_idmap *idmap, struct dentry *dentry, 725 725 struct iattr *attr) 726 726 { 727 727 int error; ··· 794 794 795 795 796 796 static const struct inode_operations proc_def_inode_operations = { 797 - .setattr = proc_setattr, 797 + .setattr = proc_nochmod_setattr, 798 798 }; 799 799 800 800 static int proc_single_show(struct seq_file *m, void *v) ··· 1866 1866 const struct inode_operations proc_pid_link_inode_operations = { 1867 1867 .readlink = proc_pid_readlink, 1868 1868 .get_link = proc_pid_get_link, 1869 - .setattr = proc_setattr, 1869 + .setattr = proc_nochmod_setattr, 1870 1870 }; 1871 1871 1872 1872 ··· 2316 2316 static const struct inode_operations proc_map_files_link_inode_operations = { 2317 2317 .readlink = proc_pid_readlink, 2318 2318 .get_link = proc_map_files_get_link, 2319 - .setattr = proc_setattr, 2319 + .setattr = proc_nochmod_setattr, 2320 2320 }; 2321 2321 2322 2322 static struct dentry * ··· 2395 2395 static const struct inode_operations proc_map_files_inode_operations = { 2396 2396 .lookup = proc_map_files_lookup, 2397 2397 .permission = proc_fd_permission, 2398 - .setattr = proc_setattr, 2398 + .setattr = proc_nochmod_setattr, 2399 2399 }; 2400 2400 2401 2401 static int ··· 2882 2882 static const struct inode_operations proc_##LSM##_attr_dir_inode_ops = { \ 2883 2883 .lookup = proc_##LSM##_attr_dir_lookup, \ 2884 2884 .getattr = pid_getattr, \ 2885 - .setattr = proc_setattr, \ 2885 + .setattr = proc_nochmod_setattr, \ 2886 2886 } 2887 2887 2888 2888 #ifdef CONFIG_SECURITY_SMACK ··· 2941 2941 static const struct inode_operations proc_attr_dir_inode_operations = { 2942 2942 .lookup = proc_attr_dir_lookup, 2943 2943 .getattr = pid_getattr, 2944 - .setattr = proc_setattr, 2944 + .setattr = proc_nochmod_setattr, 2945 2945 }; 2946 2946 2947 2947 #endif ··· 3450 3450 static const struct inode_operations proc_tgid_base_inode_operations = { 3451 3451 .lookup = proc_tgid_base_lookup, 3452 3452 .getattr = pid_getattr, 3453 - .setattr = proc_setattr, 3453 + .setattr = proc_nochmod_setattr, 3454 3454 .permission = proc_pid_permission, 3455 3455 }; 3456 3456 ··· 3647 3647 } 3648 3648 3649 3649 static const struct inode_operations proc_tid_comm_inode_operations = { 3650 - .setattr = proc_setattr, 3650 + .setattr = proc_nochmod_setattr, 3651 3651 .permission = proc_tid_comm_permission, 3652 3652 }; 3653 3653 ··· 3776 3776 static const struct inode_operations proc_tid_base_inode_operations = { 3777 3777 .lookup = proc_tid_base_lookup, 3778 3778 .getattr = pid_getattr, 3779 - .setattr = proc_setattr, 3779 + .setattr = proc_nochmod_setattr, 3780 3780 }; 3781 3781 3782 3782 static struct dentry *proc_task_instantiate(struct dentry *dentry, ··· 3989 3989 static const struct inode_operations proc_task_inode_operations = { 3990 3990 .lookup = proc_task_lookup, 3991 3991 .getattr = proc_task_getattr, 3992 - .setattr = proc_setattr, 3992 + .setattr = proc_nochmod_setattr, 3993 3993 .permission = proc_pid_permission, 3994 3994 }; 3995 3995
+3 -3
fs/proc/fd.c
··· 102 102 103 103 static const struct inode_operations proc_fdinfo_file_inode_operations = { 104 104 .permission = proc_fdinfo_permission, 105 - .setattr = proc_setattr, 105 + .setattr = proc_nochmod_setattr, 106 106 }; 107 107 108 108 static const struct file_operations proc_fdinfo_file_operations = { ··· 361 361 .lookup = proc_lookupfd, 362 362 .permission = proc_fd_permission, 363 363 .getattr = proc_fd_getattr, 364 - .setattr = proc_setattr, 364 + .setattr = proc_nochmod_setattr, 365 365 }; 366 366 367 367 static struct dentry *proc_fdinfo_instantiate(struct dentry *dentry, ··· 402 402 const struct inode_operations proc_fdinfo_inode_operations = { 403 403 .lookup = proc_lookupfdinfo, 404 404 .permission = proc_fdinfo_permission, 405 - .setattr = proc_setattr, 405 + .setattr = proc_nochmod_setattr, 406 406 }; 407 407 408 408 const struct file_operations proc_fdinfo_operations = {
+4 -4
fs/proc/generic.c
··· 115 115 return true; 116 116 } 117 117 118 - static int proc_notify_change(struct mnt_idmap *idmap, 119 - struct dentry *dentry, struct iattr *iattr) 118 + static int proc_setattr(struct mnt_idmap *idmap, struct dentry *dentry, 119 + struct iattr *iattr) 120 120 { 121 121 struct inode *inode = d_inode(dentry); 122 122 struct proc_dir_entry *de = PDE(inode); ··· 151 151 } 152 152 153 153 static const struct inode_operations proc_file_inode_operations = { 154 - .setattr = proc_notify_change, 154 + .setattr = proc_setattr, 155 155 }; 156 156 157 157 /* ··· 364 364 static const struct inode_operations proc_dir_inode_operations = { 365 365 .lookup = proc_lookup, 366 366 .getattr = proc_getattr, 367 - .setattr = proc_notify_change, 367 + .setattr = proc_setattr, 368 368 }; 369 369 370 370 static void pde_set_flags(struct proc_dir_entry *pde)
+2 -2
fs/proc/internal.h
··· 257 257 extern const struct dentry_operations pid_dentry_operations; 258 258 extern int pid_getattr(struct mnt_idmap *, const struct path *, 259 259 struct kstat *, u32, unsigned int); 260 - extern int proc_setattr(struct mnt_idmap *, struct dentry *, 261 - struct iattr *); 260 + int proc_nochmod_setattr(struct mnt_idmap *idmap, struct dentry *dentry, 261 + struct iattr *attr); 262 262 extern void proc_pid_evict_inode(struct proc_inode *); 263 263 extern struct inode *proc_pid_make_inode(struct super_block *, struct task_struct *, umode_t); 264 264 extern void pid_update_inode(struct task_struct *, struct inode *);
+2 -2
fs/proc/namespaces.c
··· 92 92 static const struct inode_operations proc_ns_link_inode_operations = { 93 93 .readlink = proc_ns_readlink, 94 94 .get_link = proc_ns_get_link, 95 - .setattr = proc_setattr, 95 + .setattr = proc_nochmod_setattr, 96 96 }; 97 97 98 98 static struct dentry *proc_ns_instantiate(struct dentry *dentry, ··· 178 178 const struct inode_operations proc_ns_dir_inode_operations = { 179 179 .lookup = proc_ns_dir_lookup, 180 180 .getattr = pid_getattr, 181 - .setattr = proc_setattr, 181 + .setattr = proc_nochmod_setattr, 182 182 };
+1 -1
fs/proc/proc_net.c
··· 322 322 const struct inode_operations proc_net_inode_operations = { 323 323 .lookup = proc_tgid_net_lookup, 324 324 .getattr = proc_tgid_net_getattr, 325 - .setattr = proc_setattr, 325 + .setattr = proc_nochmod_setattr, 326 326 }; 327 327 328 328 static int proc_tgid_net_readdir(struct file *file, struct dir_context *ctx)