diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-06-22 13:16:32 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-06-22 16:07:42 -0400 |
commit | 8d0a8a9d0ec790086c64d210af413ac351d89e35 (patch) | |
tree | 003a1481e4a8d8487956a6bf04db80dd93264b8b /fs/nfs/nfs4_fs.h | |
parent | ecdbf769b2cb8903e07cd482334c714d89fd1146 (diff) |
[PATCH] NFSv4: Clean up nfs4 lock state accounting
Ensure that lock owner structures are not released prematurely.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4_fs.h')
-rw-r--r-- | fs/nfs/nfs4_fs.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h index 7c6f1d668fbd..ec1a22d7b876 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h | |||
@@ -128,6 +128,7 @@ struct nfs4_state_owner { | |||
128 | 128 | ||
129 | struct nfs4_lock_state { | 129 | struct nfs4_lock_state { |
130 | struct list_head ls_locks; /* Other lock stateids */ | 130 | struct list_head ls_locks; /* Other lock stateids */ |
131 | struct nfs4_state * ls_state; /* Pointer to open state */ | ||
131 | fl_owner_t ls_owner; /* POSIX lock owner */ | 132 | fl_owner_t ls_owner; /* POSIX lock owner */ |
132 | #define NFS_LOCK_INITIALIZED 1 | 133 | #define NFS_LOCK_INITIALIZED 1 |
133 | int ls_flags; | 134 | int ls_flags; |
@@ -153,7 +154,7 @@ struct nfs4_state { | |||
153 | 154 | ||
154 | unsigned long flags; /* Do we hold any locks? */ | 155 | unsigned long flags; /* Do we hold any locks? */ |
155 | struct semaphore lock_sema; /* Serializes file locking operations */ | 156 | struct semaphore lock_sema; /* Serializes file locking operations */ |
156 | rwlock_t state_lock; /* Protects the lock_states list */ | 157 | spinlock_t state_lock; /* Protects the lock_states list */ |
157 | 158 | ||
158 | nfs4_stateid stateid; | 159 | nfs4_stateid stateid; |
159 | 160 | ||
@@ -225,12 +226,8 @@ extern void nfs4_close_state(struct nfs4_state *, mode_t); | |||
225 | extern struct nfs4_state *nfs4_find_state(struct inode *, struct rpc_cred *, mode_t mode); | 226 | extern struct nfs4_state *nfs4_find_state(struct inode *, struct rpc_cred *, mode_t mode); |
226 | extern void nfs4_increment_seqid(int status, struct nfs4_state_owner *sp); | 227 | extern void nfs4_increment_seqid(int status, struct nfs4_state_owner *sp); |
227 | extern void nfs4_schedule_state_recovery(struct nfs4_client *); | 228 | extern void nfs4_schedule_state_recovery(struct nfs4_client *); |
228 | extern struct nfs4_lock_state *nfs4_find_lock_state(struct nfs4_state *state, fl_owner_t); | 229 | extern int nfs4_set_lock_state(struct nfs4_state *state, struct file_lock *fl); |
229 | extern struct nfs4_lock_state *nfs4_get_lock_state(struct nfs4_state *state, fl_owner_t); | ||
230 | extern void nfs4_put_lock_state(struct nfs4_lock_state *state); | ||
231 | extern void nfs4_increment_lock_seqid(int status, struct nfs4_lock_state *ls); | 230 | extern void nfs4_increment_lock_seqid(int status, struct nfs4_lock_state *ls); |
232 | extern void nfs4_notify_setlk(struct nfs4_state *, struct file_lock *, struct nfs4_lock_state *); | ||
233 | extern void nfs4_notify_unlck(struct nfs4_state *, struct file_lock *, struct nfs4_lock_state *); | ||
234 | extern void nfs4_copy_stateid(nfs4_stateid *, struct nfs4_state *, fl_owner_t); | 231 | extern void nfs4_copy_stateid(nfs4_stateid *, struct nfs4_state *, fl_owner_t); |
235 | 232 | ||
236 | extern const nfs4_stateid zero_stateid; | 233 | extern const nfs4_stateid zero_stateid; |