summaryrefslogtreecommitdiffstats
path: root/fs/lockd/svcsubs.c
diff options
context:
space:
mode:
authorOlaf Kirch <okir@suse.de>2006-10-04 02:15:57 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-04 07:55:17 -0700
commit68a2d76cea4234bc027df23085d9df4f2171f7fc (patch)
tree79a595aaebb198f3692e9187d0284bc4ac18f469 /fs/lockd/svcsubs.c
parent0cea32761a2f954c6d42ca79d7d1e6b9663b1e4a (diff)
downloadlinux-68a2d76cea4234bc027df23085d9df4f2171f7fc.tar.gz
linux-68a2d76cea4234bc027df23085d9df4f2171f7fc.tar.bz2
linux-68a2d76cea4234bc027df23085d9df4f2171f7fc.zip
[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.c5
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,
memcpy(&file->f_handle, f, sizeof(struct nfs_fh));
file->f_hash = hash;
init_MUTEX(&file->f_sema);
+ INIT_LIST_HEAD(&file->f_blocks);
/* Open the file. Note that this must not sleep for too long, else
* 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)
{
if (action == NLM_ACT_CHECK) {
/* Fast path for mark and sweep garbage collection */
- if (file->f_count || file->f_blocks || file->f_shares)
+ if (file->f_count || list_empty(&file->f_blocks) || file->f_shares)
return 1;
} else {
nlmsvc_traverse_blocks(host, file, action);
@@ -253,7 +254,7 @@ nlm_traverse_files(struct nlm_host *host, int action)
mutex_lock(&nlm_file_mutex);
file->f_count--;
/* No more references to this file. Let go of it. */
- if (!file->f_blocks && !file->f_locks
+ if (list_empty(&file->f_blocks) && !file->f_locks
&& !file->f_shares && !file->f_count) {
*fp = file->f_next;
nlmsvc_ops->fclose(file->f_file);