[PATCH 1/2] mds: pass proper mask to CInode::get_caps_issued

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Yan, Zheng" <zheng.z.yan@xxxxxxxxx>

There is a total of 22 cap bits and file lock uses 8 cap bits.

Signed-off-by: Yan, Zheng <zheng.z.yan@xxxxxxxxx>
---
 src/mds/CInode.h  | 4 ++--
 src/mds/Locker.cc | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/mds/CInode.h b/src/mds/CInode.h
index 43af9c4..a3fe3cf 100644
--- a/src/mds/CInode.h
+++ b/src/mds/CInode.h
@@ -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();
 
diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc
index 7ba9f44..f86ba88 100644
--- a/src/mds/Locker.cc
+++ b/src/mds/Locker.cc
@@ -616,7 +616,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))
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux