Lines Matching refs:req
13 struct ceph_mds_request *req);
40 struct ceph_mds_request *req; in ceph_lock_message() local
48 req = ceph_mdsc_create_request(mdsc, operation, USE_AUTH_MDS); in ceph_lock_message()
49 if (IS_ERR(req)) in ceph_lock_message()
50 return PTR_ERR(req); in ceph_lock_message()
51 req->r_inode = inode; in ceph_lock_message()
53 req->r_num_caps = 1; in ceph_lock_message()
68 req->r_args.filelock_change.rule = lock_type; in ceph_lock_message()
69 req->r_args.filelock_change.type = cmd; in ceph_lock_message()
70 req->r_args.filelock_change.owner = cpu_to_le64(owner); in ceph_lock_message()
71 req->r_args.filelock_change.pid = cpu_to_le64((u64)fl->fl_pid); in ceph_lock_message()
72 req->r_args.filelock_change.start = cpu_to_le64(fl->fl_start); in ceph_lock_message()
73 req->r_args.filelock_change.length = cpu_to_le64(length); in ceph_lock_message()
74 req->r_args.filelock_change.wait = wait; in ceph_lock_message()
77 req->r_wait_for_completion = ceph_lock_wait_for_completion; in ceph_lock_message()
79 err = ceph_mdsc_do_request(mdsc, inode, req); in ceph_lock_message()
82 fl->fl_pid = le64_to_cpu(req->r_reply_info.filelock_reply->pid); in ceph_lock_message()
83 if (CEPH_LOCK_SHARED == req->r_reply_info.filelock_reply->type) in ceph_lock_message()
85 else if (CEPH_LOCK_EXCL == req->r_reply_info.filelock_reply->type) in ceph_lock_message()
90 fl->fl_start = le64_to_cpu(req->r_reply_info.filelock_reply->start); in ceph_lock_message()
91 length = le64_to_cpu(req->r_reply_info.filelock_reply->start) + in ceph_lock_message()
92 le64_to_cpu(req->r_reply_info.filelock_reply->length); in ceph_lock_message()
99 ceph_mdsc_put_request(req); in ceph_lock_message()
108 struct ceph_mds_request *req) in ceph_lock_wait_for_completion() argument
111 struct inode *inode = req->r_inode; in ceph_lock_wait_for_completion()
114 BUG_ON(req->r_op != CEPH_MDS_OP_SETFILELOCK); in ceph_lock_wait_for_completion()
115 if (req->r_args.filelock_change.rule == CEPH_LOCK_FCNTL) in ceph_lock_wait_for_completion()
117 else if (req->r_args.filelock_change.rule == CEPH_LOCK_FLOCK) in ceph_lock_wait_for_completion()
121 BUG_ON(req->r_args.filelock_change.type == CEPH_LOCK_UNLOCK); in ceph_lock_wait_for_completion()
123 err = wait_for_completion_interruptible(&req->r_completion); in ceph_lock_wait_for_completion()
128 req->r_tid); in ceph_lock_wait_for_completion()
139 intr_req->r_args.filelock_change = req->r_args.filelock_change; in ceph_lock_wait_for_completion()
149 wait_for_completion(&req->r_completion); in ceph_lock_wait_for_completion()