diff options
author | Poornima G <pgurusid@redhat.com> | 2017-08-07 11:24:46 +0530 |
---|---|---|
committer | Poornima G <pgurusid@redhat.com> | 2018-01-18 06:03:32 +0000 |
commit | 2db7872d5251d98d47c262ff269776bfae2d4fb9 (patch) | |
tree | 04a122cbb334eb787f917bdddabd5a24431e1933 /xlators | |
parent | c2fa8a94342b0cfbce9393f513099b8751711eae (diff) |
md-cache: Serve nameless lookup from cache
Updates #232
Change-Id: I97e92312a53a50c2d1660bf8d657201fc05a76eb
Signed-off-by: Poornima G <pgurusid@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/performance/md-cache/src/md-cache.c | 18 |
1 files changed, 8 insertions, 10 deletions
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; |