From bc99744f209d2c6905f858e9ab44d09fb661e94a Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Wed, 3 Jun 2009 01:31:37 +0000 Subject: libglusterfsclient: Simplify inode and stat caching There is a mechanism for caching the inode numbers got from a lookup and a struct stat got from a stat or fstat but I wasnt sure if it worked. This commit simplifies cache updates and checks and the accompanying tests have made sure that the cache does work. Signed-off-by: Anand V. Avati --- libglusterfsclient/src/libglusterfsclient-internals.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libglusterfsclient/src/libglusterfsclient-internals.h') diff --git a/libglusterfsclient/src/libglusterfsclient-internals.h b/libglusterfsclient/src/libglusterfsclient-internals.h index 40ad6f692..42ce5d4ca 100755 --- a/libglusterfsclient/src/libglusterfsclient-internals.h +++ b/libglusterfsclient/src/libglusterfsclient-internals.h @@ -235,5 +235,18 @@ struct vmp_entry { glusterfs_handle_t handle; }; +#define LIBGF_UPDATE_LOOKUP 0x1 +#define LIBGF_UPDATE_STAT 0x2 +#define LIBGF_UPDATE_ALL (LIBGF_UPDATE_LOOKUP | LIBGF_UPDATE_STAT) + +#define LIBGF_VALIDATE_LOOKUP 0x1 +#define LIBGF_VALIDATE_STAT 0x2 + +int +libgf_is_iattr_cache_valid (libglusterfs_client_ctx_t *ctx, inode_t *inode, + struct stat *sbuf, int flags); + +int +libgf_update_iattr_cache (inode_t *inode, int flags, struct stat *buf); #endif -- cgit