From: Yan, Zheng Date: Fri, 12 Apr 2013 08:11:09 +0000 (+0800) Subject: mds: pass proper mask to CInode::get_caps_issued X-Git-Tag: v0.61~184 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=efe7399749cab545d3b9c2205076b2d632da4b9d;p=ceph.git mds: pass proper mask to CInode::get_caps_issued There is a total of 22 cap bits and file lock uses 8 cap bits. Signed-off-by: Yan, Zheng Reviewed-by: Greg Farnum --- diff --git a/src/mds/CInode.h b/src/mds/CInode.h index 43af9c4d5940..a3fe3cf62884 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 eab7ed686bc1..967bbab07973 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -608,7 +608,8 @@ void Locker::eval_gather(SimpleLock *lock, bool first, bool *pneed_issue, listis_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))