Lines Matching refs:err
64 int err; in ceph_lock_message() local
113 err = ceph_mdsc_do_request(mdsc, inode, req); in ceph_lock_message()
114 if (!err && operation == CEPH_MDS_OP_GETFILELOCK) { in ceph_lock_message()
136 length, wait, fl->fl_type, err); in ceph_lock_message()
137 return err; in ceph_lock_message()
145 int err, lock_type; in ceph_lock_wait_for_completion() local
156 err = wait_for_completion_interruptible(&req->r_completion); in ceph_lock_wait_for_completion()
157 if (!err) in ceph_lock_wait_for_completion()
165 err = 0; in ceph_lock_wait_for_completion()
173 req->r_err = err; in ceph_lock_wait_for_completion()
179 err = 0; in ceph_lock_wait_for_completion()
183 if (!err) in ceph_lock_wait_for_completion()
199 err = ceph_mdsc_do_request(mdsc, inode, intr_req); in ceph_lock_wait_for_completion()
202 if (err && err != -ERESTARTSYS) in ceph_lock_wait_for_completion()
203 return err; in ceph_lock_wait_for_completion()
211 int err; in try_unlock_file() local
214 err = locks_lock_file_wait(file, fl); in try_unlock_file()
216 if (err == -ENOENT) { in try_unlock_file()
218 err = 0; in try_unlock_file()
219 return err; in try_unlock_file()
232 int err = 0; in ceph_lock() local
253 err = -EIO; in ceph_lock()
256 if (err < 0) { in ceph_lock()
259 return err; in ceph_lock()
270 err = try_unlock_file(file, fl); in ceph_lock()
271 if (err <= 0) in ceph_lock()
272 return err; in ceph_lock()
275 err = ceph_lock_message(CEPH_LOCK_FCNTL, op, inode, lock_cmd, wait, fl); in ceph_lock()
276 if (!err) { in ceph_lock()
279 err = posix_lock_file(file, fl, NULL); in ceph_lock()
280 if (err) { in ceph_lock()
287 err); in ceph_lock()
291 return err; in ceph_lock()
298 int err = 0; in ceph_flock() local
312 err = -EIO; in ceph_flock()
315 if (err < 0) { in ceph_flock()
318 return err; in ceph_flock()
332 err = try_unlock_file(file, fl); in ceph_flock()
333 if (err <= 0) in ceph_flock()
334 return err; in ceph_flock()
337 err = ceph_lock_message(CEPH_LOCK_FLOCK, CEPH_MDS_OP_SETFILELOCK, in ceph_flock()
339 if (!err && F_UNLCK != fl->fl_type) { in ceph_flock()
340 err = locks_lock_file_wait(file, fl); in ceph_flock()
341 if (err) { in ceph_flock()
345 dout("got %d on locks_lock_file_wait, undid lock\n", err); in ceph_flock()
348 return err; in ceph_flock()
382 int err = 0; in lock_to_ceph_filelock() local
401 err = -EINVAL; in lock_to_ceph_filelock()
404 return err; in lock_to_ceph_filelock()
418 int err = 0; in ceph_encode_locks_to_buffer() local
433 err = -ENOSPC; in ceph_encode_locks_to_buffer()
436 err = lock_to_ceph_filelock(lock, &flocks[l]); in ceph_encode_locks_to_buffer()
437 if (err) in ceph_encode_locks_to_buffer()
444 err = -ENOSPC; in ceph_encode_locks_to_buffer()
447 err = lock_to_ceph_filelock(lock, &flocks[l]); in ceph_encode_locks_to_buffer()
448 if (err) in ceph_encode_locks_to_buffer()
454 return err; in ceph_encode_locks_to_buffer()
467 int err = 0; in ceph_locks_to_pagelist() local
471 err = ceph_pagelist_append(pagelist, &nlocks, sizeof(nlocks)); in ceph_locks_to_pagelist()
472 if (err) in ceph_locks_to_pagelist()
476 err = ceph_pagelist_append(pagelist, flocks, in ceph_locks_to_pagelist()
478 if (err) in ceph_locks_to_pagelist()
483 err = ceph_pagelist_append(pagelist, &nlocks, sizeof(nlocks)); in ceph_locks_to_pagelist()
484 if (err) in ceph_locks_to_pagelist()
488 err = ceph_pagelist_append(pagelist, &flocks[num_fcntl_locks], in ceph_locks_to_pagelist()
492 return err; in ceph_locks_to_pagelist()