From f62a8026be3875afd38fb1899e1fa235c8f1a6fb Mon Sep 17 00:00:00 2001 From: Brian Foster Date: Mon, 16 Jul 2012 13:51:09 -0400 Subject: libglusterfs,mount/fuse: implement gidcache mechanism in fuse-bridge This change genericizes the cache mechanism implemented in commit 8efd2845 into libglusterfs/src/gidcache.[ch] and adds fuse-bridge as a client. The cache mechanism is fundamentally equivalent, with some minor changes: - Change cache key from uid_t to uint64_t. - Modify the cache add logic to locate and use an entry with a matching ID, should it already exist. This addresses a bug in the existing mechanism where an expired entry supercedes a newly added entry in lookup, causing repeated adds and flushing of a cache bucket. The fuse group cache is disabled by default. It can be enabled via the 'gid-timeout' fuse-bridge translator option and accompanying mount option (i.e., '-o gid-timeout=1' for a 1s entry timeout). BUG: 800892 Change-Id: I0b34a2263ca48dbb154790a4a44fc70b733e9114 Signed-off-by: Brian Foster Reviewed-on: https://code.engineering.redhat.com/gerrit/1853 Reviewed-by: Vijay Bellur Tested-by: Vijay Bellur --- xlators/mount/fuse/src/fuse-bridge.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'xlators/mount/fuse/src/fuse-bridge.h') diff --git a/xlators/mount/fuse/src/fuse-bridge.h b/xlators/mount/fuse/src/fuse-bridge.h index 6b0ba54819f..f9d897c3037 100644 --- a/xlators/mount/fuse/src/fuse-bridge.h +++ b/xlators/mount/fuse/src/fuse-bridge.h @@ -55,6 +55,7 @@ #include "list.h" #include "dict.h" #include "syncop.h" +#include "gidcache.h" #if defined(GF_LINUX_HOST_OS) || defined(__NetBSD__) #define FUSE_OP_HIGH (FUSE_POLL + 1) @@ -109,6 +110,8 @@ struct fuse_private { gf_boolean_t acl; gf_boolean_t selinux; gf_boolean_t read_only; + int32_t gid_cache_timeout; + gid_cache_t gid_cache; gf_boolean_t enable_ino32; fdtable_t *fdtable; -- cgit