From 5e679d3ae6e5e3f5af438368baa695d7daab6715 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 7 Jun 2011 11:07:44 -0700 Subject: [PATCH] client: allow caps to be dropped on another inode for requests 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 --- src/client/Client.cc | 4 ++++ src/client/Client.h | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 74d35049b4865..47c5377f6792e 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -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, diff --git a/src/client/Client.h b/src/client/Client.h index ec71b2025b74c..11db91ded17ee 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -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 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), -- 2.39.5