The current scheme of using the i_flock list is really difficult to
manage. There is also a legitimate desire for a per-inode spinlock to
manage these lists that isn't the i_lock.
Start conversion to a new scheme to eventually replace the old i_flock
list with a new file_lock_context object.
We
v2:
- bugfix to the flc_posix list ordering that broke the split/merge code
- don't use i_lock to manage the i_flctx pointer. Do so locklessly
via cmpxchg().
- reordering of the patches to make the set bisectable. As a result
the new spinlock is not introduced until near the end of the set
-
This makes things a bit more efficient in the cifs and ceph lock
pushing code.
Signed-off-by: Jeff Layton jlay...@primarydata.com
---
fs/ceph/locks.c| 11 ++-
fs/cifs/file.c | 14 --
fs/locks.c | 38 ++
include/linux/fs.h |
Signed-off-by: Jeff Layton jlay...@primarydata.com
---
fs/ceph/locks.c | 58 +---
fs/cifs/file.c | 26 +
fs/lockd/svcsubs.c | 20 ++
fs/locks.c | 108 +++-
fs/nfs/delegation.c | 27
Nothing uses it anymore. Also add a forward declaration for struct
file_lock to silence some compiler warnings that the removal triggers.
Signed-off-by: Jeff Layton jlay...@primarydata.com
---
include/linux/fs.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
Signed-off-by: Jeff Layton jlay...@primarydata.com
---
fs/locks.c | 251 +
include/linux/fs.h | 5 +-
2 files changed, 101 insertions(+), 155 deletions(-)
diff --git a/fs/locks.c b/fs/locks.c
index fadf50297e5c..acfad02bc136 100644
We can now add a dedicated spinlock without expanding struct inode.
Change to using that to protect the various i_flctx lists. We do still
use the i_lock to protect the i_flctx pointer itself, but once the
context is assigned to the inode we no longer need it.
Signed-off-by: Jeff Layton
Signed-off-by: Jeff Layton jlay...@primarydata.com
---
fs/ceph/locks.c | 28 ---
fs/ceph/mds_client.c | 4
fs/locks.c | 53 +---
fs/nfs/delegation.c | 18 --
fs/nfs/nfs4state.c | 42
...instead of open-coding it and removing flock locks directly. This
simplifies some coming interim changes in the following patches when
we have different file_lock types protected by different spinlocks.
Signed-off-by: Jeff Layton jlay...@primarydata.com
---
fs/locks.c | 49