]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
hfs: update comments on hfs_inode_setattr
authorChristoph Hellwig <hch@lst.de>
Wed, 25 Mar 2026 06:36:48 +0000 (07:36 +0100)
committerChristian Brauner <brauner@kernel.org>
Thu, 26 Mar 2026 14:16:53 +0000 (15:16 +0100)
The top of function comment about hfs_inode_setattr is severely out
of date and reference a previous name for this function.  Remove it,
and update the comments in the file to record the still relevant bits
directly.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://patch.msgid.link/20260325063711.3298685-2-hch@lst.de
Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/hfs/inode.c

index 878535db64d679995cd1f5c215f56c5258c3c720..72948eb2fadc291627601e59acfbba8a35cf0f88 100644 (file)
@@ -622,23 +622,6 @@ static int hfs_file_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-/*
- * hfs_notify_change()
- *
- * Based very closely on fs/msdos/inode.c by Werner Almesberger
- *
- * This is the notify_change() field in the super_operations structure
- * for HFS file systems.  The purpose is to take that changes made to
- * an inode and apply then in a filesystem-dependent manner.  In this
- * case the process has a few of tasks to do:
- *  1) prevent changes to the i_uid and i_gid fields.
- *  2) map file permissions to the closest allowable permissions
- *  3) Since multiple Linux files can share the same on-disk inode under
- *     HFS (for instance the data and resource forks of a file) a change
- *     to permissions must be applied to all other in-core inodes which
- *     correspond to the same HFS file.
- */
-
 int hfs_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
                      struct iattr *attr)
 {
@@ -646,8 +629,7 @@ int hfs_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
        struct hfs_sb_info *hsb = HFS_SB(inode->i_sb);
        int error;
 
-       error = setattr_prepare(&nop_mnt_idmap, dentry,
-                               attr); /* basic permission checks */
+       error = setattr_prepare(&nop_mnt_idmap, dentry, attr);
        if (error)
                return error;
 
@@ -663,6 +645,7 @@ int hfs_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
                return hsb->s_quiet ? 0 : error;
        }
 
+       /* map file permissions to the closest allowable permissions in HFS */
        if (attr->ia_valid & ATTR_MODE) {
                /* Only the 'w' bits can ever change and only all together. */
                if (attr->ia_mode & S_IWUSR)