From 8c110d0aba119d199e2e8d29418ed45119aeb30c Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Wed, 26 Aug 2009 01:36:53 +0000 Subject: performance/stat-prefetch: introduce sp_fd_ctx_t to hold context of fds - we need following extra members along with cache 1. basename of path on which fd is opened. This is necessary to search for cached entry in fd based fops. 2. inode corresponding to dirname of path on which fd is opened. This is necessary to get cache where entry corresponding to file on which fd is opened. Signed-off-by: Anand V. Avati BUG: 221 (stat prefetch implementation) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=221 --- xlators/performance/stat-prefetch/src/stat-prefetch.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'xlators/performance/stat-prefetch/src/stat-prefetch.h') diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.h b/xlators/performance/stat-prefetch/src/stat-prefetch.h index 4a45261a4..05c5d4361 100644 --- a/xlators/performance/stat-prefetch/src/stat-prefetch.h +++ b/xlators/performance/stat-prefetch/src/stat-prefetch.h @@ -38,6 +38,19 @@ struct sp_cache { }; typedef struct sp_cache sp_cache_t; +struct sp_fd_ctx { + sp_cache_t *cache; + inode_t *parent_inode; /* + * inode corresponding to dirname (path) + */ + char *name; /* + * basename of path on which this fd is + * opened + */ + gf_lock_t lock; +}; +typedef struct sp_fd_ctx sp_fd_ctx_t; + struct sp_local { loc_t loc; fd_t *fd; -- cgit