]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-fuse: double decreased the count to trim caps 8804/head
authorZhi Zhang <willzzhang@tencent.com>
Thu, 14 Jan 2016 03:04:42 +0000 (11:04 +0800)
committerNathan Cutler <ncutler@suse.com>
Thu, 28 Apr 2016 08:49:45 +0000 (10:49 +0200)
Signed-off-by: Zhi Zhang zhangz.david@outlook.com
(cherry picked from commit d8a3f6d839649243b12cd6f73e6cb8aec1f955c1)

src/client/Client.cc

index 78599fd50997687be48b771a03e2a8481233e43c..717c4d2b4200c7f8d4f271d39a13ea843b710a06 100644 (file)
@@ -3458,11 +3458,13 @@ void Client::_invalidate_kernel_dcache()
 void Client::trim_caps(MetaSession *s, int max)
 {
   mds_rank_t mds = s->mds_num;
-  ldout(cct, 10) << "trim_caps mds." << mds << " max " << max << dendl;
+  int caps_size = s->caps.size();
+  ldout(cct, 10) << "trim_caps mds." << mds << " max " << max 
+    << " caps " << caps_size << dendl;
 
   int trimmed = 0;
   xlist<Cap*>::iterator p = s->caps.begin();
-  while ((s->caps.size() - trimmed) > max && !p.end()) {
+  while ((caps_size - trimmed) > max && !p.end()) {
     Cap *cap = *p;
     s->s_cap_iterator = cap;
     Inode *in = cap->inode;