]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: mon_client, kobject cleanups
authorSage Weil <sage@newdream.net>
Wed, 22 Jul 2009 17:02:47 +0000 (10:02 -0700)
committerSage Weil <sage@newdream.net>
Wed, 22 Jul 2009 17:02:47 +0000 (10:02 -0700)
src/kernel/messenger.h
src/kernel/mon_client.c
src/kernel/mon_client.h
src/kernel/super.h

index 7a48fef0eb1ce2a17dbdbcfa40c70385ab24f85e..78b8ea3ccaa3baa813c9da7f99127a81f9077927 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef __FS_CEPH_MESSENGER_H
 #define __FS_CEPH_MESSENGER_H
 
-#include <linux/kobject.h>
 #include <linux/mutex.h>
 #include <linux/net.h>
 #include <linux/radix-tree.h>
index 47732f0c4758d55327607a50d0c57acc60263870..98eb00db5c326d05cb87ccd2ec29df58a66eb994 100644 (file)
  * Interact with Ceph monitor cluster.  Handle requests for new map
  * versions, and periodically resend as needed.  Also implement
  * statfs() and umount().
+ *
+ * A small cluster of Ceph "monitors" are responsible for managing critical
+ * cluster configuration and state information.  An odd number (e.g., 3, 5)
+ * of cmon daemons use a modified version of the Paxos part-time parliament
+ * algorithm to manage the MDS map (mds cluster membership), OSD map, and
+ * list of clients who have mounted the file system.
+ *
+ * Communication with the monitor cluster is lossy, so requests for
+ * information may have to be resent if we time out waiting for a response.
+ * As long as we do not time out, we continue to send all requests to the
+ * same monitor.  If there is a problem, we randomly pick a new monitor from
+ * the cluster to try.
  */
 
 /*
@@ -92,7 +104,7 @@ static int pick_mon(struct ceph_mon_client *monc, int newmon)
 
 /*
  * Generic timeout mechanism for monitor requests, so we can resend if
- * we don't get a timely reply.
+ * we don't get a timely reply.  Exponential backoff.
  */
 static void reschedule_timeout(struct ceph_mon_request *req)
 {
@@ -363,7 +375,6 @@ int ceph_monc_do_statfs(struct ceph_mon_client *monc, struct ceph_statfs *buf)
        req.tid = ++monc->last_tid;
        req.last_attempt = jiffies;
        req.delay = BASE_DELAY_INTERVAL;
-       memset(&req.kobj, 0, sizeof(req.kobj));
        if (radix_tree_insert(&monc->statfs_request_tree, req.tid, &req) < 0) {
                mutex_unlock(&monc->statfs_mutex);
                pr_err("ceph ENOMEM in do_statfs\n");
index fad8e7513192c5d2877f4645004ac6a736e963b1..f7237c2fcd0ebed092e3e6224abf3048aafb2c8f 100644 (file)
@@ -5,20 +5,6 @@
 #include <linux/completion.h>
 #include <linux/radix-tree.h>
 
-/*
- * A small cluster of Ceph "monitors" are responsible for managing critical
- * cluster configuration and state information.  An odd number (e.g., 3, 5)
- * of cmon daemons use a modified version of the Paxos part-time parliament
- * algorithm to manage the MDS map (mds cluster membership), OSD map, and
- * list of clients who have mounted the file system.
- *
- * Communication with the monitor cluster is lossy, so requests for
- * information may have to be resent if we time out waiting for a response.
- * As long as we do not time out, we continue to send all requests to the
- * same monitor.  If there is a problem, we randomly pick a new monitor from
- * the cluster to try.
- */
-
 struct ceph_client;
 struct ceph_mount_args;
 
@@ -41,6 +27,8 @@ struct ceph_mon_statfs_request;
  */
 typedef void (*ceph_monc_request_func_t)(struct ceph_mon_client *monc,
                                         int newmon);
+
+/* a pending monitor request */
 struct ceph_mon_request {
        struct ceph_mon_client *monc;
        struct delayed_work delayed_work;
@@ -48,15 +36,17 @@ struct ceph_mon_request {
        ceph_monc_request_func_t do_request;
 };
 
-/* statfs() is done a bit differently */
+/*
+ * statfs() is done a bit differently because we need to get data back
+ * to the caller
+ */
 struct ceph_mon_statfs_request {
        u64 tid;
-       struct kobject kobj;
        int result;
        struct ceph_statfs *buf;
        struct completion completion;
        unsigned long last_attempt, delay; /* jiffies */
-       struct ceph_msg  *request;  /* original request */
+       struct ceph_msg *request;  /* original request */
 };
 
 struct ceph_mon_client {
@@ -88,9 +78,10 @@ extern int ceph_monc_init(struct ceph_mon_client *monc, struct ceph_client *cl);
 extern void ceph_monc_stop(struct ceph_mon_client *monc);
 
 /*
- * The model here is to indicate that we need a new map of at least epoch
- * @want, and to indicate which maps receive.  Periodically rerequest the map
- * from the monitor cluster until we get what we want.
+ * The model here is to indicate that we need a new map of at least
+ * epoch @want, and also call in when we receive a map.  We will
+ * periodically rerequest the map from the monitor cluster until we
+ * get what we want.
  */
 extern void ceph_monc_request_mdsmap(struct ceph_mon_client *monc, u32 want);
 extern int ceph_monc_got_mdsmap(struct ceph_mon_client *monc, u32 have);
index 9e0014d42a2e595e3dda2b6bfe048998b3b41fdb..3f9e3e59c27071dfd029c9a7a0334ee47a6d07b2 100644 (file)
@@ -109,7 +109,6 @@ static inline unsigned long time_sub(unsigned long a, unsigned long b)
  */
 struct ceph_client {
        u32 whoami;                   /* my client number */
-       struct kobject kobj;
        struct dentry *debugfs_fsid, *debugfs_monmap;
        struct dentry *debugfs_mdsmap, *debugfs_osdmap;
        struct dentry *debugfs_dir, *debugfs_dentry_lru;