aboutsummaryrefslogtreecommitdiffstats
path: root/fs/orangefs/orangefs-kernel.h
diff options
context:
space:
mode:
authorMartin Brandenburg <martin@omnibond.com>2017-12-12 13:46:30 -0500
committerMike Marshall <hubcap@omnibond.com>2019-05-03 14:32:37 -0400
commitfc2e2e9c43e3b3f5dec8a02b17ee3d6343d9783a (patch)
tree9a2b34f3f93eac859d2caad075f6dec85205736f /fs/orangefs/orangefs-kernel.h
parentLinux 5.1-rc7 (diff)
downloadlinux-dev-fc2e2e9c43e3b3f5dec8a02b17ee3d6343d9783a.tar.xz
linux-dev-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.h11
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;
/*