Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 33544
b: refs/heads/master
c: 01df9c5
h: refs/heads/master
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Aug 24, 2006
1 parent d1e22d7 commit 6ee718f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8f8e7a50f450fcb86a5b2ffb94543c57a14f8260
refs/heads/master: 01df9c5e918ae5559f2d96da0143f8bfbb9e6171
15 changes: 9 additions & 6 deletions trunk/fs/lockd/svcsubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,19 +237,22 @@ static int
nlm_traverse_files(struct nlm_host *host, int action)
{
struct nlm_file *file, **fp;
int i;
int i, ret = 0;

mutex_lock(&nlm_file_mutex);
for (i = 0; i < FILE_NRHASH; i++) {
fp = nlm_files + i;
while ((file = *fp) != NULL) {
file->f_count++;
mutex_unlock(&nlm_file_mutex);

/* Traverse locks, blocks and shares of this file
* and update file->f_locks count */
if (nlm_inspect_file(host, file, action)) {
mutex_unlock(&nlm_file_mutex);
return 1;
}
if (nlm_inspect_file(host, file, action))
ret = 1;

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
&& !file->f_shares && !file->f_count) {
Expand All @@ -262,7 +265,7 @@ nlm_traverse_files(struct nlm_host *host, int action)
}
}
mutex_unlock(&nlm_file_mutex);
return 0;
return ret;
}

/*
Expand Down

0 comments on commit 6ee718f

Please sign in to comment.