Commit 510792ee authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Alex Elder

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: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAlex Elder <aelder@sgi.com>
parent d1166ec7
...@@ -1194,9 +1194,14 @@ xfs_setup_inode( ...@@ -1194,9 +1194,14 @@ xfs_setup_inode(
break; break;
} }
/* if there is no attribute fork no ACL can exist on this inode */ /*
if (!XFS_IFORK_Q(ip)) * If there is no attribute fork no ACL can exist on this inode,
* and it can't have any file capabilities attached to it either.
*/
if (!XFS_IFORK_Q(ip)) {
inode_has_no_xattr(inode);
cache_no_acl(inode); cache_no_acl(inode);
}
xfs_iflags_clear(ip, XFS_INEW); xfs_iflags_clear(ip, XFS_INEW);
barrier(); barrier();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment