[PATCH 1/3] fs/locks: Use allocation rather than the stack in fcntl_getlk()

2017-06-27 Thread Benjamin Coddington
Struct file_lock is fairly large, so let's save some space on the stack by using an allocation for struct file_lock in fcntl_getlk(), just as we do for fcntl_setlk(). Signed-off-by: Benjamin Coddington --- fs/locks.c | 46 ++ 1 file change

[PATCH 0/3 v6] Fixups for l_pid

2017-06-27 Thread Benjamin Coddington
files: that fl_pid ought to be returned from the filesystem as <= 0 to indicate that it makes no sense to translate this l_pid. - Follow up with a patch to have filesystems negate fl_pid for remote locks on remote files. Benjamin Coddington (3): fs/locks:

[PATCH 3/3] staging/lustre, 9p, ceph, cifs, dlm: negate remote pids for F_GETLK

2017-06-27 Thread Benjamin Coddington
pdates lustre, 9p, ceph, cifs, and dlm to negate the remote pid returned for F_GETLK lock requests. Signed-off-by: Benjamin Coddington --- drivers/staging/lustre/lustre/ldlm/ldlm_flock.c | 2 +- fs/9p/vfs_file.c| 2 +- fs/ceph/locks.c

[PATCH 2/3] fs/locks: Remove fl_nspid and use fs-specific l_pid for remote locks

2017-06-27 Thread Benjamin Coddington
translate to init's pid namespace, so that the locks API can then translate from init's pid namespace into the pid namespace of the caller. Signed-off-by: Benjamin Coddington --- fs/fuse/file.c | 6 +++--- fs/locks.c | 62 ---

Re: [PATCH 1/3] locks: introduce locks_lock_inode_wait()

2015-10-22 Thread Benjamin Coddington
On Thu, 22 Oct 2015, Benjamin Coddington wrote: > Users of the locks API commonly call either posix_lock_file_wait() or > flock_lock_file_wait() depending upon the lock type. Add a new function > locks_lock_inode_wait() which will check and call the correct function for > the type of

[PATCH 2/3] Move locks API users to locks_lock_inode_wait()

2015-10-22 Thread Benjamin Coddington
Instead of having users check for FL_POSIX or FL_FLOCK to call the correct locks API function, use the check within locks_lock_inode_wait(). This allows for some later cleanup. Signed-off-by: Benjamin Coddington --- drivers/staging/lustre/lustre/llite/file.c |8 ++-- fs/9p/vfs_file.c

[PATCH 3/3] locks: cleanup posix_lock_inode_wait and flock_lock_inode_wait

2015-10-22 Thread Benjamin Coddington
All callers use locks_lock_inode_wait() instead. Signed-off-by: Benjamin Coddington --- fs/locks.c |5 + include/linux/fs.h | 24 2 files changed, 1 insertions(+), 28 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 94d50d3..b6f3c92 100644

[PATCH 0/3] Minor cleanup for locks API

2015-10-22 Thread Benjamin Coddington
. Benjamin Coddington (3): locks: introduce locks_lock_inode_wait() Move locks API users to locks_lock_inode_wait() locks: cleanup posix_lock_inode_wait and flock_lock_inode_wait drivers/staging/lustre/lustre/llite/file.c |8 +- fs/9p/vfs_file.c |4 +- fs/ceph

[PATCH 1/3] locks: introduce locks_lock_inode_wait()

2015-10-22 Thread Benjamin Coddington
Users of the locks API commonly call either posix_lock_file_wait() or flock_lock_file_wait() depending upon the lock type. Add a new function locks_lock_inode_wait() which will check and call the correct function for the type of lock passed in. Signed-off-by: Benjamin Coddington --- fs/locks.c