]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: kill fugly arg to rdlock_path_pin_ref
authorSage Weil <sage@newdream.net>
Thu, 14 May 2009 23:33:48 +0000 (16:33 -0700)
committerSage Weil <sage@newdream.net>
Thu, 14 May 2009 23:33:48 +0000 (16:33 -0700)
The caller (readdir, in this case) can do it now, since it now does the
acquire_locks() call.

src/mds/Server.cc
src/mds/Server.h

index 0062bf4d43015622cb692f92d09222a0a16d002c..22e1e80e487723b77c56ec131430f91546150aef 100644 (file)
@@ -1458,7 +1458,7 @@ CDir *Server::traverse_to_auth_dir(MDRequest *mdr, vector<CDentry*> &trace, file
 
 CInode* Server::rdlock_path_pin_ref(MDRequest *mdr, int n,
                                    set<SimpleLock*> &rdlocks,
-                                   bool want_auth, bool rdlock_dft)
+                                   bool want_auth)
 {
   MClientRequest *req = mdr->client_request;
   const filepath& refpath = n ? req->get_filepath2() : req->get_filepath();
@@ -1506,8 +1506,6 @@ CInode* Server::rdlock_path_pin_ref(MDRequest *mdr, int n,
 
   for (int i=0; i<(int)mdr->dn[n].size(); i++) 
     rdlocks.insert(&mdr->dn[n][i]->lock);
-  if (rdlock_dft)
-    rdlocks.insert(&ref->dirfragtreelock);
   mds->locker->include_snap_rdlocks(rdlocks, ref);
 
   // set and pin ref
@@ -1988,7 +1986,7 @@ void Server::handle_client_readdir(MDRequest *mdr)
   MClientRequest *req = mdr->client_request;
   int client = req->get_orig_source().num();
   set<SimpleLock*> rdlocks, wrlocks, xlocks;
-  CInode *diri = rdlock_path_pin_ref(mdr, 0, rdlocks, false, true);  // rdlock dirfragtreelock!
+  CInode *diri = rdlock_path_pin_ref(mdr, 0, rdlocks, false);
   if (!diri) return;
 
   // it's a directory, right?
@@ -2000,6 +1998,7 @@ void Server::handle_client_readdir(MDRequest *mdr)
   }
 
   rdlocks.insert(&diri->filelock);
+  rdlocks.insert(&diri->dirfragtreelock);
 
   if (!mds->locker->acquire_locks(mdr, rdlocks, wrlocks, xlocks))
     return;
@@ -2709,7 +2708,7 @@ void Server::handle_client_link(MDRequest *mdr)
 
   CDentry *dn = rdlock_path_xlock_dentry(mdr, 0, rdlocks, wrlocks, xlocks, false, false, false);
   if (!dn) return;
-  CInode *targeti = rdlock_path_pin_ref(mdr, 1, rdlocks, false, false);
+  CInode *targeti = rdlock_path_pin_ref(mdr, 1, rdlocks, false);
   if (!targeti) return;
 
   CDir *dir = dn->get_dir();
index e58fab2458647a6813a1954222dd88c737bd612f..de5161730fe563f85093c26bdc355de13dfcd319 100644 (file)
@@ -109,7 +109,7 @@ public:
   void journal_allocated_inos(MDRequest *mdr, EMetaBlob *blob);
   void apply_allocated_inos(MDRequest *mdr);
 
-  CInode* rdlock_path_pin_ref(MDRequest *mdr, int n, set<SimpleLock*>& rdlocks, bool want_auth, bool rdlock_dft=false);
+  CInode* rdlock_path_pin_ref(MDRequest *mdr, int n, set<SimpleLock*>& rdlocks, bool want_auth);
   CDentry* rdlock_path_xlock_dentry(MDRequest *mdr, int n, set<SimpleLock*>& rdlocks, set<SimpleLock*>& wrlocks, 
                                    set<SimpleLock*>& xlocks, bool okexist, bool mustexist, bool alwaysxlock);