]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: allow caps to be dropped on another inode for requests
authorSage Weil <sage.weil@dreamhost.com>
Tue, 7 Jun 2011 18:07:44 +0000 (11:07 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Tue, 7 Jun 2011 18:07:44 +0000 (11:07 -0700)
We need the ability to drop caps on another inode that isn't req->inode
or req->old_inode in the request struct.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/client/Client.cc
src/client/Client.h

index 74d35049b486526f58eb97f79fb66ec89d8f2dc8..47c5377f6792e13349eac25faeac648603333136 100644 (file)
@@ -1154,6 +1154,10 @@ void Client::encode_cap_releases(MetaRequest *req, int mds) {
     encode_inode_release(req->old_inode, req,
                         mds, req->old_inode_drop,
                         req->old_inode_unless);
+  if (req->other_inode_drop && req->other_inode)
+    encode_inode_release(req->other_inode, req,
+                        mds, req->other_inode_drop,
+                        req->other_inode_unless);
   
   if (req->dentry_drop && req->dentry)
     encode_dentry_release(req->dentry, req,
index ec71b2025b74ca7297dbb44a9124e762a12b0bc6..11db91ded17ee2b7d7be0484492e34b96fbdaa7a 100644 (file)
@@ -114,9 +114,10 @@ struct MetaRequest {
   int old_inode_drop, old_inode_unless;
   int dentry_drop, dentry_unless;
   int old_dentry_drop, old_dentry_unless;
+  int other_inode_drop, other_inode_unless;
   vector<MClientRequest::Release> cap_releases;
   Inode *inode;
-  Inode *old_inode;
+  Inode *old_inode, *other_inode;
   Dentry *dentry; //associated with path
   Dentry *old_dentry; //associated with path2
 
@@ -161,7 +162,8 @@ struct MetaRequest {
     old_inode_drop(0), old_inode_unless(0),
     dentry_drop(0), dentry_unless(0),
     old_dentry_drop(0), old_dentry_unless(0),
-    inode(NULL), old_inode(NULL),
+    other_inode_drop(0), other_inode_unless(0),
+    inode(NULL), old_inode(NULL), other_inode(NULL),
     dentry(NULL), old_dentry(NULL),
     mds(-1), resend_mds(-1), send_to_auth(false), sent_on_mseq(0),
     num_fwd(0), retry_attempt(0),