]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: pass proper mask to CInode::get_caps_issued
authorYan, Zheng <zheng.z.yan@intel.com>
Fri, 12 Apr 2013 08:11:09 +0000 (16:11 +0800)
committerGreg Farnum <greg@inktank.com>
Wed, 17 Apr 2013 21:39:22 +0000 (14:39 -0700)
There is a total of 22 cap bits and file lock uses 8 cap bits.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
src/mds/CInode.h
src/mds/Locker.cc

index 43af9c4d59406f4f27a86af2e8f647043c5cb0ae..a3fe3cf628846c4dcdea4c9758d515dd7d0cc04c 100644 (file)
@@ -736,9 +736,9 @@ public:
 
   // caps issued, wanted
   int get_caps_issued(int *ploner = 0, int *pother = 0, int *pxlocker = 0,
-                     int shift = 0, int mask = 0xffff);
+                     int shift = 0, int mask = -1);
   bool is_any_caps_wanted();
-  int get_caps_wanted(int *ploner = 0, int *pother = 0, int shift = 0, int mask = 0xffff);
+  int get_caps_wanted(int *ploner = 0, int *pother = 0, int shift = 0, int mask = -1);
   bool issued_caps_need_gather(SimpleLock *lock);
   void replicate_relax_locks();
 
index eab7ed686bc1cef3ab1844cd51236bee62af80bd..967bbab079736af059ca2cecef13c98854a198ff 100644 (file)
@@ -608,7 +608,8 @@ void Locker::eval_gather(SimpleLock *lock, bool first, bool *pneed_issue, list<C
 
   int loner_issued = 0, other_issued = 0, xlocker_issued = 0;
   if (caps && in->is_head()) {
-    in->get_caps_issued(&loner_issued, &other_issued, &xlocker_issued, lock->get_cap_shift(), 3);
+    in->get_caps_issued(&loner_issued, &other_issued, &xlocker_issued,
+                       lock->get_cap_shift(), lock->get_cap_mask());
     dout(10) << " next state is " << lock->get_state_name(next) 
             << " issued/allows loner " << gcap_string(loner_issued)
             << "/" << gcap_string(lock->gcaps_allowed(CAP_LONER, next))