]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: use unsigned trim_caps count 17652/head
authorPatrick Donnelly <pdonnell@redhat.com>
Mon, 11 Sep 2017 19:08:13 +0000 (12:08 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Mon, 11 Sep 2017 19:14:22 +0000 (12:14 -0700)
Resolves gcc warning:

    /home/pdonnell/ceph/src/client/Client.cc: In member function ‘void Client::trim_caps(MetaSession*, int)’:
    /home/pdonnell/ceph/src/client/Client.cc:4120:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if (s->caps.size() > max)
                          ^

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/client/Client.cc
src/client/Client.h

index 15dfe2787869aaef6d522086410dbbeb2d9f7392..4e7002351c4bd207b8fb81c74672109d6d14d468 100644 (file)
@@ -4064,14 +4064,14 @@ void Client::_invalidate_kernel_dcache()
   }
 }
 
-void Client::trim_caps(MetaSession *s, int max)
+void Client::trim_caps(MetaSession *s, uint64_t max)
 {
   mds_rank_t mds = s->mds_num;
-  int caps_size = s->caps.size();
+  uint64_t caps_size = s->caps.size();
   ldout(cct, 10) << "trim_caps mds." << mds << " max " << max 
     << " caps " << caps_size << dendl;
 
-  int trimmed = 0;
+  uint64_t trimmed = 0;
   xlist<Cap*>::iterator p = s->caps.begin();
   while ((caps_size - trimmed) > max && !p.end()) {
     Cap *cap = *p;
index cb940a61b48370135025739bed48329179070dd5..714551d445313c170429b5d2e0d162615a907211 100644 (file)
@@ -534,7 +534,7 @@ protected:
   void trim_cache(bool trim_kernel_dcache=false);
   void trim_cache_for_reconnect(MetaSession *s);
   void trim_dentry(Dentry *dn);
-  void trim_caps(MetaSession *s, int max);
+  void trim_caps(MetaSession *s, uint64_t max);
   void _invalidate_kernel_dcache();
   
   void dump_inode(Formatter *f, Inode *in, set<Inode*>& did, bool disconnected);