From 9d30a68082659c27a9dac6e4d1a98e2be8bf5bf8 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Sun, 23 Aug 2009 22:36:02 +0000 Subject: performance/stat-prefetch: implement sp_removexattr. 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 | 74 +++++++++++++++------- 1 file changed, 50 insertions(+), 24 deletions(-) (limited to 'xlators/performance/stat-prefetch/src/stat-prefetch.c') diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c index 3d866b55ebe..b94451aa926 100644 --- a/xlators/performance/stat-prefetch/src/stat-prefetch.c +++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c @@ -1467,6 +1467,31 @@ unwind: } +int32_t +sp_removexattr (call_frame_t *frame, xlator_t *this, loc_t *loc, + const char *name) +{ + sp_cache_t *cache = NULL; + + GF_VALIDATE_OR_GOTO (this->name, loc, unwind); + GF_VALIDATE_OR_GOTO (this->name, loc->parent, unwind); + GF_VALIDATE_OR_GOTO (this->name, loc->name, unwind); + + cache = sp_get_cache_inode (this, loc->parent, frame->root->pid); + if (cache) { + sp_cache_remove_entry (cache, (char *)loc->name, 0); + } + + STACK_WIND (frame, sp_err_cbk, FIRST_CHILD(this), + FIRST_CHILD(this)->fops->removexattr, loc, name); + return 0; + +unwind: + SP_STACK_UNWIND (frame, -1, errno); + return 0; +} + + int32_t sp_forget (xlator_t *this, inode_t *inode) { @@ -1509,30 +1534,31 @@ fini (xlator_t *this) struct xlator_fops fops = { - .lookup = sp_lookup, - .readdir = sp_readdir, - .chmod = sp_chmod, - .open = sp_open, - .create = sp_create, - .opendir = sp_opendir, - .mkdir = sp_mkdir, - .mknod = sp_mknod, - .symlink = sp_symlink, - .link = sp_link, - .fchmod = sp_fchmod, - .chown = sp_chown, - .fchown = sp_fchown, - .truncate = sp_truncate, - .ftruncate = sp_ftruncate, - .utimens = sp_utimens, - .readlink = sp_readlink, - .unlink = sp_unlink, - .rmdir = sp_rmdir, - .readv = sp_readv, - .writev = sp_writev, - .fsync = sp_fsync, - .rename = sp_rename, - .setxattr = sp_setxattr, + .lookup = sp_lookup, + .readdir = sp_readdir, + .chmod = sp_chmod, + .open = sp_open, + .create = sp_create, + .opendir = sp_opendir, + .mkdir = sp_mkdir, + .mknod = sp_mknod, + .symlink = sp_symlink, + .link = sp_link, + .fchmod = sp_fchmod, + .chown = sp_chown, + .fchown = sp_fchown, + .truncate = sp_truncate, + .ftruncate = sp_ftruncate, + .utimens = sp_utimens, + .readlink = sp_readlink, + .unlink = sp_unlink, + .rmdir = sp_rmdir, + .readv = sp_readv, + .writev = sp_writev, + .fsync = sp_fsync, + .rename = sp_rename, + .setxattr = sp_setxattr, + .removexattr = sp_removexattr, }; struct xlator_mops mops = { -- cgit