aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfs/nfs4_fs.h13
-rw-r--r--fs/nfs/nfs4state.c24
2 files changed, 12 insertions, 25 deletions
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h
index 92193eddb41d..a8b855ab4e22 100644
--- a/fs/nfs/nfs4_fs.h
+++ b/fs/nfs/nfs4_fs.h
@@ -130,16 +130,15 @@ enum {
130 */ 130 */
131 131
132struct nfs4_lock_state { 132struct nfs4_lock_state {
133 struct list_head ls_locks; /* Other lock stateids */ 133 struct list_head ls_locks; /* Other lock stateids */
134 struct nfs4_state * ls_state; /* Pointer to open state */ 134 struct nfs4_state * ls_state; /* Pointer to open state */
135#define NFS_LOCK_INITIALIZED 0 135#define NFS_LOCK_INITIALIZED 0
136#define NFS_LOCK_LOST 1 136#define NFS_LOCK_LOST 1
137 unsigned long ls_flags; 137 unsigned long ls_flags;
138 struct nfs_seqid_counter ls_seqid; 138 struct nfs_seqid_counter ls_seqid;
139 nfs4_stateid ls_stateid; 139 nfs4_stateid ls_stateid;
140 atomic_t ls_count; 140 atomic_t ls_count;
141 fl_owner_t ls_owner; 141 fl_owner_t ls_owner;
142 struct work_struct ls_release;
143}; 142};
144 143
145/* bits for nfs4_state->flags */ 144/* bits for nfs4_state->flags */
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index a043f618cd5a..22fe35104c0c 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -799,18 +799,6 @@ __nfs4_find_lock_state(struct nfs4_state *state, fl_owner_t fl_owner)
799 return NULL; 799 return NULL;
800} 800}
801 801
802static void
803free_lock_state_work(struct work_struct *work)
804{
805 struct nfs4_lock_state *lsp = container_of(work,
806 struct nfs4_lock_state, ls_release);
807 struct nfs4_state *state = lsp->ls_state;
808 struct nfs_server *server = state->owner->so_server;
809 struct nfs_client *clp = server->nfs_client;
810
811 clp->cl_mvops->free_lock_state(server, lsp);
812}
813
814/* 802/*
815 * Return a compatible lock_state. If no initialized lock_state structure 803 * Return a compatible lock_state. If no initialized lock_state structure
816 * exists, return an uninitialized one. 804 * exists, return an uninitialized one.
@@ -832,7 +820,6 @@ static struct nfs4_lock_state *nfs4_alloc_lock_state(struct nfs4_state *state, f
832 if (lsp->ls_seqid.owner_id < 0) 820 if (lsp->ls_seqid.owner_id < 0)
833 goto out_free; 821 goto out_free;
834 INIT_LIST_HEAD(&lsp->ls_locks); 822 INIT_LIST_HEAD(&lsp->ls_locks);
835 INIT_WORK(&lsp->ls_release, free_lock_state_work);
836 return lsp; 823 return lsp;
837out_free: 824out_free:
838 kfree(lsp); 825 kfree(lsp);
@@ -896,12 +883,13 @@ void nfs4_put_lock_state(struct nfs4_lock_state *lsp)
896 if (list_empty(&state->lock_states)) 883 if (list_empty(&state->lock_states))
897 clear_bit(LK_STATE_IN_USE, &state->flags); 884 clear_bit(LK_STATE_IN_USE, &state->flags);
898 spin_unlock(&state->state_lock); 885 spin_unlock(&state->state_lock);
899 if (test_bit(NFS_LOCK_INITIALIZED, &lsp->ls_flags)) 886 server = state->owner->so_server;
900 queue_work(nfsiod_workqueue, &lsp->ls_release); 887 if (test_bit(NFS_LOCK_INITIALIZED, &lsp->ls_flags)) {
901 else { 888 struct nfs_client *clp = server->nfs_client;
902 server = state->owner->so_server; 889
890 clp->cl_mvops->free_lock_state(server, lsp);
891 } else
903 nfs4_free_lock_state(server, lsp); 892 nfs4_free_lock_state(server, lsp);
904 }
905} 893}
906 894
907static void nfs4_fl_copy_lock(struct file_lock *dst, struct file_lock *src) 895static void nfs4_fl_copy_lock(struct file_lock *dst, struct file_lock *src)