From 17a86ef54ae02342ca6bc3da70a7efd399fb53a1 Mon Sep 17 00:00:00 2001 From: dongdong Date: Sun, 9 Jul 2017 22:28:03 +0800 Subject: [PATCH] Client: get rid of variable "butnot" in "client::get_caps" MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix: the result of if condition 'revoking & butnot’ will be always same with ‘revoking & want’ no need to introduce an extra variable. Signed-off-by: dongdong tao --- src/client/Client.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index d98b5f383457..6d9346e7b9dc 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -3178,13 +3178,12 @@ int Client::get_caps(Inode *in, int need, int want, int *phave, loff_t endoff) if (!waitfor_caps && !waitfor_commit) { if ((have & need) == need) { - int butnot = want & ~(have & need); int revoking = implemented & ~have; ldout(cct, 10) << "get_caps " << *in << " have " << ccap_string(have) << " need " << ccap_string(need) << " want " << ccap_string(want) - << " but not " << ccap_string(butnot) << " revoking " << ccap_string(revoking) + << " revoking " << ccap_string(revoking) << dendl; - if ((revoking & butnot) == 0) { + if ((revoking & want) == 0) { *phave = need | (have & want); in->get_cap_ref(need); return 0; -- 2.47.3