locks: add special return value for asynchronous locks
Miklos Szeredi authored

Use a special error value FILE_LOCK_DEFERRED to mean that a locking
operation returned asynchronously.  This is returned by

  posix_lock_file() for sleeping locks to mean that the lock has been
  queued on the block list, and will be woken up when it might become
  available and needs to be retried (either fl_lmops->fl_notify() is
  called or fl_wait is woken up).

  f_op->lock() to mean either the above, or that the filesystem will
  call back with fl_lmops->fl_grant() when the result of the locking
  operation is known.  The filesystem can do this for sleeping as well
  as non-sleeping locks.

This is to make sure, that return values of -EAGAIN and -EINPROGRESS by
filesystems are not mistaken to mean an asynchronous locking.

This also makes error handling in fs/locks.c and lockd/svclock.c slightly
cleaner.
Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: "J. Bruce Fields" <bfields@fieldses.org>...
bde74e4b
Name Last commit Last update
..
9p 9p: fix O_APPEND in legacy mode
adfs fs: replace remaining __FUNCTION__ occurrences
affs [PATCH] fix reservation discarding in affs
afs Fix various old email addresses for dwmw2
autofs mount options: fix autofs
autofs4 autofs4: remove unused ioctls
befs byteorder: don't directly include linux/byteorder/generic.h
bfs fs: replace remaining __FUNCTION__ occurrences
cifs Merge commit 'v2.6.26' into bkl-removal
coda coda: remove CODA_FS_OLD_API
configfs configfs: Allow ->make_item() and ->make_group() to return detailed errors.
cramfs fs: Remove unnecessary inclusions of asm/semaphore.h
debugfs debugfs: Implement debugfs_remove_recursive()
devpts devpts: factor out PTY index allocation
dlm locks: add special return value for asynchronous locks
ecryptfs eCryptfs: Make all persistent file opens delayed
efs efs: update error msg to not refer to deleted read_inode()
exportfs fs: replace remaining __FUNCTION__ occurrences
ext2 quota: move function-macros from quota.h to quotaops.h
ext3 ext3: validate directory entry data before use
ext4 ext4: do not set extents feature from the kernel
fat fatfs: add UTC timestamp option
freevxfs fs/freevxfs/: proper externs
fuse fuse: fix thinko in max I/O size calucation
gfs2 Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw
hfs
hfsplus
hostfs
hpfs
hppfs
hugetlbfs
isofs
jbd
jbd2
jffs2
jfs
lockd
minix
msdos
ncpfs
nfs
nfs_common
nfsd
nls
ntfs
ocfs2
openpromfs
partitions
proc
qnx4
ramfs
reiserfs
romfs
smbfs
sysfs
sysv
ubifs
udf
ufs
vfat
xfs
Kconfig
Kconfig.binfmt
Makefile
aio.c
anon_inodes.c
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf.c
binfmt_elf_fdpic.c
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
binfmt_som.c
bio-integrity.c
bio.c
block_dev.c
buffer.c
char_dev.c
compat.c
compat_binfmt_elf.c
compat_ioctl.c
dcache.c
dcookies.c
direct-io.c
dnotify.c
dquot.c
drop_caches.c
eventfd.c
eventpoll.c
exec.c
fcntl.c
fifo.c
file.c
file_table.c
filesystems.c
fs-writeback.c
generic_acl.c
inode.c
inotify.c
inotify_user.c
internal.h
ioctl.c
ioprio.c
libfs.c
locks.c
mbcache.c
mpage.c
namei.c
namespace.c
nfsctl.c
no-block.c
open.c
pipe.c
pnode.c
pnode.h
posix_acl.c
quota.c
quota_v1.c
quota_v2.c
read_write.c
read_write.h
readdir.c
select.c
seq_file.c
signalfd.c
splice.c
stack.c
stat.c
super.c
sync.c
timerfd.c
utimes.c
xattr.c
xattr_acl.c