From 81d858f16cba61dfdf9f4b1348703d2e5358a0ad Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Sun, 23 Aug 2009 22:30:32 +0000 Subject: performance/stat-prefetch: implement sp_symlink. 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 | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'xlators/performance') diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c index 98cecc51c73..0a78cb51aef 100644 --- a/xlators/performance/stat-prefetch/src/stat-prefetch.c +++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c @@ -908,6 +908,35 @@ unwind: } +int32_t +sp_symlink (call_frame_t *frame, xlator_t *this, const char *linkpath, + loc_t *loc) +{ + int32_t ret = 0; + + GF_VALIDATE_OR_GOTO (this->name, loc, unwind); + GF_VALIDATE_OR_GOTO (this->name, loc->parent, unwind); + GF_VALIDATE_OR_GOTO (this->name, loc->path, unwind); + GF_VALIDATE_OR_GOTO (this->name, loc->name, unwind); + GF_VALIDATE_OR_GOTO (this->name, loc->inode, unwind); + + ret = sp_cache_remove_parent_entry (frame, this, (char *)loc->path); + if (ret == -1) { + gf_log (this->name, GF_LOG_ERROR, "out of memory"); + goto unwind; + } + + STACK_WIND (frame, sp_new_entry_cbk, FIRST_CHILD(this), + FIRST_CHILD(this)->fops->symlink, linkpath, loc); + + return 0; + +unwind: + SP_STACK_UNWIND (frame, -1, errno, loc->inode, NULL); + return 0; +} + + int32_t sp_forget (xlator_t *this, inode_t *inode) { @@ -958,6 +987,7 @@ struct xlator_fops fops = { .opendir = sp_opendir, .mkdir = sp_mkdir, .mknod = sp_mknod, + .symlink = sp_symlink, }; struct xlator_mops mops = { -- cgit