diff options
author | Martin Brandenburg <martin@omnibond.com> | 2017-12-12 13:46:30 -0500 |
---|---|---|
committer | Mike Marshall <hubcap@omnibond.com> | 2019-05-03 14:32:37 -0400 |
commit | fc2e2e9c43e3b3f5dec8a02b17ee3d6343d9783a (patch) | |
tree | 9a2b34f3f93eac859d2caad075f6dec85205736f /fs/orangefs/orangefs-kernel.h | |
parent | 37624b58542fb9f2d9a70e6ea006ef8a5f66c30b (diff) | |
download | lwn-fc2e2e9c43e3b3f5dec8a02b17ee3d6343d9783a.tar.gz lwn-fc2e2e9c43e3b3f5dec8a02b17ee3d6343d9783a.zip |
orangefs: implement xattr cache
This uses the same timeout as the getattr cache. This substantially
increases performance when writing files with smaller buffer sizes.
When writing, the size is (often) changed, which causes a call to
notify_change which calls security_inode_need_killpriv which needs a
getxattr. Caching it reduces traffic to the server.
Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs/orangefs/orangefs-kernel.h')
-rw-r--r-- | fs/orangefs/orangefs-kernel.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/orangefs/orangefs-kernel.h b/fs/orangefs/orangefs-kernel.h index 17b24ad6b264..eba9136207f9 100644 --- a/fs/orangefs/orangefs-kernel.h +++ b/fs/orangefs/orangefs-kernel.h @@ -51,6 +51,7 @@ #include <linux/rwsem.h> #include <linux/xattr.h> #include <linux/exportfs.h> +#include <linux/hashtable.h> #include <asm/unaligned.h> @@ -193,6 +194,8 @@ struct orangefs_inode_s { unsigned long getattr_time; u32 getattr_mask; + + DECLARE_HASHTABLE(xattr_cache, 4); }; /* per superblock private orangefs info */ @@ -217,6 +220,14 @@ struct orangefs_stats { unsigned long writes; }; +struct orangefs_cached_xattr { + struct hlist_node node; + char key[ORANGEFS_MAX_XATTR_NAMELEN]; + char val[ORANGEFS_MAX_XATTR_VALUELEN]; + ssize_t length; + unsigned long timeout; +}; + extern struct orangefs_stats orangefs_stats; /* |