]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: use either dentry_invalidate_cb or remount_cb to invalidate kernel dcache 20700/head
authorZhi Zhang <willzzhang@tencent.com>
Mon, 5 Mar 2018 03:04:36 +0000 (11:04 +0800)
committerZhi Zhang <willzzhang@tencent.com>
Mon, 5 Mar 2018 03:04:36 +0000 (11:04 +0800)
Signed-off-by: Zhi Zhang <zhangz.david@outlook.com>
src/client/Client.cc

index 0ea23e822949e6cd650fe8df0782d5979ab0a686..15f05b2d842a4c52f8e709c0553c1e6b143423db 100644 (file)
@@ -4022,12 +4022,14 @@ void Client::_invalidate_kernel_dcache()
 {
   if (unmounting)
     return;
-  if (can_invalidate_dentries && dentry_invalidate_cb && root->dir) {
-    for (ceph::unordered_map<string, Dentry*>::iterator p = root->dir->dentries.begin();
-        p != root->dir->dentries.end();
-        ++p) {
-      if (p->second->inode)
-       _schedule_invalidate_dentry_callback(p->second, false);
+  if (can_invalidate_dentries) {
+    if (dentry_invalidate_cb && root->dir) {
+      for (ceph::unordered_map<string, Dentry*>::iterator p = root->dir->dentries.begin();
+         p != root->dir->dentries.end();
+         ++p) {
+       if (p->second->inode)
+        _schedule_invalidate_dentry_callback(p->second, false);
+      }
     }
   } else if (remount_cb) {
     // Hacky: