Skip to content

Commit 3c1fc67

Browse files
committed
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>
2 parents 388727e + 2ecd46d commit 3c1fc67

16 files changed

Lines changed: 37 additions & 57 deletions

File tree

fs/adfs/adfs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ struct adfs_discmap {
144144
/* Inode stuff */
145145
struct inode *adfs_iget(struct super_block *sb, struct object_info *obj);
146146
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);
149149

150150
/* map.c */
151151
int adfs_map_lookup(struct super_block *sb, u32 frag_id, unsigned int offset);

fs/adfs/dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,5 +454,5 @@ adfs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
454454
*/
455455
const struct inode_operations adfs_dir_inode_operations = {
456456
.lookup = adfs_lookup,
457-
.setattr = adfs_notify_change,
457+
.setattr = adfs_setattr,
458458
};

fs/adfs/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ const struct file_operations adfs_file_operations = {
3232
};
3333

3434
const struct inode_operations adfs_file_inode_operations = {
35-
.setattr = adfs_notify_change,
35+
.setattr = adfs_setattr,
3636
};

fs/adfs/inode.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,7 @@ adfs_iget(struct super_block *sb, struct object_info *obj)
299299
* later.
300300
*/
301301
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)
304303
{
305304
struct inode *inode = d_inode(dentry);
306305
struct super_block *sb = inode->i_sb;
@@ -355,8 +354,7 @@ adfs_notify_change(struct mnt_idmap *idmap, struct dentry *dentry,
355354

356355
/*
357356
* write an existing inode back to the directory, and therefore the disk.
358-
* The adfs-specific inode data has already been updated by
359-
* adfs_notify_change()
357+
* The adfs-specific inode data has already been updated by * adfs_setattr().
360358
*/
361359
int adfs_write_inode(struct inode *inode, struct writeback_control *wbc)
362360
{

fs/affs/affs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ extern int affs_rename2(struct mnt_idmap *idmap,
184184
/* inode.c */
185185

186186
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,
188188
struct dentry *dentry, struct iattr *attr);
189189
extern void affs_evict_inode(struct inode *inode);
190190
extern struct inode *affs_iget(struct super_block *sb,

fs/affs/dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const struct inode_operations affs_dir_inode_operations = {
7171
.mkdir = affs_mkdir,
7272
.rmdir = affs_rmdir,
7373
.rename = affs_rename2,
74-
.setattr = affs_notify_change,
74+
.setattr = affs_setattr,
7575
};
7676

7777
static int

fs/affs/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,5 +1013,5 @@ const struct file_operations affs_file_operations = {
10131013
};
10141014

10151015
const struct inode_operations affs_file_inode_operations = {
1016-
.setattr = affs_notify_change,
1016+
.setattr = affs_setattr,
10171017
};

fs/affs/inode.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,12 @@ affs_write_inode(struct inode *inode, struct writeback_control *wbc)
213213
}
214214

215215
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)
218217
{
219218
struct inode *inode = d_inode(dentry);
220219
int error;
221220

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);
223222

224223
error = setattr_prepare(&nop_mnt_idmap, dentry, attr);
225224
if (error)

fs/affs/symlink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,5 @@ const struct address_space_operations affs_symlink_aops = {
7171

7272
const struct inode_operations affs_symlink_inode_operations = {
7373
.get_link = page_get_link,
74-
.setattr = affs_notify_change,
74+
.setattr = affs_setattr,
7575
};

fs/hfs/inode.c

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -622,32 +622,14 @@ static int hfs_file_release(struct inode *inode, struct file *file)
622622
return 0;
623623
}
624624

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-
642625
int hfs_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
643626
struct iattr *attr)
644627
{
645628
struct inode *inode = d_inode(dentry);
646629
struct hfs_sb_info *hsb = HFS_SB(inode->i_sb);
647630
int error;
648631

649-
error = setattr_prepare(&nop_mnt_idmap, dentry,
650-
attr); /* basic permission checks */
632+
error = setattr_prepare(&nop_mnt_idmap, dentry, attr);
651633
if (error)
652634
return error;
653635

@@ -663,6 +645,7 @@ int hfs_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
663645
return hsb->s_quiet ? 0 : error;
664646
}
665647

648+
/* map file permissions to the closest allowable permissions in HFS */
666649
if (attr->ia_valid & ATTR_MODE) {
667650
/* Only the 'w' bits can ever change and only all together. */
668651
if (attr->ia_mode & S_IWUSR)

0 commit comments

Comments
 (0)