Thread (49 messages) flat view 49 messages, 3 authors, 2015-10-12

Re: [PATCH v10 23/46] xfs: Make xfs_set_mode non-static

From: Dave Chinner <david@fromorbit.com>
Date: 2015-10-11 23:37:40
Also in: linux-cifs, linux-ext4, linux-fsdevel, linux-nfs, linux-xfs, lkml

On Mon, Oct 12, 2015 at 12:58:34AM +0200, Andreas Gruenbacher wrote:
From: Andreas Gruenbacher <agruenba@redhat.com>

Make xfs_set_mode non-static and move it from xfs_acl.c into xfs_inode.c.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
.....
quoted hunk ↗ jump to hunk
+++ b/fs/xfs/xfs_inode.c
@@ -3587,3 +3587,21 @@ xfs_iflush_int(
 corrupt_out:
 	return -EFSCORRUPTED;
 }
+
+int
+xfs_set_mode(struct inode *inode, umode_t mode)
+{
+	int error = 0;
+
+	if (mode != inode->i_mode) {
+		struct iattr iattr;
+
+		iattr.ia_valid = ATTR_MODE | ATTR_CTIME;
+		iattr.ia_mode = mode;
+		iattr.ia_ctime = current_fs_time(inode->i_sb);
+
+		error = xfs_setattr_nonsize(XFS_I(inode), &iattr, XFS_ATTR_NOACL);
+	}
+
+	return error;
+}
Now needs a comment to explain that this function has a special
"called only from ACL modification" context associated with it.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help