aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/osd_client.h
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2009-12-07 16:37:03 -0500
committerSage Weil <sage@newdream.net>2009-12-07 16:37:03 -0500
commit415e49a9c4faf1a1480b1497da2037608e5aa2c5 (patch)
tree6c376396878b506f46e6cc57e108524916554842 /fs/ceph/osd_client.h
parent153c8e6bf7ffee561e046e60b26ef6486c6fc9f2 (diff)
ceph: use kref for ceph_osd_request
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/osd_client.h')
-rw-r--r--fs/ceph/osd_client.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/ceph/osd_client.h b/fs/ceph/osd_client.h
index 3d4ae6595aaa..20ee61847416 100644
--- a/fs/ceph/osd_client.h
+++ b/fs/ceph/osd_client.h
@@ -2,6 +2,7 @@
2#define _FS_CEPH_OSD_CLIENT_H 2#define _FS_CEPH_OSD_CLIENT_H
3 3
4#include <linux/completion.h> 4#include <linux/completion.h>
5#include <linux/kref.h>
5#include <linux/mempool.h> 6#include <linux/mempool.h>
6#include <linux/rbtree.h> 7#include <linux/rbtree.h>
7 8
@@ -49,7 +50,7 @@ struct ceph_osd_request {
49 int r_prepared_pages, r_got_reply; 50 int r_prepared_pages, r_got_reply;
50 51
51 struct ceph_osd_client *r_osdc; 52 struct ceph_osd_client *r_osdc;
52 atomic_t r_ref; 53 struct kref r_kref;
53 bool r_mempool; 54 bool r_mempool;
54 struct completion r_completion, r_safe_completion; 55 struct completion r_completion, r_safe_completion;
55 ceph_osdc_callback_t r_callback, r_safe_callback; 56 ceph_osdc_callback_t r_callback, r_safe_callback;
@@ -118,9 +119,13 @@ extern struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *,
118 119
119static inline void ceph_osdc_get_request(struct ceph_osd_request *req) 120static inline void ceph_osdc_get_request(struct ceph_osd_request *req)
120{ 121{
121 atomic_inc(&req->r_ref); 122 kref_get(&req->r_kref);
123}
124extern void ceph_osdc_release_request(struct kref *kref);
125static inline void ceph_osdc_put_request(struct ceph_osd_request *req)
126{
127 kref_put(&req->r_kref, ceph_osdc_release_request);
122} 128}
123extern void ceph_osdc_put_request(struct ceph_osd_request *req);
124 129
125extern int ceph_osdc_start_request(struct ceph_osd_client *osdc, 130extern int ceph_osdc_start_request(struct ceph_osd_client *osdc,
126 struct ceph_osd_request *req, 131 struct ceph_osd_request *req,