From 5d43e278a3fed23c749d6657b679b0c1415641ca Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 14 May 2009 16:33:48 -0700 Subject: [PATCH] mds: kill fugly arg to rdlock_path_pin_ref The caller (readdir, in this case) can do it now, since it now does the acquire_locks() call. --- src/mds/Server.cc | 9 ++++----- src/mds/Server.h | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 0062bf4d43015..22e1e80e48772 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -1458,7 +1458,7 @@ CDir *Server::traverse_to_auth_dir(MDRequest *mdr, vector &trace, file CInode* Server::rdlock_path_pin_ref(MDRequest *mdr, int n, set &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 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(); diff --git a/src/mds/Server.h b/src/mds/Server.h index e58fab2458647..de5161730fe56 100644 --- a/src/mds/Server.h +++ b/src/mds/Server.h @@ -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& rdlocks, bool want_auth, bool rdlock_dft=false); + CInode* rdlock_path_pin_ref(MDRequest *mdr, int n, set& rdlocks, bool want_auth); CDentry* rdlock_path_xlock_dentry(MDRequest *mdr, int n, set& rdlocks, set& wrlocks, set& xlocks, bool okexist, bool mustexist, bool alwaysxlock); -- 2.39.5