summaryrefslogtreecommitdiffstats
path: root/fs/ceph/mds_client.h
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@hq.newdream.net>2010-06-18 01:16:12 +0200
committerSage Weil <sage@newdream.net>2010-08-02 05:11:40 +0200
commit37151668bad3fd058368752bee476f2ba3645596 (patch)
tree6eeae77dfa1c758ff03659b5677f474a72fbe7c0 /fs/ceph/mds_client.h
parentceph: track laggy state of mds from mdsmap (diff)
downloadlinux-37151668bad3fd058368752bee476f2ba3645596.tar.xz
linux-37151668bad3fd058368752bee476f2ba3645596.zip
ceph: do caps accounting per mds_client
Caps related accounting is now being done per mds client instead of just being global. This prepares ground work for a later revision of the caps preallocated reservation list. Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net> Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/mds_client.h')
-rw-r--r--fs/ceph/mds_client.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/fs/ceph/mds_client.h b/fs/ceph/mds_client.h
index e389902db131..8f2126321f2d 100644
--- a/fs/ceph/mds_client.h
+++ b/fs/ceph/mds_client.h
@@ -151,6 +151,7 @@ typedef void (*ceph_mds_request_callback_t) (struct ceph_mds_client *mdsc,
struct ceph_mds_request {
u64 r_tid; /* transaction id */
struct rb_node r_node;
+ struct ceph_mds_client *r_mdsc;
int r_op; /* mds op code */
int r_mds;
@@ -267,6 +268,27 @@ struct ceph_mds_client {
spinlock_t cap_dirty_lock; /* protects above items */
wait_queue_head_t cap_flushing_wq;
+ /*
+ * Cap reservations
+ *
+ * Maintain a global pool of preallocated struct ceph_caps, referenced
+ * by struct ceph_caps_reservations. This ensures that we preallocate
+ * memory needed to successfully process an MDS response. (If an MDS
+ * sends us cap information and we fail to process it, we will have
+ * problems due to the client and MDS being out of sync.)
+ *
+ * Reservations are 'owned' by a ceph_cap_reservation context.
+ */
+ spinlock_t caps_list_lock;
+ struct list_head caps_list; /* unused (reserved or
+ unreserved) */
+ int caps_total_count; /* total caps allocated */
+ int caps_use_count; /* in use */
+ int caps_reserve_count; /* unused, reserved */
+ int caps_avail_count; /* unused, unreserved */
+ int caps_min_count; /* keep at least this many
+ (unreserved) */
+
#ifdef CONFIG_DEBUG_FS
struct dentry *debugfs_file;
#endif