From 88b2246350fcf38de348623ba4b836b1e36887de Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 9 Jun 2011 10:43:13 -0700 Subject: [PATCH] mds: make issue_caps from file_update_finish smarter We do one funky thing in file_update_finish that only issues caps on a single cap when max_size changes. This is more commonly we see. However, if a lock changes state and we need to issue on the whole inode (for all clients), avoid doing the cap-specific issue by checking the issue set. Signed-off-by: Sage Weil --- src/mds/Locker.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index a0370e76b5a60..355185573aa42 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -1269,7 +1269,8 @@ void Locker::file_update_finish(CInode *in, Mutation *mut, bool share, client_t if (ack) mds->send_message_client_counted(ack, client); - drop_locks(mut); + set need_issue; + drop_locks(mut, &need_issue); mut->cleanup(); delete mut; @@ -1293,15 +1294,17 @@ void Locker::file_update_finish(CInode *in, Mutation *mut, bool share, client_t p++; } if (gather) - eval_cap_gather(in); + eval_cap_gather(in, &need_issue); } else { - if (cap && (cap->wanted() & ~cap->pending())) { + if (cap && (cap->wanted() & ~cap->pending()) && + need_issue.count(in) == 0) { // if we won't issue below anyway issue_caps(in, cap); } if (share && in->is_auth() && in->filelock.is_stable()) share_inode_max_size(in); } + issue_caps_set(need_issue); // unlinked stray? may need to purge (e.g., after all caps are released) mdcache->maybe_eval_stray(in); -- 2.39.5