]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: misc cleanup 16149/head
authorVicente Cheng <vicente_cheng@bigtera.com>
Wed, 5 Jul 2017 10:50:34 +0000 (18:50 +0800)
committerVicente Cheng <vicente_cheng@bigtera.com>
Thu, 6 Jul 2017 02:31:51 +0000 (10:31 +0800)
Signed-off-by: Vicente Cheng <vicente_cheng@bigtera.com>
src/mds/Server.cc
src/mon/MDSMonitor.cc

index d65b3c9d9aa1f1834d28e1b84e29a9780f33cbc1..2fe2184e4fe258b816d52bd996b371ff0822ab60 100644 (file)
@@ -3410,7 +3410,9 @@ void Server::handle_client_openc(MDRequestRef& mdr)
     return;
   }
 
-  if (!(req->head.args.open.flags & CEPH_O_EXCL)) {
+  bool excl = req->head.args.open.flags & CEPH_O_EXCL;
+
+  if (!excl) {
     int r = mdcache->path_traverse(mdr, NULL, NULL, req->get_filepath(),
                                   &mdr->dn[0], NULL, MDS_TRAVERSE_FORWARD);
     if (r > 0) return;
@@ -3430,10 +3432,8 @@ void Server::handle_client_openc(MDRequestRef& mdr)
       }
       return;
     }
-    // r == -ENOENT
   }
 
-  bool excl = (req->head.args.open.flags & CEPH_O_EXCL);
   set<SimpleLock*> rdlocks, wrlocks, xlocks;
   file_layout_t *dir_layout = NULL;
   CDentry *dn = rdlock_path_xlock_dentry(mdr, 0, rdlocks, wrlocks, xlocks,
@@ -3491,6 +3491,7 @@ void Server::handle_client_openc(MDRequestRef& mdr)
     return;
   }
 
+  // created null dn.
   CDir *dir = dn->get_dir();
   CInode *diri = dir->get_inode();
   rdlocks.insert(&diri->authlock);
@@ -3515,8 +3516,6 @@ void Server::handle_client_openc(MDRequestRef& mdr)
     return;
   }
 
-  // created null dn.
-    
   // create inode.
   SnapRealm *realm = diri->find_snaprealm();   // use directory's realm; inode isn't attached yet.
   snapid_t follows = realm->get_newest_seq();
index 608e1aeedc3e8d43c19e5c29af4264d1f955b6b8..2bf7681814ea662f1714154c965c2687ed039049 100644 (file)
@@ -537,9 +537,8 @@ bool MDSMonitor::prepare_beacon(MonOpRequestRef op)
       if (leaderinfo && (leaderinfo->rank >= 0)) {
         auto fscid = pending_fsmap.mds_roles.at(leaderinfo->global_id);
         auto fs = pending_fsmap.get_filesystem(fscid);
-        bool followable = fs->mds_map.is_followable(leaderinfo->rank);
 
-        pending_fsmap.modify_daemon(gid, [fscid, leaderinfo, followable](
+        pending_fsmap.modify_daemon(gid, [fscid, leaderinfo](
               MDSMap::mds_info_t *info) {
             info->standby_for_rank = leaderinfo->rank;
             info->standby_for_fscid = fscid;
@@ -883,11 +882,11 @@ bool MDSMonitor::preprocess_command(MonOpRequestRef op)
       } else {
        mdsmap->print(ds);
        r = 0;
-      } 
-      if (r == 0) {
-       rdata.append(ds);
-       ss << "dumped fsmap epoch " << p->get_epoch();
       }
+
+      rdata.append(ds);
+      ss << "dumped fsmap epoch " << p->get_epoch();
+
       if (p != &fsmap) {
        delete p;
       }
@@ -922,11 +921,11 @@ bool MDSMonitor::preprocess_command(MonOpRequestRef op)
       } else {
        p->print(ds);
        r = 0;
-      } 
-      if (r == 0) {
-       rdata.append(ds);
-       ss << "dumped fsmap epoch " << p->get_epoch();
       }
+
+      rdata.append(ds);
+      ss << "dumped fsmap epoch " << p->get_epoch();
+
       if (p != &fsmap)
        delete p;
     }