Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 2807
b: refs/heads/master
c: 4f15e2b
h: refs/heads/master
i:
  2805: 074eb57
  2803: 642afcf
  2799: ef9c96c
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Jun 22, 2005
1 parent d36e143 commit 21d435a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 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: 80fec4c62e2cf544ac26e53f3e0d2f73df6820b9
refs/heads/master: 4f15e2b1f4f3a56e46201714b39436c32218d547
18 changes: 6 additions & 12 deletions trunk/fs/lockd/clntlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ static int reclaimer(void *ptr);
* This is the representation of a blocked client lock.
*/
struct nlm_wait {
struct nlm_wait * b_next; /* linked list */
struct list_head b_list; /* linked list */
wait_queue_head_t b_wait; /* where to wait on */
struct nlm_host * b_host;
struct file_lock * b_lock; /* local file lock */
unsigned short b_reclaim; /* got to reclaim lock */
u32 b_status; /* grant callback status */
};

static struct nlm_wait * nlm_blocked;
static LIST_HEAD(nlm_blocked);

/*
* Block on a lock
Expand All @@ -55,8 +55,7 @@ nlmclnt_block(struct nlm_host *host, struct file_lock *fl, u32 *statp)
block.b_lock = fl;
init_waitqueue_head(&block.b_wait);
block.b_status = NLM_LCK_BLOCKED;
block.b_next = nlm_blocked;
nlm_blocked = █
list_add(&block.b_list, &nlm_blocked);

/* Remember pseudo nsm state */
pstate = host->h_state;
Expand All @@ -71,12 +70,7 @@ nlmclnt_block(struct nlm_host *host, struct file_lock *fl, u32 *statp)
*/
sleep_on_timeout(&block.b_wait, 30*HZ);

for (head = &nlm_blocked; *head; head = &(*head)->b_next) {
if (*head == &block) {
*head = block.b_next;
break;
}
}
list_del(&block.b_list);

if (!signalled()) {
*statp = block.b_status;
Expand Down Expand Up @@ -105,7 +99,7 @@ nlmclnt_grant(struct nlm_lock *lock)
* Look up blocked request based on arguments.
* Warning: must not use cookie to match it!
*/
for (block = nlm_blocked; block; block = block->b_next) {
list_for_each_entry(block, &nlm_blocked, b_list) {
if (nlm_compare_locks(block->b_lock, &lock->fl))
break;
}
Expand Down Expand Up @@ -230,7 +224,7 @@ reclaimer(void *ptr)
host->h_reclaiming = 0;

/* Now, wake up all processes that sleep on a blocked lock */
for (block = nlm_blocked; block; block = block->b_next) {
list_for_each_entry(block, &nlm_blocked, b_list) {
if (block->b_host == host) {
block->b_status = NLM_LCK_DENIED_GRACE_PERIOD;
wake_up(&block->b_wait);
Expand Down

0 comments on commit 21d435a

Please sign in to comment.