aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/osd_client.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ceph/osd_client.h')
-rw-r--r--fs/ceph/osd_client.h61
1 files changed, 48 insertions, 13 deletions
diff --git a/fs/ceph/osd_client.h b/fs/ceph/osd_client.h
index b687c2ea72e6..d583d1bf6cd9 100644
--- a/fs/ceph/osd_client.h
+++ b/fs/ceph/osd_client.h
@@ -15,6 +15,7 @@ struct ceph_snap_context;
15struct ceph_osd_request; 15struct ceph_osd_request;
16struct ceph_osd_client; 16struct ceph_osd_client;
17struct ceph_authorizer; 17struct ceph_authorizer;
18struct ceph_pagelist;
18 19
19/* 20/*
20 * completion callback for async writepages 21 * completion callback for async writepages
@@ -80,6 +81,11 @@ struct ceph_osd_request {
80 struct page **r_pages; /* pages for data payload */ 81 struct page **r_pages; /* pages for data payload */
81 int r_pages_from_pool; 82 int r_pages_from_pool;
82 int r_own_pages; /* if true, i own page list */ 83 int r_own_pages; /* if true, i own page list */
84#ifdef CONFIG_BLOCK
85 struct bio *r_bio; /* instead of pages */
86#endif
87
88 struct ceph_pagelist *r_trail; /* trailing part of the data */
83}; 89};
84 90
85struct ceph_osd_client { 91struct ceph_osd_client {
@@ -110,6 +116,36 @@ struct ceph_osd_client {
110 struct ceph_msgpool msgpool_op_reply; 116 struct ceph_msgpool msgpool_op_reply;
111}; 117};
112 118
119struct ceph_osd_req_op {
120 u16 op; /* CEPH_OSD_OP_* */
121 u32 flags; /* CEPH_OSD_FLAG_* */
122 union {
123 struct {
124 u64 offset, length;
125 u64 truncate_size;
126 u32 truncate_seq;
127 } extent;
128 struct {
129 const char *name;
130 u32 name_len;
131 const char *val;
132 u32 value_len;
133 __u8 cmp_op; /* CEPH_OSD_CMPXATTR_OP_* */
134 __u8 cmp_mode; /* CEPH_OSD_CMPXATTR_MODE_* */
135 } xattr;
136 struct {
137 __u8 class_len;
138 __u8 method_len;
139 __u8 argc;
140 u32 indata_len;
141 } cls;
142 struct {
143 u64 cookie, count;
144 } pgls;
145 };
146 u32 payload_len;
147};
148
113extern int ceph_osdc_init(struct ceph_osd_client *osdc, 149extern int ceph_osdc_init(struct ceph_osd_client *osdc,
114 struct ceph_client *client); 150 struct ceph_client *client);
115extern void ceph_osdc_stop(struct ceph_osd_client *osdc); 151extern void ceph_osdc_stop(struct ceph_osd_client *osdc);
@@ -122,27 +158,26 @@ extern void ceph_osdc_handle_map(struct ceph_osd_client *osdc,
122extern void ceph_calc_raw_layout(struct ceph_osd_client *osdc, 158extern void ceph_calc_raw_layout(struct ceph_osd_client *osdc,
123 struct ceph_file_layout *layout, 159 struct ceph_file_layout *layout,
124 u64 snapid, 160 u64 snapid,
125 u64 off, u64 len, u64 *bno, 161 u64 off, u64 *plen, u64 *bno,
126 struct ceph_osd_request *req); 162 struct ceph_osd_request *req,
163 struct ceph_osd_req_op *op);
127 164
128extern struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc, 165extern struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc,
129 int flags, 166 int flags,
130 struct ceph_snap_context *snapc, 167 struct ceph_snap_context *snapc,
131 int do_sync, 168 struct ceph_osd_req_op *ops,
132 bool use_mempool, 169 bool use_mempool,
133 gfp_t gfp_flags, 170 gfp_t gfp_flags,
134 struct page **pages); 171 struct page **pages,
172 struct bio *bio);
135 173
136extern void ceph_osdc_build_request(struct ceph_osd_request *req, 174extern void ceph_osdc_build_request(struct ceph_osd_request *req,
137 u64 off, u64 *plen, 175 u64 off, u64 *plen,
138 int opcode, 176 struct ceph_osd_req_op *src_ops,
139 struct ceph_snap_context *snapc, 177 struct ceph_snap_context *snapc,
140 int do_sync, 178 struct timespec *mtime,
141 u32 truncate_seq, 179 const char *oid,
142 u64 truncate_size, 180 int oid_len);
143 struct timespec *mtime,
144 const char *oid,
145 int oid_len);
146 181
147extern struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *, 182extern struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *,
148 struct ceph_file_layout *layout, 183 struct ceph_file_layout *layout,