Lines Matching refs:req
15 struct ceph_mds_request *req);
81 struct ceph_mds_request *req; in ceph_lock_message() local
100 req = ceph_mdsc_create_request(mdsc, operation, USE_AUTH_MDS); in ceph_lock_message()
101 if (IS_ERR(req)) in ceph_lock_message()
102 return PTR_ERR(req); in ceph_lock_message()
103 req->r_inode = inode; in ceph_lock_message()
105 req->r_num_caps = 1; in ceph_lock_message()
121 req->r_args.filelock_change.rule = lock_type; in ceph_lock_message()
122 req->r_args.filelock_change.type = cmd; in ceph_lock_message()
123 req->r_args.filelock_change.owner = cpu_to_le64(owner); in ceph_lock_message()
124 req->r_args.filelock_change.pid = cpu_to_le64((u64) fl->c.flc_pid); in ceph_lock_message()
125 req->r_args.filelock_change.start = cpu_to_le64(fl->fl_start); in ceph_lock_message()
126 req->r_args.filelock_change.length = cpu_to_le64(length); in ceph_lock_message()
127 req->r_args.filelock_change.wait = wait; in ceph_lock_message()
129 err = ceph_mdsc_submit_request(mdsc, inode, req); in ceph_lock_message()
131 err = ceph_mdsc_wait_request(mdsc, req, wait ? in ceph_lock_message()
134 fl->c.flc_pid = -le64_to_cpu(req->r_reply_info.filelock_reply->pid); in ceph_lock_message()
135 if (CEPH_LOCK_SHARED == req->r_reply_info.filelock_reply->type) in ceph_lock_message()
137 else if (CEPH_LOCK_EXCL == req->r_reply_info.filelock_reply->type) in ceph_lock_message()
142 fl->fl_start = le64_to_cpu(req->r_reply_info.filelock_reply->start); in ceph_lock_message()
143 length = le64_to_cpu(req->r_reply_info.filelock_reply->start) + in ceph_lock_message()
144 le64_to_cpu(req->r_reply_info.filelock_reply->length); in ceph_lock_message()
151 ceph_mdsc_put_request(req); in ceph_lock_message()
160 struct ceph_mds_request *req) in ceph_lock_wait_for_completion() argument
164 struct inode *inode = req->r_inode; in ceph_lock_wait_for_completion()
167 BUG_ON(req->r_op != CEPH_MDS_OP_SETFILELOCK); in ceph_lock_wait_for_completion()
168 if (req->r_args.filelock_change.rule == CEPH_LOCK_FCNTL) in ceph_lock_wait_for_completion()
170 else if (req->r_args.filelock_change.rule == CEPH_LOCK_FLOCK) in ceph_lock_wait_for_completion()
174 BUG_ON(req->r_args.filelock_change.type == CEPH_LOCK_UNLOCK); in ceph_lock_wait_for_completion()
176 err = wait_for_completion_interruptible(&req->r_completion); in ceph_lock_wait_for_completion()
180 doutc(cl, "request %llu was interrupted\n", req->r_tid); in ceph_lock_wait_for_completion()
183 if (test_bit(CEPH_MDS_R_GOT_RESULT, &req->r_req_flags)) { in ceph_lock_wait_for_completion()
191 mutex_lock(&req->r_fill_mutex); in ceph_lock_wait_for_completion()
192 req->r_err = err; in ceph_lock_wait_for_completion()
193 set_bit(CEPH_MDS_R_ABORTED, &req->r_req_flags); in ceph_lock_wait_for_completion()
194 mutex_unlock(&req->r_fill_mutex); in ceph_lock_wait_for_completion()
196 if (!req->r_session) { in ceph_lock_wait_for_completion()
214 intr_req->r_args.filelock_change = req->r_args.filelock_change; in ceph_lock_wait_for_completion()
224 wait_for_completion_killable(&req->r_safe_completion); in ceph_lock_wait_for_completion()