diff options
author | Martin Brandenburg <martin@omnibond.com> | 2015-11-13 14:26:09 -0500 |
---|---|---|
committer | Mike Marshall <hubcap@omnibond.com> | 2015-11-13 14:43:11 -0500 |
commit | f0ed4418d46db587eca981065ef5014332678606 (patch) | |
tree | 65437d6301c6d0dd9a69e39e113f71e3a8c03f5b | |
parent | b5bbc84328556bb653412b8e9682b8fdb091866a (diff) |
Orangefs: Remove upcall trailers which are not used.
Also removes remnants of iox (readx/writex) which previously used
trailers, but no longer exist.
Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
-rw-r--r-- | fs/orangefs/devpvfs2-req.c | 117 | ||||
-rw-r--r-- | fs/orangefs/downcall.h | 5 | ||||
-rw-r--r-- | fs/orangefs/pvfs2-cache.c | 16 | ||||
-rw-r--r-- | fs/orangefs/pvfs2-dev-proto.h | 1 | ||||
-rw-r--r-- | fs/orangefs/pvfs2-kernel.h | 14 | ||||
-rw-r--r-- | fs/orangefs/upcall.h | 11 |
6 files changed, 36 insertions, 128 deletions
diff --git a/fs/orangefs/devpvfs2-req.c b/fs/orangefs/devpvfs2-req.c index dbf52ab1e569..34e2240f1d29 100644 --- a/fs/orangefs/devpvfs2-req.c +++ b/fs/orangefs/devpvfs2-req.c | |||
@@ -139,20 +139,6 @@ static ssize_t pvfs2_devreq_read(struct file *file, | |||
139 | cur_op = op; | 139 | cur_op = op; |
140 | spin_lock(&cur_op->lock); | 140 | spin_lock(&cur_op->lock); |
141 | list_del(&cur_op->list); | 141 | list_del(&cur_op->list); |
142 | cur_op->op_linger_tmp--; | ||
143 | /* | ||
144 | * if there is a trailer, re-add it to | ||
145 | * the request list. | ||
146 | */ | ||
147 | if (cur_op->op_linger == 2 && | ||
148 | cur_op->op_linger_tmp == 1) { | ||
149 | if (cur_op->upcall.trailer_size <= 0 || | ||
150 | cur_op->upcall.trailer_buf == NULL) | ||
151 | gossip_err("BUG:trailer_size is %ld and trailer buf is %p\n", (long)cur_op->upcall.trailer_size, cur_op->upcall.trailer_buf); | ||
152 | /* re-add it to the head of the list */ | ||
153 | list_add(&cur_op->list, | ||
154 | &pvfs2_request_list); | ||
155 | } | ||
156 | spin_unlock(&cur_op->lock); | 142 | spin_unlock(&cur_op->lock); |
157 | break; | 143 | break; |
158 | } | 144 | } |
@@ -167,11 +153,8 @@ static ssize_t pvfs2_devreq_read(struct file *file, | |||
167 | "client-core: reading op tag %llu %s\n", | 153 | "client-core: reading op tag %llu %s\n", |
168 | llu(cur_op->tag), get_opname_string(cur_op)); | 154 | llu(cur_op->tag), get_opname_string(cur_op)); |
169 | if (op_state_in_progress(cur_op) || op_state_serviced(cur_op)) { | 155 | if (op_state_in_progress(cur_op) || op_state_serviced(cur_op)) { |
170 | if (cur_op->op_linger == 1) | 156 | gossip_err("WARNING: Current op already queued...skipping\n"); |
171 | gossip_err("WARNING: Current op already queued...skipping\n"); | 157 | } else { |
172 | } else if (cur_op->op_linger == 1 || | ||
173 | (cur_op->op_linger == 2 && | ||
174 | cur_op->op_linger_tmp == 0)) { | ||
175 | /* | 158 | /* |
176 | * atomically move the operation to the | 159 | * atomically move the operation to the |
177 | * htable_ops_in_progress | 160 | * htable_ops_in_progress |
@@ -182,71 +165,40 @@ static ssize_t pvfs2_devreq_read(struct file *file, | |||
182 | 165 | ||
183 | spin_unlock(&cur_op->lock); | 166 | spin_unlock(&cur_op->lock); |
184 | 167 | ||
185 | /* 2 cases | 168 | /* Push the upcall out */ |
186 | * a) OPs with no trailers | 169 | len = MAX_ALIGNED_DEV_REQ_UPSIZE; |
187 | * b) OPs with trailers, Stage 1 | 170 | if ((size_t) len <= count) { |
188 | * Either way push the upcall out | 171 | ret = copy_to_user(buf, |
189 | */ | 172 | &proto_ver, |
190 | if (cur_op->op_linger == 1 || | 173 | sizeof(__s32)); |
191 | (cur_op->op_linger == 2 && cur_op->op_linger_tmp == 1)) { | 174 | if (ret == 0) { |
192 | len = MAX_ALIGNED_DEV_REQ_UPSIZE; | 175 | ret = copy_to_user(buf + sizeof(__s32), |
193 | if ((size_t) len <= count) { | 176 | &magic, |
194 | ret = copy_to_user(buf, | 177 | sizeof(__s32)); |
195 | &proto_ver, | 178 | if (ret == 0) { |
196 | sizeof(__s32)); | 179 | ret = copy_to_user(buf+2 * sizeof(__s32), |
180 | &cur_op->tag, | ||
181 | sizeof(__u64)); | ||
197 | if (ret == 0) { | 182 | if (ret == 0) { |
198 | ret = copy_to_user(buf + sizeof(__s32), | 183 | ret = copy_to_user( |
199 | &magic, | 184 | buf + |
200 | sizeof(__s32)); | 185 | 2 * |
201 | if (ret == 0) { | 186 | sizeof(__s32) + |
202 | ret = copy_to_user(buf+2 * sizeof(__s32), | 187 | sizeof(__u64), |
203 | &cur_op->tag, | 188 | &cur_op->upcall, |
204 | sizeof(__u64)); | 189 | sizeof(struct pvfs2_upcall_s)); |
205 | if (ret == 0) { | ||
206 | ret = copy_to_user( | ||
207 | buf + | ||
208 | 2 * | ||
209 | sizeof(__s32) + | ||
210 | sizeof(__u64), | ||
211 | &cur_op->upcall, | ||
212 | sizeof(struct pvfs2_upcall_s)); | ||
213 | } | ||
214 | } | ||
215 | } | ||
216 | |||
217 | if (ret) { | ||
218 | gossip_err("Failed to copy data to user space\n"); | ||
219 | len = -EFAULT; | ||
220 | } | 190 | } |
221 | } else { | ||
222 | gossip_err | ||
223 | ("Failed to copy data to user space\n"); | ||
224 | len = -EIO; | ||
225 | } | ||
226 | } | ||
227 | /* Stage 2: Push the trailer out */ | ||
228 | else if (cur_op->op_linger == 2 && cur_op->op_linger_tmp == 0) { | ||
229 | len = cur_op->upcall.trailer_size; | ||
230 | if ((size_t) len <= count) { | ||
231 | ret = copy_to_user(buf, | ||
232 | cur_op->upcall.trailer_buf, | ||
233 | len); | ||
234 | if (ret) { | ||
235 | gossip_err("Failed to copy trailer to user space\n"); | ||
236 | len = -EFAULT; | ||
237 | } | ||
238 | } else { | ||
239 | gossip_err("Read buffer for trailer is too small (%ld as opposed to %ld)\n", | ||
240 | (long)count, | ||
241 | (long)len); | ||
242 | len = -EIO; | ||
243 | } | 191 | } |
192 | } | ||
193 | |||
194 | if (ret) { | ||
195 | gossip_err("Failed to copy data to user space\n"); | ||
196 | len = -EFAULT; | ||
197 | } | ||
244 | } else { | 198 | } else { |
245 | gossip_err("cur_op: %p (op_linger %d), (op_linger_tmp %d), erroneous request list?\n", | 199 | gossip_err |
246 | cur_op, | 200 | ("Failed to copy data to user space\n"); |
247 | cur_op->op_linger, | 201 | len = -EIO; |
248 | cur_op->op_linger_tmp); | ||
249 | len = 0; | ||
250 | } | 202 | } |
251 | } else if (file->f_flags & O_NONBLOCK) { | 203 | } else if (file->f_flags & O_NONBLOCK) { |
252 | /* | 204 | /* |
@@ -413,9 +365,8 @@ static ssize_t pvfs2_devreq_writev(struct file *file, | |||
413 | * application reading/writing this device to return until | 365 | * application reading/writing this device to return until |
414 | * the buffers are done being used. | 366 | * the buffers are done being used. |
415 | */ | 367 | */ |
416 | if ((op->upcall.type == PVFS2_VFS_OP_FILE_IO && | 368 | if (op->upcall.type == PVFS2_VFS_OP_FILE_IO && |
417 | op->upcall.req.io.async_vfs_io == PVFS_VFS_SYNC_IO) || | 369 | op->upcall.req.io.async_vfs_io == PVFS_VFS_SYNC_IO) { |
418 | op->upcall.type == PVFS2_VFS_OP_FILE_IOX) { | ||
419 | int timed_out = 0; | 370 | int timed_out = 0; |
420 | DECLARE_WAITQUEUE(wait_entry, current); | 371 | DECLARE_WAITQUEUE(wait_entry, current); |
421 | 372 | ||
diff --git a/fs/orangefs/downcall.h b/fs/orangefs/downcall.h index f8bea46e7c6a..e372f446f6ba 100644 --- a/fs/orangefs/downcall.h +++ b/fs/orangefs/downcall.h | |||
@@ -19,10 +19,6 @@ struct pvfs2_io_response { | |||
19 | __s64 amt_complete; | 19 | __s64 amt_complete; |
20 | }; | 20 | }; |
21 | 21 | ||
22 | struct pvfs2_iox_response { | ||
23 | __s64 amt_complete; | ||
24 | }; | ||
25 | |||
26 | struct pvfs2_lookup_response { | 22 | struct pvfs2_lookup_response { |
27 | struct pvfs2_object_kref refn; | 23 | struct pvfs2_object_kref refn; |
28 | }; | 24 | }; |
@@ -111,7 +107,6 @@ struct pvfs2_downcall_s { | |||
111 | 107 | ||
112 | union { | 108 | union { |
113 | struct pvfs2_io_response io; | 109 | struct pvfs2_io_response io; |
114 | struct pvfs2_iox_response iox; | ||
115 | struct pvfs2_lookup_response lookup; | 110 | struct pvfs2_lookup_response lookup; |
116 | struct pvfs2_create_response create; | 111 | struct pvfs2_create_response create; |
117 | struct pvfs2_symlink_response sym; | 112 | struct pvfs2_symlink_response sym; |
diff --git a/fs/orangefs/pvfs2-cache.c b/fs/orangefs/pvfs2-cache.c index 15251884ba4a..f982616a4349 100644 --- a/fs/orangefs/pvfs2-cache.c +++ b/fs/orangefs/pvfs2-cache.c | |||
@@ -103,13 +103,11 @@ char *get_opname_string(struct pvfs2_kernel_op_s *new_op) | |||
103 | return "OP_FSYNC"; | 103 | return "OP_FSYNC"; |
104 | else if (type == PVFS2_VFS_OP_FSKEY) | 104 | else if (type == PVFS2_VFS_OP_FSKEY) |
105 | return "OP_FSKEY"; | 105 | return "OP_FSKEY"; |
106 | else if (type == PVFS2_VFS_OP_FILE_IOX) | ||
107 | return "OP_FILE_IOX"; | ||
108 | } | 106 | } |
109 | return "OP_UNKNOWN?"; | 107 | return "OP_UNKNOWN?"; |
110 | } | 108 | } |
111 | 109 | ||
112 | static struct pvfs2_kernel_op_s *op_alloc_common(__s32 op_linger, __s32 type) | 110 | struct pvfs2_kernel_op_s *op_alloc(__s32 type) |
113 | { | 111 | { |
114 | struct pvfs2_kernel_op_s *new_op = NULL; | 112 | struct pvfs2_kernel_op_s *new_op = NULL; |
115 | 113 | ||
@@ -145,24 +143,12 @@ static struct pvfs2_kernel_op_s *op_alloc_common(__s32 op_linger, __s32 type) | |||
145 | 143 | ||
146 | new_op->upcall.gid = from_kgid(current_user_ns(), | 144 | new_op->upcall.gid = from_kgid(current_user_ns(), |
147 | current_fsgid()); | 145 | current_fsgid()); |
148 | |||
149 | new_op->op_linger = new_op->op_linger_tmp = op_linger; | ||
150 | } else { | 146 | } else { |
151 | gossip_err("op_alloc: kmem_cache_alloc failed!\n"); | 147 | gossip_err("op_alloc: kmem_cache_alloc failed!\n"); |
152 | } | 148 | } |
153 | return new_op; | 149 | return new_op; |
154 | } | 150 | } |
155 | 151 | ||
156 | struct pvfs2_kernel_op_s *op_alloc(__s32 type) | ||
157 | { | ||
158 | return op_alloc_common(1, type); | ||
159 | } | ||
160 | |||
161 | struct pvfs2_kernel_op_s *op_alloc_trailer(__s32 type) | ||
162 | { | ||
163 | return op_alloc_common(2, type); | ||
164 | } | ||
165 | |||
166 | void op_release(struct pvfs2_kernel_op_s *pvfs2_op) | 152 | void op_release(struct pvfs2_kernel_op_s *pvfs2_op) |
167 | { | 153 | { |
168 | if (pvfs2_op) { | 154 | if (pvfs2_op) { |
diff --git a/fs/orangefs/pvfs2-dev-proto.h b/fs/orangefs/pvfs2-dev-proto.h index 68b1bc6e57b4..71ab56df4ad7 100644 --- a/fs/orangefs/pvfs2-dev-proto.h +++ b/fs/orangefs/pvfs2-dev-proto.h | |||
@@ -41,7 +41,6 @@ | |||
41 | #define PVFS2_VFS_OP_FSYNC 0xFF00EE01 | 41 | #define PVFS2_VFS_OP_FSYNC 0xFF00EE01 |
42 | #define PVFS2_VFS_OP_FSKEY 0xFF00EE02 | 42 | #define PVFS2_VFS_OP_FSKEY 0xFF00EE02 |
43 | #define PVFS2_VFS_OP_READDIRPLUS 0xFF00EE03 | 43 | #define PVFS2_VFS_OP_READDIRPLUS 0xFF00EE03 |
44 | #define PVFS2_VFS_OP_FILE_IOX 0xFF00EE04 | ||
45 | 44 | ||
46 | /* | 45 | /* |
47 | * Misc constants. Please retain them as multiples of 8! | 46 | * Misc constants. Please retain them as multiples of 8! |
diff --git a/fs/orangefs/pvfs2-kernel.h b/fs/orangefs/pvfs2-kernel.h index 8b7d57118f9e..ac90b6365fd3 100644 --- a/fs/orangefs/pvfs2-kernel.h +++ b/fs/orangefs/pvfs2-kernel.h | |||
@@ -279,19 +279,6 @@ struct pvfs2_kernel_op_s { | |||
279 | int io_completed; | 279 | int io_completed; |
280 | wait_queue_head_t io_completion_waitq; | 280 | wait_queue_head_t io_completion_waitq; |
281 | 281 | ||
282 | /* | ||
283 | * upcalls requiring variable length trailers require that this struct | ||
284 | * be in the request list even after client-core does a read() on the | ||
285 | * device to dequeue the upcall. | ||
286 | * if op_linger field goes to 0, we dequeue this op off the list. | ||
287 | * else we let it stay. What gets passed to the read() is | ||
288 | * a) if op_linger field is = 1, pvfs2_kernel_op_s itself | ||
289 | * b) else if = 0, we pass ->upcall.trailer_buf | ||
290 | * We expect to have only a single upcall trailer buffer, | ||
291 | * so we expect callers with trailers | ||
292 | * to set this field to 2 and others to set it to 1. | ||
293 | */ | ||
294 | __s32 op_linger, op_linger_tmp; | ||
295 | /* VFS aio fields */ | 282 | /* VFS aio fields */ |
296 | 283 | ||
297 | /* used by the async I/O code to stash the pvfs2_kiocb_s structure */ | 284 | /* used by the async I/O code to stash the pvfs2_kiocb_s structure */ |
@@ -507,7 +494,6 @@ static inline int match_handle(struct pvfs2_khandle resp_handle, | |||
507 | int op_cache_initialize(void); | 494 | int op_cache_initialize(void); |
508 | int op_cache_finalize(void); | 495 | int op_cache_finalize(void); |
509 | struct pvfs2_kernel_op_s *op_alloc(__s32 type); | 496 | struct pvfs2_kernel_op_s *op_alloc(__s32 type); |
510 | struct pvfs2_kernel_op_s *op_alloc_trailer(__s32 type); | ||
511 | char *get_opname_string(struct pvfs2_kernel_op_s *new_op); | 497 | char *get_opname_string(struct pvfs2_kernel_op_s *new_op); |
512 | void op_release(struct pvfs2_kernel_op_s *op); | 498 | void op_release(struct pvfs2_kernel_op_s *op); |
513 | 499 | ||
diff --git a/fs/orangefs/upcall.h b/fs/orangefs/upcall.h index 1e07f626aac6..0805778a8185 100644 --- a/fs/orangefs/upcall.h +++ b/fs/orangefs/upcall.h | |||
@@ -23,14 +23,6 @@ struct pvfs2_io_request_s { | |||
23 | __s32 readahead_size; | 23 | __s32 readahead_size; |
24 | }; | 24 | }; |
25 | 25 | ||
26 | struct pvfs2_iox_request_s { | ||
27 | __s32 buf_index; | ||
28 | __s32 count; | ||
29 | struct pvfs2_object_kref refn; | ||
30 | enum PVFS_io_type io_type; | ||
31 | __s32 __pad1; | ||
32 | }; | ||
33 | |||
34 | struct pvfs2_lookup_request_s { | 26 | struct pvfs2_lookup_request_s { |
35 | __s32 sym_follow; | 27 | __s32 sym_follow; |
36 | __s32 __pad1; | 28 | __s32 __pad1; |
@@ -218,13 +210,12 @@ struct pvfs2_upcall_s { | |||
218 | __u32 gid; | 210 | __u32 gid; |
219 | int pid; | 211 | int pid; |
220 | int tgid; | 212 | int tgid; |
221 | /* currently trailer is used only by readx/writex (iox) */ | 213 | /* Trailers unused but must be retained for protocol compatibility. */ |
222 | __s64 trailer_size; | 214 | __s64 trailer_size; |
223 | char *trailer_buf; | 215 | char *trailer_buf; |
224 | 216 | ||
225 | union { | 217 | union { |
226 | struct pvfs2_io_request_s io; | 218 | struct pvfs2_io_request_s io; |
227 | struct pvfs2_iox_request_s iox; | ||
228 | struct pvfs2_lookup_request_s lookup; | 219 | struct pvfs2_lookup_request_s lookup; |
229 | struct pvfs2_create_request_s create; | 220 | struct pvfs2_create_request_s create; |
230 | struct pvfs2_symlink_request_s sym; | 221 | struct pvfs2_symlink_request_s sym; |