]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: change "is_delay" parameter in check_caps to "no_delay"
authorJeff Layton <jlayton@redhat.com>
Wed, 9 Nov 2016 14:36:06 +0000 (09:36 -0500)
committerJeff Layton <jlayton@redhat.com>
Wed, 9 Nov 2016 14:36:06 +0000 (09:36 -0500)
Currently, when "is_delay" is true, we send the caps immediately. When
it's false, we delay them. This seems backward to me and is highly
confusing.

Sage says:

"It's definitely confusing.  the call site that motivated the naming is
 the one from tick(), that passes true ... for the delayed flush that
 forces them to be sent but lots of other callers set it to true to avoid
 delaying. It could use a rename/cleanup."

Let's change the name to "no_delay" to indicate that the caller wants
to send caps immediately instead of delaying them.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
src/client/Client.cc
src/client/Client.h

index 8d900d15cfc7997aa80a1b0bd67c820e2f133634..aa9a12d4210d802c996f789cf21a7b2d4ed09728 100644 (file)
@@ -3283,7 +3283,16 @@ void Client::send_cap(Inode *in, MetaSession *session, Cap *cap,
 }
 
 
-void Client::check_caps(Inode *in, bool is_delayed)
+/**
+ * check_caps
+ *
+ * Examine currently used and wanted versus held caps. Release, flush or ack
+ * revoked caps to the MDS as appropriate.
+ *
+ * @param in the inode to check
+ * @param no_delay whether we should delay sending caps
+ */
+void Client::check_caps(Inode *in, bool no_delay)
 {
   unsigned wanted = in->caps_wanted();
   unsigned used = get_caps_used(in);
@@ -3313,7 +3322,7 @@ void Client::check_caps(Inode *in, bool is_delayed)
           << " used " << ccap_string(used)
           << " issued " << ccap_string(issued)
           << " revoking " << ccap_string(revoking)
-          << " is_delayed=" << is_delayed
+          << " no_delay=" << no_delay
           << dendl;
 
   if (in->snapid != CEPH_NOSNAP)
@@ -3329,10 +3338,10 @@ void Client::check_caps(Inode *in, bool is_delayed)
   if (!in->cap_snaps.empty())
     flush_snaps(in);
 
-  if (!is_delayed)
-    cap_delay_requeue(in);
-  else
+  if (no_delay)
     in->hold_caps_until = utime_t();
+  else
+    cap_delay_requeue(in);
 
   utime_t now = ceph_clock_now(cct);
 
index 70f764251bfa485ded85b08d50984da1f2f8841e..736c9fc9b7005d0d7fa354ef417588c5e999d62f 100644 (file)
@@ -651,7 +651,7 @@ protected:
   void send_cap(Inode *in, MetaSession *session, Cap *cap,
                int used, int want, int retain, int flush,
                ceph_tid_t flush_tid);
-  void check_caps(Inode *in, bool is_delayed);
+  void check_caps(Inode *in, bool immediate);
   void get_cap_ref(Inode *in, int cap);
   void put_cap_ref(Inode *in, int cap);
   void flush_snaps(Inode *in, bool all_again=false);