aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/super.h
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2010-02-17 13:02:43 -0500
committerSage Weil <sage@newdream.net>2010-02-17 13:02:43 -0500
commit85ccce43a3fc15a40ded6ae1603e3f68a17f4d24 (patch)
tree1e15fb7dc7df43da4a3feacff671c8169e96291d /fs/ceph/super.h
parent5ce6e9dbe6805ab8ee67e21936d17f431adc63c6 (diff)
ceph: clean up readdir caps reservation
Use a global counter for the minimum number of allocated caps instead of hard coding a check against readdir_max. This takes into account multiple client instances, and avoids examining the superblock mount options when a cap is dropped. Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/super.h')
-rw-r--r--fs/ceph/super.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index 1f3928785e12..3b5faf9980f8 100644
--- a/fs/ceph/super.h
+++ b/fs/ceph/super.h
@@ -129,6 +129,8 @@ struct ceph_client {
129 129
130 int auth_err; 130 int auth_err;
131 131
132 int min_caps; /* min caps i added */
133
132 struct ceph_messenger *msgr; /* messenger instance */ 134 struct ceph_messenger *msgr; /* messenger instance */
133 struct ceph_mon_client monc; 135 struct ceph_mon_client monc;
134 struct ceph_mds_client mdsc; 136 struct ceph_mds_client mdsc;
@@ -557,11 +559,12 @@ extern int __ceph_caps_mds_wanted(struct ceph_inode_info *ci);
557 559
558extern void ceph_caps_init(void); 560extern void ceph_caps_init(void);
559extern void ceph_caps_finalize(void); 561extern void ceph_caps_finalize(void);
562extern void ceph_adjust_min_caps(int delta);
560extern int ceph_reserve_caps(struct ceph_cap_reservation *ctx, int need); 563extern int ceph_reserve_caps(struct ceph_cap_reservation *ctx, int need);
561extern int ceph_unreserve_caps(struct ceph_cap_reservation *ctx); 564extern int ceph_unreserve_caps(struct ceph_cap_reservation *ctx);
562extern void ceph_reservation_status(struct ceph_client *client, 565extern void ceph_reservation_status(struct ceph_client *client,
563 int *total, int *avail, int *used, 566 int *total, int *avail, int *used,
564 int *reserved); 567 int *reserved, int *min);
565 568
566static inline struct ceph_client *ceph_inode_to_client(struct inode *inode) 569static inline struct ceph_client *ceph_inode_to_client(struct inode *inode)
567{ 570{