]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Client: get rid of variable "butnot" in "client::get_caps" 16231/head
authordongdong <tdd21151186@gmail.com>
Sun, 9 Jul 2017 14:28:03 +0000 (22:28 +0800)
committerdongdong <tdd21151186@gmail.com>
Sun, 9 Jul 2017 14:28:03 +0000 (22:28 +0800)
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 <tdd21151186@gmail.com>
src/client/Client.cc

index d98b5f383457523c7a9e151756e031f742bd9713..6d9346e7b9dc8afaf9e09af743b054d3bf58b6c3 100644 (file)
@@ -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;