aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/mds_client.h
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2009-12-07 15:31:09 -0500
committerSage Weil <sage@newdream.net>2009-12-07 15:31:09 -0500
commit153c8e6bf7ffee561e046e60b26ef6486c6fc9f2 (patch)
tree7af83c22a7599e011b7802e732fcc6a090fed65e /fs/ceph/mds_client.h
parentb6c1d5b81ea0841ae9d3ce2cda319ab986b081cf (diff)
ceph: use kref for struct ceph_mds_request
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/mds_client.h')
-rw-r--r--fs/ceph/mds_client.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/ceph/mds_client.h b/fs/ceph/mds_client.h
index 9faa1b2f79a7..41af5ca316e6 100644
--- a/fs/ceph/mds_client.h
+++ b/fs/ceph/mds_client.h
@@ -2,6 +2,7 @@
2#define _FS_CEPH_MDS_CLIENT_H 2#define _FS_CEPH_MDS_CLIENT_H
3 3
4#include <linux/completion.h> 4#include <linux/completion.h>
5#include <linux/kref.h>
5#include <linux/list.h> 6#include <linux/list.h>
6#include <linux/mutex.h> 7#include <linux/mutex.h>
7#include <linux/radix-tree.h> 8#include <linux/radix-tree.h>
@@ -203,7 +204,7 @@ struct ceph_mds_request {
203 int r_num_stale; 204 int r_num_stale;
204 int r_resend_mds; /* mds to resend to next, if any*/ 205 int r_resend_mds; /* mds to resend to next, if any*/
205 206
206 atomic_t r_ref; 207 struct kref r_kref;
207 struct list_head r_wait; 208 struct list_head r_wait;
208 struct completion r_completion; 209 struct completion r_completion;
209 struct completion r_safe_completion; 210 struct completion r_safe_completion;
@@ -306,9 +307,13 @@ extern int ceph_mdsc_do_request(struct ceph_mds_client *mdsc,
306 struct ceph_mds_request *req); 307 struct ceph_mds_request *req);
307static inline void ceph_mdsc_get_request(struct ceph_mds_request *req) 308static inline void ceph_mdsc_get_request(struct ceph_mds_request *req)
308{ 309{
309 atomic_inc(&req->r_ref); 310 kref_get(&req->r_kref);
311}
312extern void ceph_mdsc_release_request(struct kref *kref);
313static inline void ceph_mdsc_put_request(struct ceph_mds_request *req)
314{
315 kref_put(&req->r_kref, ceph_mdsc_release_request);
310} 316}
311extern void ceph_mdsc_put_request(struct ceph_mds_request *req);
312 317
313extern void ceph_mdsc_pre_umount(struct ceph_mds_client *mdsc); 318extern void ceph_mdsc_pre_umount(struct ceph_mds_client *mdsc);
314 319