Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1248877

[PATCH v11 23/48] xfs: Make xfs_set_mode non-static

From Andreas Gruenbacher <agruenba@redhat.com>
Newsgroups linux.kernel
Subject [PATCH v11 23/48] xfs: Make xfs_set_mode non-static
Date 2015-10-16 17:30 +0200
Message-ID <qkf7d-1SN-45@gated-at.bofh.it> (permalink)
References <qkeXv-1Ha-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 fs/xfs/xfs_acl.c   | 18 ------------------
 fs/xfs/xfs_inode.c | 24 ++++++++++++++++++++++++
 fs/xfs/xfs_inode.h |  2 ++
 3 files changed, 26 insertions(+), 18 deletions(-)

diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c
index e87fd3f..7b03383 100644
--- a/fs/xfs/xfs_acl.c
+++ b/fs/xfs/xfs_acl.c
@@ -232,24 +232,6 @@ __xfs_set_acl(struct inode *inode, int type, struct posix_acl *acl)
 }
 
 static 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;
-}
-
-static int
 xfs_acl_exists(struct inode *inode, unsigned char *name)
 {
 	int len = XFS_ACL_MAX_SIZE(XFS_M(inode->i_sb));
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index dc40a6d..644fa04 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -3587,3 +3587,27 @@ xfs_iflush_int(
 corrupt_out:
 	return -EFSCORRUPTED;
 }
+
+/*
+ * Set an inode's file mode.
+ *
+ * Called when updating an inode's file mode as part of setting an ACL only.
+ * The VFS goes through the setattr inode operation instead.
+ */
+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;
+}
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index ca9e119..7b22db0 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -424,6 +424,8 @@ int		xfs_dir_ialloc(struct xfs_trans **, struct xfs_inode *, umode_t,
 int		xfs_droplink(struct xfs_trans *, struct xfs_inode *);
 int		xfs_bumplink(struct xfs_trans *, struct xfs_inode *);
 
+int		xfs_set_mode(struct inode *, umode_t);
+
 /* from xfs_file.c */
 enum xfs_prealloc_flags {
 	XFS_PREALLOC_SET	= (1 << 1),
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v11 00/48] Richacls Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:20 +0200
  [PATCH v11 10/48] vfs: Cache base_acl objects in inodes Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:20 +0200
  [PATCH v11 04/48] vfs: Make the inode passed to inode_change_ok non-const Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:20 +0200
  [PATCH v11 11/48] vfs: Add get_richacl and set_richacl inode operations Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:20 +0200
  [PATCH v11 05/48] vfs: Add permission flags for setting file attributes Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:20 +0200
  [PATCH v11 06/48] richacl: In-memory representation and helper functions Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:20 +0200
  [PATCH v11 01/48] vfs: Add IS_ACL() and IS_RICHACL() tests Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:20 +0200
  [PATCH v11 03/48] vfs: Add MAY_DELETE_SELF and MAY_DELETE_CHILD permission flags Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:20 +0200
  [PATCH v11 41/48] xfs: Don't allow unmapped identifiers in richacls Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 39/48] nfsd: Add support for unmapped richace identifiers Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 25/48] richacl: acl editing helper functions Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 22/48] xfs: Fix error path in xfs_get_acl Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 46/48] nfs: Distinguish missing users and groups from nobody Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 42/48] sunrpc: Allow to demand-allocate pages to encode into Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 31/48] richacl: Apply the file masks to a richacl Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 29/48] richacl: Set the other permissions to the other mask Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 38/48] richacl: Add support for unmapped identifiers Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 48/48] nfs: Add support for the v4.1 dacl attribute Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 24/48] xfs: Add richacl support Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 45/48] nfs: Remove unused xdr page offsets in getacl/setacl arguments Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 47/48] nfs: Add richacl support Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 12/48] vfs: Cache richacl in struct inode Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 19/48] vfs: Add richacl permission checking Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 23/48] xfs: Make xfs_set_mode non-static Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 21/48] ext4: Add richacl feature flag Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
    Re: [PATCH v11 21/48] ext4: Add richacl feature flag Austin S Hemmelgarn <ahferroin7@gmail.com> - 2015-10-16 19:40 +0200
      Re: [PATCH v11 21/48] ext4: Add richacl feature flag Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 19:50 +0200
        Re: [PATCH v11 21/48] ext4: Add richacl feature flag Austin S Hemmelgarn <ahferroin7@gmail.com> - 2015-10-16 20:30 +0200
          Re: [PATCH v11 21/48] ext4: Add richacl feature flag Dave Chinner <david@fromorbit.com> - 2015-10-18 01:30 +0200
  [PATCH v11 44/48] nfs: Fix GETATTR bitmap verification Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 37/48] nfsd: Add support for the MAY_CREATE_{FILE,DIR} permissions Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 16/48] richacl: Automatic Inheritance Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
    Re: [PATCH v11 16/48] richacl: Automatic Inheritance Andy Lutomirski <luto@amacapital.net> - 2015-10-16 18:10 +0200
      Re: [PATCH v11 16/48] richacl: Automatic Inheritance Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 18:20 +0200
  [PATCH v11 18/48] richacl: Add richacl xattr handler Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 43/48] sunrpc: Add xdr_init_encode_pages Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 28/48] richacl: Set the owner permissions to the owner mask Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 36/48] nfsd: Add support for the v4.1 dacl attribute Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 35/48] nfsd: Add richacl support Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 13/48] richacl: Update the file masks in chmod() Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 30/48] richacl: Isolate the owner and group classes Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 20/48] ext4: Add richacl support Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 27/48] richacl: Propagate everyone@ permissions to other aces Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:30 +0200
  [PATCH v11 40/48] ext4: Don't allow unmapped identifiers in richacls Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:40 +0200
  [PATCH v11 26/48] richacl: Move everyone@ aces down the acl Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:50 +0200
  [PATCH v11 33/48] nfsd: Keep list of acls to dispose of in compoundargs Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:50 +0200
  [PATCH v11 32/48] richacl: Create richacl from mode values Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:50 +0200
  [PATCH v11 34/48] nfsd: Use richacls as internal acl representation Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 17:50 +0200
  [PATCH v11 15/48] richacl: Create-time inheritance Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 18:00 +0200
  [PATCH v11 17/48] richacl: xattr mapping functions Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 18:00 +0200
  [PATCH v11 14/48] richacl: Check if an acl is equivalent to a file mode Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 18:10 +0200
  [PATCH v11 09/48] richacl: Permission check algorithm Andreas Gruenbacher <agruenba@redhat.com> - 2015-10-16 18:10 +0200

csiph-web