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
Kirill Smelkov
linux
Commits
795a88c9
Commit
795a88c9
authored
Sep 10, 2012
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSv4: Convert the nfs4_lock_state->ls_flags to a bit field
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
2a369153
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
fs/nfs/nfs4_fs.h
fs/nfs/nfs4_fs.h
+2
-2
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+5
-5
fs/nfs/nfs4state.c
fs/nfs/nfs4state.c
+4
-4
No files found.
fs/nfs/nfs4_fs.h
View file @
795a88c9
...
@@ -132,8 +132,8 @@ struct nfs4_lock_owner {
...
@@ -132,8 +132,8 @@ struct nfs4_lock_owner {
struct
nfs4_lock_state
{
struct
nfs4_lock_state
{
struct
list_head
ls_locks
;
/* Other lock stateids */
struct
list_head
ls_locks
;
/* Other lock stateids */
struct
nfs4_state
*
ls_state
;
/* Pointer to open state */
struct
nfs4_state
*
ls_state
;
/* Pointer to open state */
#define NFS_LOCK_INITIALIZED
1
#define NFS_LOCK_INITIALIZED
0
int
ls_flags
;
unsigned
long
ls_flags
;
struct
nfs_seqid_counter
ls_seqid
;
struct
nfs_seqid_counter
ls_seqid
;
nfs4_stateid
ls_stateid
;
nfs4_stateid
ls_stateid
;
atomic_t
ls_count
;
atomic_t
ls_count
;
...
...
fs/nfs/nfs4proc.c
View file @
795a88c9
...
@@ -4395,7 +4395,7 @@ static void nfs4_locku_prepare(struct rpc_task *task, void *data)
...
@@ -4395,7 +4395,7 @@ static void nfs4_locku_prepare(struct rpc_task *task, void *data)
if
(
nfs_wait_on_sequence
(
calldata
->
arg
.
seqid
,
task
)
!=
0
)
if
(
nfs_wait_on_sequence
(
calldata
->
arg
.
seqid
,
task
)
!=
0
)
return
;
return
;
if
(
(
calldata
->
lsp
->
ls_flags
&
NFS_LOCK_INITIALIZED
)
==
0
)
{
if
(
test_bit
(
NFS_LOCK_INITIALIZED
,
&
calldata
->
lsp
->
ls_flags
)
==
0
)
{
/* Note: exit _without_ running nfs4_locku_done */
/* Note: exit _without_ running nfs4_locku_done */
task
->
tk_action
=
NULL
;
task
->
tk_action
=
NULL
;
return
;
return
;
...
@@ -4589,7 +4589,7 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata)
...
@@ -4589,7 +4589,7 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata)
}
}
if
(
data
->
rpc_status
==
0
)
{
if
(
data
->
rpc_status
==
0
)
{
nfs4_stateid_copy
(
&
data
->
lsp
->
ls_stateid
,
&
data
->
res
.
stateid
);
nfs4_stateid_copy
(
&
data
->
lsp
->
ls_stateid
,
&
data
->
res
.
stateid
);
data
->
lsp
->
ls_flags
|=
NFS_LOCK_INITIALIZED
;
set_bit
(
NFS_LOCK_INITIALIZED
,
&
data
->
lsp
->
ls_flags
)
;
renew_lease
(
NFS_SERVER
(
data
->
ctx
->
dentry
->
d_inode
),
data
->
timestamp
);
renew_lease
(
NFS_SERVER
(
data
->
ctx
->
dentry
->
d_inode
),
data
->
timestamp
);
}
}
out:
out:
...
@@ -4636,7 +4636,7 @@ static void nfs4_handle_setlk_error(struct nfs_server *server, struct nfs4_lock_
...
@@ -4636,7 +4636,7 @@ static void nfs4_handle_setlk_error(struct nfs_server *server, struct nfs4_lock_
case
-
NFS4ERR_BAD_STATEID
:
case
-
NFS4ERR_BAD_STATEID
:
lsp
->
ls_seqid
.
flags
&=
~
NFS_SEQID_CONFIRMED
;
lsp
->
ls_seqid
.
flags
&=
~
NFS_SEQID_CONFIRMED
;
if
(
new_lock_owner
!=
0
||
if
(
new_lock_owner
!=
0
||
(
lsp
->
ls_flags
&
NFS_LOCK_INITIALIZED
)
!=
0
)
test_bit
(
NFS_LOCK_INITIALIZED
,
&
lsp
->
ls_flags
)
!=
0
)
nfs4_schedule_stateid_recovery
(
server
,
lsp
->
ls_state
);
nfs4_schedule_stateid_recovery
(
server
,
lsp
->
ls_state
);
break
;
break
;
case
-
NFS4ERR_STALE_STATEID
:
case
-
NFS4ERR_STALE_STATEID
:
...
@@ -4760,7 +4760,7 @@ static int nfs41_check_expired_locks(struct nfs4_state *state)
...
@@ -4760,7 +4760,7 @@ static int nfs41_check_expired_locks(struct nfs4_state *state)
struct
nfs_server
*
server
=
NFS_SERVER
(
state
->
inode
);
struct
nfs_server
*
server
=
NFS_SERVER
(
state
->
inode
);
list_for_each_entry
(
lsp
,
&
state
->
lock_states
,
ls_locks
)
{
list_for_each_entry
(
lsp
,
&
state
->
lock_states
,
ls_locks
)
{
if
(
lsp
->
ls_flags
&
NFS_LOCK_INITIALIZED
)
{
if
(
test_bit
(
NFS_LOCK_INITIALIZED
,
&
lsp
->
ls_flags
)
)
{
status
=
nfs41_test_stateid
(
server
,
&
lsp
->
ls_stateid
);
status
=
nfs41_test_stateid
(
server
,
&
lsp
->
ls_stateid
);
if
(
status
!=
NFS_OK
)
{
if
(
status
!=
NFS_OK
)
{
/* Free the stateid unless the server
/* Free the stateid unless the server
...
@@ -4768,7 +4768,7 @@ static int nfs41_check_expired_locks(struct nfs4_state *state)
...
@@ -4768,7 +4768,7 @@ static int nfs41_check_expired_locks(struct nfs4_state *state)
if
(
status
!=
-
NFS4ERR_BAD_STATEID
)
if
(
status
!=
-
NFS4ERR_BAD_STATEID
)
nfs41_free_stateid
(
server
,
nfs41_free_stateid
(
server
,
&
lsp
->
ls_stateid
);
&
lsp
->
ls_stateid
);
lsp
->
ls_flags
&=
~
NFS_LOCK_INITIALIZED
;
clear_bit
(
NFS_LOCK_INITIALIZED
,
&
lsp
->
ls_flags
)
;
ret
=
status
;
ret
=
status
;
}
}
}
}
...
...
fs/nfs/nfs4state.c
View file @
795a88c9
...
@@ -865,7 +865,7 @@ void nfs4_put_lock_state(struct nfs4_lock_state *lsp)
...
@@ -865,7 +865,7 @@ void nfs4_put_lock_state(struct nfs4_lock_state *lsp)
if
(
list_empty
(
&
state
->
lock_states
))
if
(
list_empty
(
&
state
->
lock_states
))
clear_bit
(
LK_STATE_IN_USE
,
&
state
->
flags
);
clear_bit
(
LK_STATE_IN_USE
,
&
state
->
flags
);
spin_unlock
(
&
state
->
state_lock
);
spin_unlock
(
&
state
->
state_lock
);
if
(
lsp
->
ls_flags
&
NFS_LOCK_INITIALIZED
)
{
if
(
test_bit
(
NFS_LOCK_INITIALIZED
,
&
lsp
->
ls_flags
)
)
{
if
(
nfs4_release_lockowner
(
lsp
)
==
0
)
if
(
nfs4_release_lockowner
(
lsp
)
==
0
)
return
;
return
;
}
}
...
@@ -929,7 +929,7 @@ static bool nfs4_copy_lock_stateid(nfs4_stateid *dst, struct nfs4_state *state,
...
@@ -929,7 +929,7 @@ static bool nfs4_copy_lock_stateid(nfs4_stateid *dst, struct nfs4_state *state,
fl_pid
=
lockowner
->
l_pid
;
fl_pid
=
lockowner
->
l_pid
;
spin_lock
(
&
state
->
state_lock
);
spin_lock
(
&
state
->
state_lock
);
lsp
=
__nfs4_find_lock_state
(
state
,
fl_owner
,
fl_pid
,
NFS4_ANY_LOCK_TYPE
);
lsp
=
__nfs4_find_lock_state
(
state
,
fl_owner
,
fl_pid
,
NFS4_ANY_LOCK_TYPE
);
if
(
lsp
!=
NULL
&&
(
lsp
->
ls_flags
&
NFS_LOCK_INITIALIZED
)
!=
0
)
{
if
(
lsp
!=
NULL
&&
test_bit
(
NFS_LOCK_INITIALIZED
,
&
lsp
->
ls_flags
)
!=
0
)
{
nfs4_stateid_copy
(
dst
,
&
lsp
->
ls_stateid
);
nfs4_stateid_copy
(
dst
,
&
lsp
->
ls_stateid
);
ret
=
true
;
ret
=
true
;
}
}
...
@@ -1297,7 +1297,7 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs
...
@@ -1297,7 +1297,7 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs
if
(
status
>=
0
)
{
if
(
status
>=
0
)
{
spin_lock
(
&
state
->
state_lock
);
spin_lock
(
&
state
->
state_lock
);
list_for_each_entry
(
lock
,
&
state
->
lock_states
,
ls_locks
)
{
list_for_each_entry
(
lock
,
&
state
->
lock_states
,
ls_locks
)
{
if
(
!
(
lock
->
ls_flags
&
NFS_LOCK_INITIALIZED
))
if
(
!
test_bit
(
NFS_LOCK_INITIALIZED
,
&
lock
->
ls_flags
))
pr_warn_ratelimited
(
"NFS: "
pr_warn_ratelimited
(
"NFS: "
"%s: Lock reclaim "
"%s: Lock reclaim "
"failed!
\n
"
,
__func__
);
"failed!
\n
"
,
__func__
);
...
@@ -1369,7 +1369,7 @@ static void nfs4_clear_open_state(struct nfs4_state *state)
...
@@ -1369,7 +1369,7 @@ static void nfs4_clear_open_state(struct nfs4_state *state)
spin_lock
(
&
state
->
state_lock
);
spin_lock
(
&
state
->
state_lock
);
list_for_each_entry
(
lock
,
&
state
->
lock_states
,
ls_locks
)
{
list_for_each_entry
(
lock
,
&
state
->
lock_states
,
ls_locks
)
{
lock
->
ls_seqid
.
flags
=
0
;
lock
->
ls_seqid
.
flags
=
0
;
lock
->
ls_flags
&=
~
NFS_LOCK_INITIALIZED
;
clear_bit
(
NFS_LOCK_INITIALIZED
,
&
lock
->
ls_flags
)
;
}
}
spin_unlock
(
&
state
->
state_lock
);
spin_unlock
(
&
state
->
state_lock
);
}
}
...
...
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