Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
4f15e2b1
Commit
4f15e2b1
authored
Jun 22, 2005
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] NLM: cleanup for blocked locks.
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
80fec4c6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
fs/lockd/clntlock.c
fs/lockd/clntlock.c
+6
-12
No files found.
fs/lockd/clntlock.c
View file @
4f15e2b1
...
@@ -31,7 +31,7 @@ static int reclaimer(void *ptr);
...
@@ -31,7 +31,7 @@ static int reclaimer(void *ptr);
* This is the representation of a blocked client lock.
* This is the representation of a blocked client lock.
*/
*/
struct
nlm_wait
{
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 */
wait_queue_head_t
b_wait
;
/* where to wait on */
struct
nlm_host
*
b_host
;
struct
nlm_host
*
b_host
;
struct
file_lock
*
b_lock
;
/* local file lock */
struct
file_lock
*
b_lock
;
/* local file lock */
...
@@ -39,7 +39,7 @@ struct nlm_wait {
...
@@ -39,7 +39,7 @@ struct nlm_wait {
u32
b_status
;
/* grant callback status */
u32
b_status
;
/* grant callback status */
};
};
static
struct
nlm_wait
*
nlm_blocked
;
static
LIST_HEAD
(
nlm_blocked
)
;
/*
/*
* Block on a lock
* Block on a lock
...
@@ -55,8 +55,7 @@ nlmclnt_block(struct nlm_host *host, struct file_lock *fl, u32 *statp)
...
@@ -55,8 +55,7 @@ nlmclnt_block(struct nlm_host *host, struct file_lock *fl, u32 *statp)
block
.
b_lock
=
fl
;
block
.
b_lock
=
fl
;
init_waitqueue_head
(
&
block
.
b_wait
);
init_waitqueue_head
(
&
block
.
b_wait
);
block
.
b_status
=
NLM_LCK_BLOCKED
;
block
.
b_status
=
NLM_LCK_BLOCKED
;
block
.
b_next
=
nlm_blocked
;
list_add
(
&
block
.
b_list
,
&
nlm_blocked
);
nlm_blocked
=
&
block
;
/* Remember pseudo nsm state */
/* Remember pseudo nsm state */
pstate
=
host
->
h_state
;
pstate
=
host
->
h_state
;
...
@@ -71,12 +70,7 @@ nlmclnt_block(struct nlm_host *host, struct file_lock *fl, u32 *statp)
...
@@ -71,12 +70,7 @@ nlmclnt_block(struct nlm_host *host, struct file_lock *fl, u32 *statp)
*/
*/
sleep_on_timeout
(
&
block
.
b_wait
,
30
*
HZ
);
sleep_on_timeout
(
&
block
.
b_wait
,
30
*
HZ
);
for
(
head
=
&
nlm_blocked
;
*
head
;
head
=
&
(
*
head
)
->
b_next
)
{
list_del
(
&
block
.
b_list
);
if
(
*
head
==
&
block
)
{
*
head
=
block
.
b_next
;
break
;
}
}
if
(
!
signalled
())
{
if
(
!
signalled
())
{
*
statp
=
block
.
b_status
;
*
statp
=
block
.
b_status
;
...
@@ -105,7 +99,7 @@ nlmclnt_grant(struct nlm_lock *lock)
...
@@ -105,7 +99,7 @@ nlmclnt_grant(struct nlm_lock *lock)
* Look up blocked request based on arguments.
* Look up blocked request based on arguments.
* Warning: must not use cookie to match it!
* Warning: must not use cookie to match it!
*/
*/
for
(
block
=
nlm_blocked
;
block
;
block
=
block
->
b_nex
t
)
{
list_for_each_entry
(
block
,
&
nlm_blocked
,
b_lis
t
)
{
if
(
nlm_compare_locks
(
block
->
b_lock
,
&
lock
->
fl
))
if
(
nlm_compare_locks
(
block
->
b_lock
,
&
lock
->
fl
))
break
;
break
;
}
}
...
@@ -230,7 +224,7 @@ reclaimer(void *ptr)
...
@@ -230,7 +224,7 @@ reclaimer(void *ptr)
host
->
h_reclaiming
=
0
;
host
->
h_reclaiming
=
0
;
/* Now, wake up all processes that sleep on a blocked lock */
/* Now, wake up all processes that sleep on a blocked lock */
for
(
block
=
nlm_blocked
;
block
;
block
=
block
->
b_nex
t
)
{
list_for_each_entry
(
block
,
&
nlm_blocked
,
b_lis
t
)
{
if
(
block
->
b_host
==
host
)
{
if
(
block
->
b_host
==
host
)
{
block
->
b_status
=
NLM_LCK_DENIED_GRACE_PERIOD
;
block
->
b_status
=
NLM_LCK_DENIED_GRACE_PERIOD
;
wake_up
(
&
block
->
b_wait
);
wake_up
(
&
block
->
b_wait
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment