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
b42353ff
Commit
b42353ff
authored
Jun 05, 2012
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSv4.1: Clean up nfs4_reclaim_lease
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
1a47e7a6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
17 deletions
+35
-17
fs/nfs/nfs4state.c
fs/nfs/nfs4state.c
+35
-17
No files found.
fs/nfs/nfs4state.c
View file @
b42353ff
...
...
@@ -1642,7 +1642,7 @@ static int nfs4_handle_reclaim_lease_error(struct nfs_client *clp, int status)
return
0
;
}
static
int
nfs4_
reclaim
_lease
(
struct
nfs_client
*
clp
)
static
int
nfs4_
establish
_lease
(
struct
nfs_client
*
clp
)
{
struct
rpc_cred
*
cred
;
const
struct
nfs4_state_recovery_ops
*
ops
=
...
...
@@ -1655,7 +1655,37 @@ static int nfs4_reclaim_lease(struct nfs_client *clp)
status
=
ops
->
establish_clid
(
clp
,
cred
);
put_rpccred
(
cred
);
if
(
status
!=
0
)
return
status
;
pnfs_destroy_all_layouts
(
clp
);
return
0
;
}
static
int
nfs4_reclaim_lease
(
struct
nfs_client
*
clp
)
{
int
status
;
status
=
nfs4_establish_lease
(
clp
);
if
(
status
<
0
)
return
nfs4_handle_reclaim_lease_error
(
clp
,
status
);
if
(
test_and_clear_bit
(
NFS4CLNT_SERVER_SCOPE_MISMATCH
,
&
clp
->
cl_state
))
nfs4_state_start_reclaim_nograce
(
clp
);
if
(
!
test_bit
(
NFS4CLNT_RECLAIM_NOGRACE
,
&
clp
->
cl_state
))
set_bit
(
NFS4CLNT_RECLAIM_REBOOT
,
&
clp
->
cl_state
);
clear_bit
(
NFS4CLNT_CHECK_LEASE
,
&
clp
->
cl_state
);
clear_bit
(
NFS4CLNT_LEASE_EXPIRED
,
&
clp
->
cl_state
);
return
0
;
}
static
int
nfs4_purge_lease
(
struct
nfs_client
*
clp
)
{
int
status
;
status
=
nfs4_establish_lease
(
clp
);
if
(
status
<
0
)
return
nfs4_handle_reclaim_lease_error
(
clp
,
status
);
clear_bit
(
NFS4CLNT_PURGE_STATE
,
&
clp
->
cl_state
);
set_bit
(
NFS4CLNT_LEASE_EXPIRED
,
&
clp
->
cl_state
);
nfs4_state_start_reclaim_nograce
(
clp
);
return
0
;
}
...
...
@@ -1868,31 +1898,19 @@ static void nfs4_state_manager(struct nfs_client *clp)
do
{
if
(
test_bit
(
NFS4CLNT_PURGE_STATE
,
&
clp
->
cl_state
))
{
section
=
"purge state"
;
status
=
nfs4_
reclaim
_lease
(
clp
);
status
=
nfs4_
purge
_lease
(
clp
);
if
(
status
<
0
)
goto
out_error
;
clear_bit
(
NFS4CLNT_PURGE_STATE
,
&
clp
->
cl_state
);
set_bit
(
NFS4CLNT_LEASE_EXPIRED
,
&
clp
->
cl_state
);
continue
;
}
if
(
test_
and_clear_
bit
(
NFS4CLNT_LEASE_EXPIRED
,
&
clp
->
cl_state
))
{
if
(
test_bit
(
NFS4CLNT_LEASE_EXPIRED
,
&
clp
->
cl_state
))
{
section
=
"lease expired"
;
/* We're going to have to re-establish a clientid */
status
=
nfs4_reclaim_lease
(
clp
);
if
(
status
<
0
)
goto
out_error
;
if
(
test_bit
(
NFS4CLNT_LEASE_EXPIRED
,
&
clp
->
cl_state
))
continue
;
clear_bit
(
NFS4CLNT_CHECK_LEASE
,
&
clp
->
cl_state
);
if
(
test_and_clear_bit
(
NFS4CLNT_SERVER_SCOPE_MISMATCH
,
&
clp
->
cl_state
))
nfs4_state_start_reclaim_nograce
(
clp
);
else
set_bit
(
NFS4CLNT_RECLAIM_REBOOT
,
&
clp
->
cl_state
);
pnfs_destroy_all_layouts
(
clp
);
}
if
(
test_and_clear_bit
(
NFS4CLNT_CHECK_LEASE
,
&
clp
->
cl_state
))
{
...
...
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