diff options
author | Olaf Kirch <okir@suse.de> | 2006-10-04 05:15:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-04 10:55:17 -0400 |
commit | 68a2d76cea4234bc027df23085d9df4f2171f7fc (patch) | |
tree | 79a595aaebb198f3692e9187d0284bc4ac18f469 /fs/lockd/svcsubs.c | |
parent | 0cea32761a2f954c6d42ca79d7d1e6b9663b1e4a (diff) |
[PATCH] knfsd: lockd: Change list of blocked list to list_node
This patch changes the nlm_blocked list to use a list_node instead of
homegrown linked list handling.
Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/lockd/svcsubs.c')
-rw-r--r-- | fs/lockd/svcsubs.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/lockd/svcsubs.c b/fs/lockd/svcsubs.c index c8308bccd319..a92fc5813144 100644 --- a/fs/lockd/svcsubs.c +++ b/fs/lockd/svcsubs.c | |||
@@ -107,6 +107,7 @@ nlm_lookup_file(struct svc_rqst *rqstp, struct nlm_file **result, | |||
107 | memcpy(&file->f_handle, f, sizeof(struct nfs_fh)); | 107 | memcpy(&file->f_handle, f, sizeof(struct nfs_fh)); |
108 | file->f_hash = hash; | 108 | file->f_hash = hash; |
109 | init_MUTEX(&file->f_sema); | 109 | init_MUTEX(&file->f_sema); |
110 | INIT_LIST_HEAD(&file->f_blocks); | ||
110 | 111 | ||
111 | /* Open the file. Note that this must not sleep for too long, else | 112 | /* Open the file. Note that this must not sleep for too long, else |
112 | * we would lock up lockd:-) So no NFS re-exports, folks. | 113 | * we would lock up lockd:-) So no NFS re-exports, folks. |
@@ -220,7 +221,7 @@ nlm_inspect_file(struct nlm_host *host, struct nlm_file *file, int action) | |||
220 | { | 221 | { |
221 | if (action == NLM_ACT_CHECK) { | 222 | if (action == NLM_ACT_CHECK) { |
222 | /* Fast path for mark and sweep garbage collection */ | 223 | /* Fast path for mark and sweep garbage collection */ |
223 | if (file->f_count || file->f_blocks || file->f_shares) | 224 | if (file->f_count || list_empty(&file->f_blocks) || file->f_shares) |
224 | return 1; | 225 | return 1; |
225 | } else { | 226 | } else { |
226 | nlmsvc_traverse_blocks(host, file, action); | 227 | nlmsvc_traverse_blocks(host, file, action); |
@@ -253,7 +254,7 @@ nlm_traverse_files(struct nlm_host *host, int action) | |||
253 | mutex_lock(&nlm_file_mutex); | 254 | mutex_lock(&nlm_file_mutex); |
254 | file->f_count--; | 255 | file->f_count--; |
255 | /* No more references to this file. Let go of it. */ | 256 | /* No more references to this file. Let go of it. */ |
256 | if (!file->f_blocks && !file->f_locks | 257 | if (list_empty(&file->f_blocks) && !file->f_locks |
257 | && !file->f_shares && !file->f_count) { | 258 | && !file->f_shares && !file->f_count) { |
258 | *fp = file->f_next; | 259 | *fp = file->f_next; |
259 | nlmsvc_ops->fclose(file->f_file); | 260 | nlmsvc_ops->fclose(file->f_file); |