md-cache: Remove readdirp fop for md-cache
authorMohammed Rafi KC <rkavunga@redhat.com>
Wed, 12 Aug 2015 09:26:27 +0000 (14:56 +0530)
committerRaghavendra G <rgowdapp@redhat.com>
Mon, 9 Nov 2015 10:49:39 +0000 (02:49 -0800)
readdirp call will return inode for each entry and
will share this nodeid with kernal, also md-cache
will cache this gfid and base name. So when a lookup
operation is perfromed on such an inode, md-cache
will wind the call, that prevents populating inode
ctx for other lower layer xlators.

Change-Id: I43c768703a3cc66d05b1c32909d1a2781001cb49
BUG: 1236032
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/11894
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
xlators/performance/md-cache/src/md-cache.c

index d5ff10f9f58818b0857dfa63f00e81423fac3dbf..59af907a1e7381d66470dc411d96450104433fda 100644 (file)
@@ -1972,7 +1972,8 @@ int
 mdc_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                  int op_ret, int op_errno, gf_dirent_t *entries, dict_t *xdata)
 {
-        gf_dirent_t *entry      = NULL;
+        gf_dirent_t     *entry      = NULL;
+        struct md_cache *mdc        = NULL;
 
        if (op_ret <= 0)
                goto unwind;
@@ -1980,6 +1981,8 @@ mdc_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         list_for_each_entry (entry, &entries->list, list) {
                 if (!entry->inode)
                        continue;
+                if (mdc_inode_ctx_get (this, entry->inode, &mdc) != 0)
+                        continue;
                 mdc_inode_iatt_set (this, entry->inode, &entry->d_stat);
                 mdc_inode_xatt_set (this, entry->inode, entry->dict);
         }