Lines Matching defs:op

20 static int wait_for_matching_downcall(struct orangefs_kernel_op_s *op,
23 __acquires(op->lock);
24 static void orangefs_clean_up_interrupted_operation(struct orangefs_kernel_op_s *op)
25 __releases(op->lock);
36 struct orangefs_kernel_op_s *op, *tmp;
39 list_for_each_entry_safe(op, tmp, &orangefs_request_list, list) {
41 "pvfs2-client-core: purging op tag %llu %s\n",
42 llu(op->tag),
43 get_opname_string(op));
44 set_op_state_purged(op);
46 "%s: op:%s: op_state:%d: process:%s:\n",
48 get_opname_string(op),
49 op->op_state,
58 * Note op->downcall.status will contain the status of the operation (in
61 * op->state can be checked to see if it was serviced or not.
63 * Returns contents of op->downcall.status for convenience
65 int service_operation(struct orangefs_kernel_op_s *op,
74 op->upcall.tgid = current->tgid;
75 op->upcall.pid = current->pid;
78 op->downcall.status = 0;
80 "%s: %s op:%p: process:%s: pid:%d:\n",
83 op,
103 op->downcall.status = ret;
113 spin_lock(&op->lock);
114 set_op_state_waiting(op);
116 "%s: op:%s: op_state:%d: process:%s:\n",
118 get_opname_string(op),
119 op->op_state,
121 /* add high priority remount op to the front of the line. */
123 list_add(&op->list, &orangefs_request_list);
125 list_add_tail(&op->list, &orangefs_request_list);
126 spin_unlock(&op->lock);
136 if (op->upcall.type == ORANGEFS_VFS_OP_FS_UMOUNT)
146 ret = wait_for_matching_downcall(op, timeout, flags);
151 op);
155 spin_unlock(&op->lock);
156 op->downcall.status =
157 orangefs_normalize_to_errno(op->downcall.status);
158 ret = op->downcall.status;
170 * remove a waiting op from the request list or
171 * remove an in-progress op from the in-progress list.
173 orangefs_clean_up_interrupted_operation(op);
175 op->downcall.status = ret;
178 op->attempts++;
183 llu(op->tag),
185 op->attempts);
192 if (!op->uses_shared_memory)
202 op);
206 /* This can get called on an I/O op if it had a bad service_operation. */
207 bool orangefs_cancel_op_in_progress(struct orangefs_kernel_op_s *op)
209 u64 tag = op->tag;
210 if (!op_state_in_progress(op))
213 op->slot_to_free = op->upcall.req.io.buf_index;
214 memset(&op->upcall, 0, sizeof(op->upcall));
215 memset(&op->downcall, 0, sizeof(op->downcall));
216 op->upcall.type = ORANGEFS_VFS_OP_CANCEL;
217 op->upcall.req.cancel.op_tag = tag;
218 op->downcall.type = ORANGEFS_VFS_OP_INVALID;
219 op->downcall.status = -1;
220 orangefs_new_tag(op);
228 spin_lock(&op->lock);
229 set_op_state_waiting(op);
231 "%s: op:%s: op_state:%d: process:%s:\n",
233 get_opname_string(op),
234 op->op_state,
236 list_add(&op->list, &orangefs_request_list);
237 spin_unlock(&op->lock);
247 * Change an op to the "given up" state and remove it from its list.
250 orangefs_clean_up_interrupted_operation(struct orangefs_kernel_op_s *op)
251 __releases(op->lock)
257 * Called with op->lock held.
264 op->op_state |= OP_VFS_STATE_GIVEN_UP;
266 if (list_empty(&op->list)) {
268 BUG_ON(op_state_serviced(op));
269 spin_unlock(&op->lock);
270 wait_for_completion(&op->waitq);
271 } else if (op_state_waiting(op)) {
273 * upcall hasn't been read; remove op from upcall request
276 spin_unlock(&op->lock);
278 list_del_init(&op->list);
281 "Interrupted: Removed op %p from request_list\n",
282 op);
283 } else if (op_state_in_progress(op)) {
284 /* op must be removed from the in progress htable */
285 spin_unlock(&op->lock);
287 list_del_init(&op->list);
290 "Interrupted: Removed op %p"
292 op);
294 spin_unlock(&op->lock);
296 op->op_state);
298 reinit_completion(&op->waitq);
306 * When this call returns to the caller, the specified op will no
316 * Returns with op->lock taken.
318 static int wait_for_matching_downcall(struct orangefs_kernel_op_s *op,
321 __acquires(op->lock)
329 * primitives, during which the op is out of the hands of the
334 n = wait_for_completion_io_timeout(&op->waitq, timeout);
336 n = wait_for_completion_interruptible_timeout(&op->waitq,
339 n = wait_for_completion_killable_timeout(&op->waitq, timeout);
341 spin_lock(&op->lock);
343 if (op_state_serviced(op))
350 llu(op->tag),
351 op);
354 if (op_state_purged(op)) {
358 llu(op->tag),
359 op,
360 op->attempts);
361 return (op->attempts < ORANGEFS_PURGE_RETRY_COUNT) ?
369 llu(op->tag),
370 op,
371 op->attempts);