From 2db7872d5251d98d47c262ff269776bfae2d4fb9 Mon Sep 17 00:00:00 2001 From: Poornima G Date: Mon, 7 Aug 2017 11:24:46 +0530 Subject: md-cache: Serve nameless lookup from cache Updates #232 Change-Id: I97e92312a53a50c2d1660bf8d657201fc05a76eb Signed-off-by: Poornima G --- xlators/performance/md-cache/src/md-cache.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'xlators/performance') diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c index 5b8f06b82af..5dbfb1366c9 100644 --- a/xlators/performance/md-cache/src/md-cache.c +++ b/xlators/performance/md-cache/src/md-cache.c @@ -1232,16 +1232,9 @@ mdc_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, loc_copy (&local->loc, loc); - if (!loc->name) { - GF_ATOMIC_INC (conf->mdc_counter.nameless_lookup); - - gf_msg_trace ("md-cache", 0, "Nameless lookup(%s) sent to the " - "brick", uuid_utoa (loc->inode->gfid)); - /* A nameless discovery is dangerous to serve from cache. We - perform nameless lookup with the intention of - re-establishing an inode "properly" - */ - goto uncached; + if (!inode_is_linked(loc->inode)) { + GF_ATOMIC_INC (conf->mdc_counter.stat_miss); + goto uncached; } if (mdc_inode_reset_need_lookup (this, loc->inode)) { @@ -1330,6 +1323,11 @@ mdc_stat (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) loc_copy (&local->loc, loc); + if (!inode_is_linked(loc->inode)) { + GF_ATOMIC_INC (conf->mdc_counter.stat_miss); + goto uncached; + } + ret = mdc_inode_iatt_get (this, loc->inode, &stbuf); if (ret != 0) goto uncached; -- cgit