From 4538285776eeaa5383d7473438440d953fd9e232 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Sun, 23 Aug 2009 22:31:28 +0000 Subject: performance/stat-prefetch: implement sp_utimens. 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 | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'xlators') diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c index 6986aa2f762..cdf6d73dece 100644 --- a/xlators/performance/stat-prefetch/src/stat-prefetch.c +++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c @@ -1118,6 +1118,31 @@ unwind: } +int32_t +sp_utimens (call_frame_t *frame, xlator_t *this, loc_t *loc, + struct timespec tv[2]) +{ + 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_stbuf_cbk, FIRST_CHILD(this), + FIRST_CHILD(this)->fops->utimens, loc, tv); + return 0; + +unwind: + SP_STACK_UNWIND (frame, -1, errno, NULL); + return 0; +} + + int32_t sp_forget (xlator_t *this, inode_t *inode) { @@ -1175,6 +1200,7 @@ struct xlator_fops fops = { .fchown = sp_fchown, .truncate = sp_truncate, .ftruncate = sp_ftruncate, + .utimens = sp_utimens, }; struct xlator_mops mops = { -- cgit