Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
R128
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ermine
R128
Commits
4f15e2b1
Commit
4f15e2b1
authored
19 years ago
by
Trond Myklebust
Browse files
Options
Downloads
Patches
Plain Diff
[PATCH] NLM: cleanup for blocked locks.
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
80fec4c6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fs/lockd/clntlock.c
+6
-12
6 additions, 12 deletions
fs/lockd/clntlock.c
with
6 additions
and
12 deletions
fs/lockd/clntlock.c
+
6
−
12
View file @
4f15e2b1
...
...
@@ -31,7 +31,7 @@ static int reclaimer(void *ptr);
* This is the representation of a blocked client lock.
*/
struct
nlm_wait
{
struct
nlm_wait
*
b_nex
t
;
/* linked list */
struct
list_head
b_lis
t
;
/* 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 */
...
...
@@ -39,7 +39,7 @@ struct nlm_wait {
u32
b_status
;
/* grant callback status */
};
static
struct
nlm_wait
*
nlm_blocked
;
static
LIST_HEAD
(
nlm_blocked
)
;
/*
* Block on a lock
...
...
@@ -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
=
&
block
;
list_add
(
&
block
.
b_list
,
&
nlm_blocked
);
/* Remember pseudo nsm state */
pstate
=
host
->
h_state
;
...
...
@@ -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
;
...
...
@@ -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
;
b
lock
;
block
=
block
->
b_nex
t
)
{
list_for_each_entry
(
block
,
&
nlm_blocked
,
b
_lis
t
)
{
if
(
nlm_compare_locks
(
block
->
b_lock
,
&
lock
->
fl
))
break
;
}
...
...
@@ -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
;
b
lock
;
block
=
block
->
b_nex
t
)
{
list_for_each_entry
(
block
,
&
nlm_blocked
,
b
_lis
t
)
{
if
(
block
->
b_host
==
host
)
{
block
->
b_status
=
NLM_LCK_DENIED_GRACE_PERIOD
;
wake_up
(
&
block
->
b_wait
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment