]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: switch check_caps interface to use flags field
authorSage Weil <sage@newdream.net>
Fri, 10 Apr 2009 20:57:32 +0000 (13:57 -0700)
committerSage Weil <sage@newdream.net>
Fri, 10 Apr 2009 20:57:32 +0000 (13:57 -0700)
src/kernel/caps.c
src/kernel/super.h

index f2666e5e4880b3a882744db1b8f1cf5d301c37f9..74cb2001a70c587fc8b8ea66aa49287ff1e0a961 100644 (file)
@@ -1010,7 +1010,7 @@ static void ceph_flush_snaps(struct ceph_inode_info *ci)
  * @is_delayed indicates caller is delayed work and we should not
  * delay further.
  */
-void ceph_check_caps(struct ceph_inode_info *ci, int is_delayed,
+void ceph_check_caps(struct ceph_inode_info *ci, int flags,
                     struct ceph_mds_session *session)
 {
        struct ceph_client *client = ceph_inode_to_client(&ci->vfs_inode);
@@ -1026,6 +1026,7 @@ void ceph_check_caps(struct ceph_inode_info *ci, int is_delayed,
        struct rb_node *p;
        int tried_invalidate = 0;
        int delayed = 0, sent = 0, force_requeue = 0, num;
+       int is_delayed = flags & CHECK_CAPS_NODELAY;
 
        /* if we are unmounting, flush any unused caps immediately. */
        if (mdsc->stopping)
@@ -2127,7 +2128,8 @@ void ceph_handle_caps(struct ceph_mds_client *mdsc,
                        ceph_msg_get(msg);
                        ceph_send_msg_mds(mdsc, msg, mds);
                } else if (r == 2) {
-                       ceph_check_caps(ceph_inode(inode), 1, session);
+                       ceph_check_caps(ceph_inode(inode), CHECK_CAPS_NODELAY,
+                                       session);
                }
                break;
 
@@ -2150,7 +2152,7 @@ done:
 
        kfree(xattr_data);
        if (check_caps)
-               ceph_check_caps(ceph_inode(inode), 1, NULL);
+               ceph_check_caps(ceph_inode(inode), CHECK_CAPS_NODELAY, NULL);
        if (inode)
                iput(inode);
        return;
@@ -2181,7 +2183,7 @@ void ceph_check_delayed_caps(struct ceph_mds_client *mdsc)
                list_del_init(&ci->i_cap_delay_list);
                spin_unlock(&mdsc->cap_delay_lock);
                dout(10, "check_delayed_caps on %p\n", &ci->vfs_inode);
-               ceph_check_caps(ci, 1, NULL);
+               ceph_check_caps(ci, CHECK_CAPS_NODELAY, NULL);
        }
        spin_unlock(&mdsc->cap_delay_lock);
 }
index fd210b5244af16bacc2ae68bf18f93f01085cb9d..f721b9020b86440acf533c1be95eea9448cd6f0e 100644 (file)
@@ -166,6 +166,9 @@ struct ceph_cap {
        struct list_head caps_item;
 };
 
+#define CHECK_CAPS_NODELAY    1  /* do not delay any further */
+#define CHECK_CAPS_AUTHONLY   2  /* only check auth cap */
+
 /*
  * Snapped cap state that is pending flush to mds.  When a snapshot occurs,
  * we first complete any in-process sync writes and writeback any dirty
@@ -782,7 +785,7 @@ extern void ceph_put_wrbuffer_cap_refs(struct ceph_inode_info *ci, int nr,
                                       struct ceph_snap_context *snapc);
 extern void __ceph_flush_snaps(struct ceph_inode_info *ci,
                               struct ceph_mds_session **psession);
-extern void ceph_check_caps(struct ceph_inode_info *ci, int delayed,
+extern void ceph_check_caps(struct ceph_inode_info *ci, int flags,
                            struct ceph_mds_session *session);
 extern void ceph_check_delayed_caps(struct ceph_mds_client *mdsc);