From acb388c4c584cbc601bee69b0ca297eb3a9ef296 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Sun, 23 Aug 2009 22:30:06 +0000 Subject: performance/stat-prefetch: implement sp_opendir. Signed-off-by: Anand V. Avati BUG: 221 (stat prefetch implementation) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=221 --- .../performance/stat-prefetch/src/stat-prefetch.c | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'xlators/performance/stat-prefetch') diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c index 81edb9b7627..bcf3ee9c43c 100644 --- a/xlators/performance/stat-prefetch/src/stat-prefetch.c +++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c @@ -815,6 +815,32 @@ unwind: } +int32_t +sp_opendir (call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd) +{ + sp_local_t *local = NULL; + int32_t ret = -1; + + local = CALLOC (1, sizeof (*local)); + GF_VALIDATE_OR_GOTO_WITH_ERROR (this->name, local, unwind, ENOMEM); + + frame->local = local; + + ret = loc_copy (&local->loc, loc); + if (ret == -1) { + goto unwind; + } + + STACK_WIND (frame, sp_fd_cbk, FIRST_CHILD(this), + FIRST_CHILD(this)->fops->opendir, loc, fd); + return 0; + +unwind: + SP_STACK_UNWIND (frame, -1, errno, fd); + return 0; +} + + int32_t sp_forget (xlator_t *this, inode_t *inode) { @@ -862,6 +888,7 @@ struct xlator_fops fops = { .chmod = sp_chmod, .open = sp_open, .create = sp_create, + .opendir = sp_opendir, }; struct xlator_mops mops = { -- cgit