]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: drop cap renewal
authorSage Weil <sage@newdream.net>
Mon, 30 Mar 2009 18:03:37 +0000 (11:03 -0700)
committerSage Weil <sage@newdream.net>
Mon, 30 Mar 2009 18:03:37 +0000 (11:03 -0700)
src/TODO
src/kernel/caps.c
src/kernel/dir.c

index 5f50c7e52ff93ab810fc730ed3d4c90eeb6b1d3a..199f8286600f76b8ba8f7382e09b898f3a7a600c 100644 (file)
--- a/src/TODO
+++ b/src/TODO
@@ -64,7 +64,7 @@ alternative #1:
 
 alternative #2:
 - make clean_caps an lru
-- touch caps on revalidate
+- touch caps on revalidate, getattr, etc.
   - that should avoid releasing caps just prior to getattr
 - maybe still pin cap inodes for now.
   - eventually avoid it, using the release on destroy_inode strategy above
index 90e411bdbbce8f08b3cfe5132f1f0d28bec9b5cd..f263f61bef1f48cc022a747c30bfefe68435e5bc 100644 (file)
@@ -1545,33 +1545,6 @@ start:
        return reply;
 }
 
-/*
- * Handle a cap renewal from the MDS.  This is only useful on
- * rdcap (readonly, expireable) caps.
- */
-static void handle_cap_renew(struct inode *inode,
-                            struct ceph_mds_caps *m,
-                            struct ceph_mds_session *session,
-                            struct ceph_cap *cap)
-       __releases(inode->i_lock)
-{
-       struct ceph_inode_info *ci = ceph_inode(inode);
-
-       if (cap->renew_from && cap->renew_after == 0) {
-               unsigned duration = le32_to_cpu(m->ttl_ms) * HZ / 1000;
-
-               cap->expires = cap->renew_from + duration;
-               cap->renew_after = cap->renew_from + (duration >> 1);
-               cap->renew_from = 0;
-               dout(20, "cap_renew %p %p duration %u\n", inode, cap, duration);
-               __adjust_cap_rdcaps_listing(ci, cap, __ceph_caps_wanted(ci));
-       } else {
-               dout(20, "cap_renew %p %p not renewing (after=%lu from=%lu)\n",
-                    inode, cap, cap->renew_after, cap->renew_from);
-       }
-       spin_unlock(&inode->i_lock);
-}
-
 /*
  * Handle FLUSH_ACK from MDS, indicating that metadata we sent to the
  * MDS has been safely recorded.
@@ -1893,10 +1866,6 @@ void ceph_handle_caps(struct ceph_mds_client *mdsc,
                }
                break;
 
-       case CEPH_CAP_OP_RENEW:
-               handle_cap_renew(inode, h, session, cap);
-               break;
-
        case CEPH_CAP_OP_FLUSH_ACK:
                handle_cap_flush_ack(inode, h, session, cap);
                if (list_empty(&session->s_caps))
index b26d98ab469bb918316397fa2b03652117225ecd..029682e4f651effddc8e923b91f8c24a3ce804cc 100644 (file)
@@ -655,11 +655,9 @@ static int dir_lease_is_valid(struct inode *dir, struct dentry *dentry)
        int valid = 0;
 
        spin_lock(&dir->i_lock);
-       if (ceph_ino(dir) != CEPH_INO_ROOT &&
-           ci->i_version == dentry->d_time)
-               valid = __ceph_check_cap_maybe_renew(ci, CEPH_CAP_FILE_RDCACHE);
-       else
-               spin_unlock(&dir->i_lock);
+       if (ceph_ino(dir) != CEPH_INO_ROOT && ci->i_version == dentry->d_time)
+               valid = __ceph_caps_issued(ci, NULL) & CEPH_CAP_FILE_RDCACHE;
+       spin_unlock(&dir->i_lock);
        dout(20, "dir_lease_is_valid dir %p v%llu dentry %p v%lu = %d\n",
             dir, ci->i_version, dentry, dentry->d_time, valid);
        return valid;