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, in service_operation()
153 op); in service_operation()
157 spin_unlock(&op->lock); in service_operation()
158 op->downcall.status = in service_operation()
159 orangefs_normalize_to_errno(op->downcall.status); in service_operation()
160 ret = op->downcall.status; in service_operation()
175 orangefs_clean_up_interrupted_operation(op); in service_operation()
177 op->downcall.status = ret; in service_operation()
180 op->attempts++; in service_operation()
185 llu(op->tag), in service_operation()
187 op->attempts); in service_operation()
194 if (!op->uses_shared_memory) in service_operation()
204 op); in service_operation()
209 bool orangefs_cancel_op_in_progress(struct orangefs_kernel_op_s *op) in orangefs_cancel_op_in_progress() argument
211 u64 tag = op->tag; in orangefs_cancel_op_in_progress()
212 if (!op_state_in_progress(op)) in orangefs_cancel_op_in_progress()
215 op->slot_to_free = op->upcall.req.io.buf_index; in orangefs_cancel_op_in_progress()
216 memset(&op->upcall, 0, sizeof(op->upcall)); in orangefs_cancel_op_in_progress()
217 memset(&op->downcall, 0, sizeof(op->downcall)); in orangefs_cancel_op_in_progress()
218 op->upcall.type = ORANGEFS_VFS_OP_CANCEL; in orangefs_cancel_op_in_progress()
219 op->upcall.req.cancel.op_tag = tag; in orangefs_cancel_op_in_progress()
220 op->downcall.type = ORANGEFS_VFS_OP_INVALID; in orangefs_cancel_op_in_progress()
221 op->downcall.status = -1; in orangefs_cancel_op_in_progress()
222 orangefs_new_tag(op); in orangefs_cancel_op_in_progress()
230 spin_lock(&op->lock); in orangefs_cancel_op_in_progress()
231 set_op_state_waiting(op); in orangefs_cancel_op_in_progress()
235 get_opname_string(op), in orangefs_cancel_op_in_progress()
236 op->op_state, in orangefs_cancel_op_in_progress()
238 list_add(&op->list, &orangefs_request_list); in orangefs_cancel_op_in_progress()
239 spin_unlock(&op->lock); in orangefs_cancel_op_in_progress()
252 orangefs_clean_up_interrupted_operation(struct orangefs_kernel_op_s *op) in orangefs_clean_up_interrupted_operation() argument
253 __releases(op->lock) in orangefs_clean_up_interrupted_operation()
266 op->op_state |= OP_VFS_STATE_GIVEN_UP; in orangefs_clean_up_interrupted_operation()
268 if (list_empty(&op->list)) { in orangefs_clean_up_interrupted_operation()
270 BUG_ON(op_state_serviced(op)); in orangefs_clean_up_interrupted_operation()
271 spin_unlock(&op->lock); in orangefs_clean_up_interrupted_operation()
272 wait_for_completion(&op->waitq); in orangefs_clean_up_interrupted_operation()
273 } else if (op_state_waiting(op)) { in orangefs_clean_up_interrupted_operation()
278 spin_unlock(&op->lock); in orangefs_clean_up_interrupted_operation()
280 list_del_init(&op->list); in orangefs_clean_up_interrupted_operation()
284 op); in orangefs_clean_up_interrupted_operation()
285 } else if (op_state_in_progress(op)) { in orangefs_clean_up_interrupted_operation()
287 spin_unlock(&op->lock); in orangefs_clean_up_interrupted_operation()
289 list_del_init(&op->list); in orangefs_clean_up_interrupted_operation()
294 op); in orangefs_clean_up_interrupted_operation()
296 spin_unlock(&op->lock); in orangefs_clean_up_interrupted_operation()
298 op->op_state); in orangefs_clean_up_interrupted_operation()
300 reinit_completion(&op->waitq); in orangefs_clean_up_interrupted_operation()
320 static int wait_for_matching_downcall(struct orangefs_kernel_op_s *op, in wait_for_matching_downcall() argument
323 __acquires(op->lock) in wait_for_matching_downcall()
334 n = wait_for_completion_interruptible_timeout(&op->waitq, in wait_for_matching_downcall()
337 n = wait_for_completion_killable_timeout(&op->waitq, timeout); in wait_for_matching_downcall()
339 spin_lock(&op->lock); in wait_for_matching_downcall()
341 if (op_state_serviced(op)) in wait_for_matching_downcall()
348 llu(op->tag), in wait_for_matching_downcall()
349 op); in wait_for_matching_downcall()
352 if (op_state_purged(op)) { in wait_for_matching_downcall()
356 llu(op->tag), in wait_for_matching_downcall()
357 op, in wait_for_matching_downcall()
358 op->attempts); in wait_for_matching_downcall()
359 return (op->attempts < ORANGEFS_PURGE_RETRY_COUNT) ? in wait_for_matching_downcall()
367 llu(op->tag), in wait_for_matching_downcall()
368 op, in wait_for_matching_downcall()
369 op->attempts); in wait_for_matching_downcall()