]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: replace WANT cap op with DROP
authorSage Weil <sage@newdream.net>
Thu, 9 Apr 2009 21:09:45 +0000 (14:09 -0700)
committerSage Weil <sage@newdream.net>
Thu, 9 Apr 2009 21:09:45 +0000 (14:09 -0700)
While it's not always clear when we are expanding wanted (bc the
client may have skewed perception of mds_wanted), it IS always
clear when we are explicitly _dropping_ caps and don't want them
reissued to us.  And that's the behavior we're trying to avoid
anyway.

src/include/ceph_fs.h
src/kernel/caps.c
src/mds/Locker.cc

index e57e85b8039146b0af05215d2e5d1c94ceafe4f8..c0efce17d2eb9f5d438d5760e716a24774d31f66 100644 (file)
@@ -1015,7 +1015,7 @@ enum {
        CEPH_CAP_OP_EXPORT,    /* mds has exported the cap */
        CEPH_CAP_OP_IMPORT,    /* mds has imported the cap from specified mds */
        CEPH_CAP_OP_UPDATE,    /* client->mds update */
-       CEPH_CAP_OP_WANT,      /* client->mds wanted update */
+       CEPH_CAP_OP_DROP,      /* client->mds drop cap bits */
        CEPH_CAP_OP_FLUSH_ACK, /* mds->client flushed.  if caps=0, cap also released. */
        CEPH_CAP_OP_FLUSHSNAP, /* client->mds flush snapped metadata */
        CEPH_CAP_OP_FLUSHSNAP_ACK, /* mds->client flushed snapped metadata */
@@ -1032,7 +1032,7 @@ static inline const char *ceph_cap_op_name(int op)
        case CEPH_CAP_OP_EXPORT: return "export";
        case CEPH_CAP_OP_IMPORT: return "import";
        case CEPH_CAP_OP_UPDATE: return "update";
-       case CEPH_CAP_OP_WANT: return "want";
+       case CEPH_CAP_OP_DROP: return "drop";
        case CEPH_CAP_OP_FLUSH_ACK: return "flush_ack";
        case CEPH_CAP_OP_FLUSHSNAP: return "flushsnap";
        case CEPH_CAP_OP_FLUSHSNAP_ACK: return "flushsnap_ack";
index b0f2da8386fa03ba78af7813fede1cca8bee7dd2..3e3612ae76a2b7c8a35787dbd2adab5a585b4c17 100644 (file)
@@ -1186,13 +1186,12 @@ ack:
                }
 
                /* don't update mds wanted on drop */
-               if (drop)
+               if (drop) {
                        want = cap->mds_wanted; 
-
-               if (want & ~cap->mds_wanted)
-                       op = CEPH_CAP_OP_WANT;
-               else
+                       op = CEPH_CAP_OP_DROP;
+               } else {
                        op = CEPH_CAP_OP_UPDATE;
+               }
 
                mds = cap->mds;  /* remember mds, so we don't repeat */
 
index 4fde7efed6e9354726c7b22be72dec09f7578944..14397ef128d156c8ca64659533b367da142a76fc 100644 (file)
@@ -1561,7 +1561,7 @@ void Locker::handle_client_caps(MClientCaps *m)
                   << " (seq " << m->get_seq() << " != last_issue " << cap->get_last_issue() << ")" << dendl;
        }
       }
-      if (m->get_op() == CEPH_CAP_OP_WANT && (wanted & ~cap->pending()))
+      if (m->get_op() != CEPH_CAP_OP_DROP && (wanted & ~cap->pending()))
        do_issue = true;
       
       if (!_do_cap_update(in, cap, m->get_dirty(), m->get_wanted(), follows, m, ack)) {