Lines Matching refs:op
47 static void orangefs_devreq_add_op(struct orangefs_kernel_op_s *op) in orangefs_devreq_add_op() argument
49 int index = hash_func(op->tag, hash_table_size); in orangefs_devreq_add_op()
51 list_add_tail(&op->list, &orangefs_htable_ops_in_progress[index]); in orangefs_devreq_add_op()
60 struct orangefs_kernel_op_s *op, *next; in orangefs_devreq_remove_op() local
66 list_for_each_entry_safe(op, in orangefs_devreq_remove_op()
70 if (op->tag == tag && !op_state_purged(op) && in orangefs_devreq_remove_op()
71 !op_state_given_up(op)) { in orangefs_devreq_remove_op()
72 list_del_init(&op->list); in orangefs_devreq_remove_op()
74 return op; in orangefs_devreq_remove_op()
161 struct orangefs_kernel_op_s *op, *temp; in orangefs_devreq_read() local
187 list_for_each_entry_safe(op, temp, &orangefs_request_list, list) { in orangefs_devreq_read()
190 spin_lock(&op->lock); in orangefs_devreq_read()
191 if (unlikely(op_state_purged(op) || op_state_given_up(op))) { in orangefs_devreq_read()
192 spin_unlock(&op->lock); in orangefs_devreq_read()
196 fsid = fsid_of_op(op); in orangefs_devreq_read()
206 llu(op->tag), in orangefs_devreq_read()
207 get_opname_string(op)); in orangefs_devreq_read()
208 spin_unlock(&op->lock); in orangefs_devreq_read()
219 !(op->upcall.type == in orangefs_devreq_read()
221 op->upcall.type == in orangefs_devreq_read()
223 op->upcall.type == in orangefs_devreq_read()
227 llu(op->tag), get_opname_string(op)); in orangefs_devreq_read()
231 spin_unlock(&op->lock); in orangefs_devreq_read()
240 cur_op = op; in orangefs_devreq_read()
357 struct orangefs_kernel_op_s *op = NULL; in orangefs_devreq_write_iter() local
409 op = orangefs_devreq_remove_op(head.tag); in orangefs_devreq_write_iter()
410 if (!op) { in orangefs_devreq_write_iter()
417 n = copy_from_iter(&op->downcall, downcall_size, iter); in orangefs_devreq_write_iter()
423 if (op->downcall.status) in orangefs_devreq_write_iter()
431 if ((head_size + downcall_size + op->downcall.trailer_size) != total) { in orangefs_devreq_write_iter()
438 op->downcall.trailer_size, in orangefs_devreq_write_iter()
444 if ((op->downcall.type != ORANGEFS_VFS_OP_READDIR) && in orangefs_devreq_write_iter()
445 (op->downcall.trailer_size != 0)) { in orangefs_devreq_write_iter()
448 op->downcall.type); in orangefs_devreq_write_iter()
453 if ((op->downcall.type == ORANGEFS_VFS_OP_READDIR) && in orangefs_devreq_write_iter()
454 (op->downcall.trailer_size == 0)) { in orangefs_devreq_write_iter()
457 op->downcall.type); in orangefs_devreq_write_iter()
461 if (op->downcall.type != ORANGEFS_VFS_OP_READDIR) in orangefs_devreq_write_iter()
464 op->downcall.trailer_buf = in orangefs_devreq_write_iter()
465 vmalloc(op->downcall.trailer_size); in orangefs_devreq_write_iter()
466 if (op->downcall.trailer_buf == NULL) { in orangefs_devreq_write_iter()
471 memset(op->downcall.trailer_buf, 0, op->downcall.trailer_size); in orangefs_devreq_write_iter()
472 n = copy_from_iter(op->downcall.trailer_buf, in orangefs_devreq_write_iter()
473 op->downcall.trailer_size, in orangefs_devreq_write_iter()
475 if (n != op->downcall.trailer_size) { in orangefs_devreq_write_iter()
477 vfree(op->downcall.trailer_buf); in orangefs_devreq_write_iter()
486 spin_lock(&op->lock); in orangefs_devreq_write_iter()
487 if (unlikely(op_is_cancel(op))) { in orangefs_devreq_write_iter()
488 spin_unlock(&op->lock); in orangefs_devreq_write_iter()
489 put_cancel(op); in orangefs_devreq_write_iter()
490 } else if (unlikely(op_state_given_up(op))) { in orangefs_devreq_write_iter()
491 spin_unlock(&op->lock); in orangefs_devreq_write_iter()
492 complete(&op->waitq); in orangefs_devreq_write_iter()
494 set_op_state_serviced(op); in orangefs_devreq_write_iter()
498 get_opname_string(op), in orangefs_devreq_write_iter()
499 op->op_state, in orangefs_devreq_write_iter()
501 spin_unlock(&op->lock); in orangefs_devreq_write_iter()
506 op->downcall.status = -(ORANGEFS_ERROR_BIT | 9); in orangefs_devreq_write_iter()
511 op->downcall.status = -(ORANGEFS_ERROR_BIT | 8); in orangefs_devreq_write_iter()