]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds: define lease mask bits
authorYan, Zheng <zyan@redhat.com>
Mon, 30 Sep 2019 06:20:18 +0000 (14:20 +0800)
committerYan, Zheng <zyan@redhat.com>
Thu, 12 Dec 2019 18:04:13 +0000 (02:04 +0800)
later patch will introduce new mask bits

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
src/client/Client.cc
src/include/ceph_fs.h
src/mds/Locker.cc
src/mds/Server.cc

index e042539c3b52edee6cfdd0ee3c2b4c250351f97f..feaf2696f7aa8395d3d5b09d35a5a4b0fa2ce82d 100644 (file)
@@ -1004,7 +1004,7 @@ void Client::update_dentry_lease(Dentry *dn, LeaseStat *dlease, utime_t from, Me
   
   ceph_assert(dn);
 
-  if (dlease->mask & CEPH_LOCK_DN) {
+  if (dlease->mask & CEPH_LEASE_VALID) {
     if (dttl > dn->lease_ttl) {
       ldout(cct, 10) << "got dentry lease on " << dn->name
               << " dur " << dlease->duration_ms << "ms ttl " << dttl << dendl;
@@ -2991,7 +2991,7 @@ void Client::handle_lease(const MConstRef<MClientLease>& m)
   }
   in = inode_map[vino];
 
-  if (m->get_mask() & CEPH_LOCK_DN) {
+  if (m->get_mask() & CEPH_LEASE_VALID) {
     if (!in->dir || in->dir->dentries.count(m->dname) == 0) {
       ldout(cct, 10) << " don't have dir|dentry " << m->get_ino() << "/" << m->dname <<dendl;
       goto revoke;
index 4dd8b97413c3cfec432dd4e14c95c81ffb667f38..a05ea4756d8f8fb25b4f2383c93921b2a8652837 100644 (file)
@@ -693,6 +693,8 @@ struct ceph_mds_reply_lease {
        __le32 seq;
 } __attribute__ ((packed));
 
+#define CEPH_LEASE_VALID       (1 | 2) /* old and new bit values */
+
 struct ceph_mds_reply_dirfrag {
        __le32 frag;            /* fragment */
        __le32 auth;            /* auth mds, if this is a delegation point */
index 6d810fffc024adda65c03f3f784e4ee9893ebddd..a8d595528363402ff4d553f6a8fe715bcd270241 100644 (file)
@@ -4130,7 +4130,7 @@ void Locker::issue_client_lease(CDentry *dn, client_t client,
     mdcache->touch_client_lease(l, pool, now);
 
     LeaseStat lstat;
-    lstat.mask = 1 | CEPH_LOCK_DN;  // old and new bit values
+    lstat.mask = CEPH_LEASE_VALID;
     lstat.duration_ms = (uint32_t)(1000 * mdcache->client_lease_durations[pool]);
     lstat.seq = ++l->seq;
     encode_lease(bl, session->info, lstat);
index 623e7ee6269ce23a8ecdda0fdf90ba8f0fecd895..71b1672f301675ac7bf2941ae760dd648438730c 100644 (file)
@@ -9577,7 +9577,7 @@ void Server::handle_client_lssnap(MDRequestRef& mdr)
 
     encode(snap_name, dnbl);
     //infinite lease
-    LeaseStat e(-1, -1, 0);
+    LeaseStat e(CEPH_LEASE_VALID, -1, 0);
     mds->locker->encode_lease(dnbl, mdr->session->info, e);
     dout(20) << "encode_infinite_lease" << dendl;