From 68a2d76cea4234bc027df23085d9df4f2171f7fc Mon Sep 17 00:00:00 2001 From: Olaf Kirch Date: Wed, 4 Oct 2006 02:15:57 -0700 Subject: [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 Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/lockd/svcsubs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'fs/lockd/svcsubs.c') diff --git a/fs/lockd/svcsubs.c b/fs/lockd/svcsubs.c index c8308bccd31..a92fc581314 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); -- cgit v1.2.3