Lines Matching refs: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; in purge_waiting_ops() local
39 list_for_each_entry_safe(op, tmp, &orangefs_request_list, list) { in purge_waiting_ops()
42 llu(op->tag), in purge_waiting_ops()
43 get_opname_string(op)); in purge_waiting_ops()
44 set_op_state_purged(op); in purge_waiting_ops()
48 get_opname_string(op), in purge_waiting_ops()
49 op->op_state, in purge_waiting_ops()
65 int service_operation(struct orangefs_kernel_op_s *op, in service_operation() argument
74 op->upcall.tgid = current->tgid; in service_operation()
75 op->upcall.pid = current->pid; in service_operation()
78 op->downcall.status = 0; in service_operation()
83 op, in service_operation()
103 op->downcall.status = ret; in service_operation()
113 spin_lock(&op->lock); in service_operation()
114 set_op_state_waiting(op); in service_operation()
118 get_opname_string(op), in service_operation()
119 op->op_state, in service_operation()
123 list_add(&op->list, &orangefs_request_list); in service_operation()
125 list_add_tail(&op->list, &orangefs_request_list); in service_operation()
126 spin_unlock(&op->lock); in service_operation()
136 if (op->upcall.type == ORANGEFS_VFS_OP_FS_UMOUNT) in service_operation()
146 ret = wait_for_matching_downcall(op, timeout, flags); in service_operation()
151 op); in service_operation()
155 spin_unlock(&op->lock); in service_operation()
156 op->downcall.status = in service_operation()
157 orangefs_normalize_to_errno(op->downcall.status); in service_operation()
158 ret = op->downcall.status; in service_operation()
173 orangefs_clean_up_interrupted_operation(op); in service_operation()
175 op->downcall.status = ret; in service_operation()
178 op->attempts++; in service_operation()
183 llu(op->tag), in service_operation()
185 op->attempts); in service_operation()
192 if (!op->uses_shared_memory) in service_operation()
202 op); in service_operation()
207 bool orangefs_cancel_op_in_progress(struct orangefs_kernel_op_s *op) in orangefs_cancel_op_in_progress() argument
209 u64 tag = op->tag; in orangefs_cancel_op_in_progress()
210 if (!op_state_in_progress(op)) in orangefs_cancel_op_in_progress()
213 op->slot_to_free = op->upcall.req.io.buf_index; in orangefs_cancel_op_in_progress()
214 memset(&op->upcall, 0, sizeof(op->upcall)); in orangefs_cancel_op_in_progress()
215 memset(&op->downcall, 0, sizeof(op->downcall)); in orangefs_cancel_op_in_progress()
216 op->upcall.type = ORANGEFS_VFS_OP_CANCEL; in orangefs_cancel_op_in_progress()
217 op->upcall.req.cancel.op_tag = tag; in orangefs_cancel_op_in_progress()
218 op->downcall.type = ORANGEFS_VFS_OP_INVALID; in orangefs_cancel_op_in_progress()
219 op->downcall.status = -1; in orangefs_cancel_op_in_progress()
220 orangefs_new_tag(op); in orangefs_cancel_op_in_progress()
228 spin_lock(&op->lock); in orangefs_cancel_op_in_progress()
229 set_op_state_waiting(op); in orangefs_cancel_op_in_progress()
233 get_opname_string(op), in orangefs_cancel_op_in_progress()
234 op->op_state, in orangefs_cancel_op_in_progress()
236 list_add(&op->list, &orangefs_request_list); in orangefs_cancel_op_in_progress()
237 spin_unlock(&op->lock); in orangefs_cancel_op_in_progress()
250 orangefs_clean_up_interrupted_operation(struct orangefs_kernel_op_s *op) in orangefs_clean_up_interrupted_operation() argument
251 __releases(op->lock) in orangefs_clean_up_interrupted_operation()
264 op->op_state |= OP_VFS_STATE_GIVEN_UP; in orangefs_clean_up_interrupted_operation()
266 if (list_empty(&op->list)) { in orangefs_clean_up_interrupted_operation()
268 BUG_ON(op_state_serviced(op)); in orangefs_clean_up_interrupted_operation()
269 spin_unlock(&op->lock); in orangefs_clean_up_interrupted_operation()
270 wait_for_completion(&op->waitq); in orangefs_clean_up_interrupted_operation()
271 } else if (op_state_waiting(op)) { in orangefs_clean_up_interrupted_operation()
276 spin_unlock(&op->lock); in orangefs_clean_up_interrupted_operation()
278 list_del_init(&op->list); in orangefs_clean_up_interrupted_operation()
282 op); in orangefs_clean_up_interrupted_operation()
283 } else if (op_state_in_progress(op)) { in orangefs_clean_up_interrupted_operation()
285 spin_unlock(&op->lock); in orangefs_clean_up_interrupted_operation()
287 list_del_init(&op->list); in orangefs_clean_up_interrupted_operation()
292 op); in orangefs_clean_up_interrupted_operation()
294 spin_unlock(&op->lock); in orangefs_clean_up_interrupted_operation()
296 op->op_state); in orangefs_clean_up_interrupted_operation()
298 reinit_completion(&op->waitq); in orangefs_clean_up_interrupted_operation()
318 static int wait_for_matching_downcall(struct orangefs_kernel_op_s *op, in wait_for_matching_downcall() argument
321 __acquires(op->lock) in wait_for_matching_downcall()
334 n = wait_for_completion_io_timeout(&op->waitq, timeout); in wait_for_matching_downcall()
336 n = wait_for_completion_interruptible_timeout(&op->waitq, in wait_for_matching_downcall()
339 n = wait_for_completion_killable_timeout(&op->waitq, timeout); in wait_for_matching_downcall()
341 spin_lock(&op->lock); in wait_for_matching_downcall()
343 if (op_state_serviced(op)) in wait_for_matching_downcall()
350 llu(op->tag), in wait_for_matching_downcall()
351 op); in wait_for_matching_downcall()
354 if (op_state_purged(op)) { in wait_for_matching_downcall()
358 llu(op->tag), in wait_for_matching_downcall()
359 op, in wait_for_matching_downcall()
360 op->attempts); in wait_for_matching_downcall()
361 return (op->attempts < ORANGEFS_PURGE_RETRY_COUNT) ? in wait_for_matching_downcall()
369 llu(op->tag), in wait_for_matching_downcall()
370 op, in wait_for_matching_downcall()
371 op->attempts); in wait_for_matching_downcall()