]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
release rd caps on close.
authorsage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Mon, 2 Oct 2006 20:01:38 +0000 (20:01 +0000)
committersage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Mon, 2 Oct 2006 20:01:38 +0000 (20:01 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@888 29311d96-e01e-0410-9327-a35deaab8ce9

ceph/client/Client.cc

index 2f273a4d53c33844ede198c671d21c8ce32d6798..020ee1650bb28027732c8117ca370e91c854167c 100644 (file)
@@ -1023,10 +1023,13 @@ int Client::unmount()
          Inode *in = p->second;
          if (!in->caps.empty()) {
                in->fc.release_clean();
-               if (in->fc.is_dirty())
+               if (in->fc.is_dirty()) {
+                 dout(10) << "unmount residual caps on " << hex << in->ino() << dec << ", flushing" << endl;
                  in->fc.empty(new C_Client_CloseRelease(this, in));
-               else
+               } else {
+                 dout(10) << "unmount residual caps on " << hex << in->ino() << dec  << ", releasing" << endl;
                  release_caps(in);
+               }
          }
        }
   }
@@ -2036,9 +2039,14 @@ int Client::open(const char *relpath, int flags)
 void Client::close_release(Inode *in)
 {
   dout(10) << "close_release on " << hex << in->ino() << dec << endl;
+
+  if (!in->num_open_rd) 
+       in->fc.release_clean();
+
   int retain = 0;
   if (in->num_open_wr || in->fc.is_dirty()) retain |= CAP_FILE_WR | CAP_FILE_WRBUFFER;
-  if (in->num_open_rd || in->fc.is_cached()) retain |= CAP_FILE_RD | CAP_FILE_RDCACHE;
+  if (in->num_open_rd || in->fc.is_cached()) retain |= CAP_FILE_WR | CAP_FILE_WRBUFFER;
+
   release_caps(in, retain);              // release caps now.
 }