aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2011-07-26 11:07:29 -0400
committerAlex Elder <aelder@sgi.com>2011-07-26 23:06:50 -0400
commit510792ee29770a38dd409bf2b469ade2fea9eb52 (patch)
treeed442b019b3ce77c4cead40082e7229bb7044eed /fs
parentd1166ec792c96b65e4c18cbc5985944b5309d838 (diff)
xfs: optimize the negative xattr caching
Since the addition of file capabilities every write needs to read xattrs to check if we have any capabilities to clear. In Linux 3.0 Andi Kleen added a flag to cache the fact that we do not have any attributes on an inode. Make sure to already mark a file as not having any attributes when reading it from disk in case it doesn't even have an attribute fork. Based on an earlier patch from Andi Kleen. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index 6544c3236bc8..b9c172b3fbbe 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -1194,9 +1194,14 @@ xfs_setup_inode(
1194 break; 1194 break;
1195 } 1195 }
1196 1196
1197 /* if there is no attribute fork no ACL can exist on this inode */ 1197 /*
1198 if (!XFS_IFORK_Q(ip)) 1198 * If there is no attribute fork no ACL can exist on this inode,
1199 * and it can't have any file capabilities attached to it either.
1200 */
1201 if (!XFS_IFORK_Q(ip)) {
1202 inode_has_no_xattr(inode);
1199 cache_no_acl(inode); 1203 cache_no_acl(inode);
1204 }
1200 1205
1201 xfs_iflags_clear(ip, XFS_INEW); 1206 xfs_iflags_clear(ip, XFS_INEW);
1202 barrier(); 1207 barrier();