diff options
author | Raghavendra G <raghavendra@gluster.com> | 2009-08-23 22:30:06 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-09-08 01:41:25 -0700 |
commit | acb388c4c584cbc601bee69b0ca297eb3a9ef296 (patch) | |
tree | d97ae41b640e313018405d7a3143d0034c34ca0e /xlators/performance | |
parent | b18aa9cd570cb20680aa3d5bac11a2674d2a2f78 (diff) |
performance/stat-prefetch: implement sp_opendir.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 221 (stat prefetch implementation)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=221
Diffstat (limited to 'xlators/performance')
-rw-r--r-- | xlators/performance/stat-prefetch/src/stat-prefetch.c | 27 |
1 files changed, 27 insertions, 0 deletions
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 @@ -816,6 +816,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) { struct stat *buf = NULL; @@ -862,6 +888,7 @@ struct xlator_fops fops = { .chmod = sp_chmod, .open = sp_open, .create = sp_create, + .opendir = sp_opendir, }; struct xlator_mops mops = { |