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
0dcee8bb
Commit
0dcee8bb
authored
Jan 10, 2017
by
Anna Schumaker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFS: Handle setup sequence task rescheduling in a single place
Signed-off-by:
Anna Schumaker
<
Anna.Schumaker@Netapp.com
>
parent
6994cdd7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
22 deletions
+15
-22
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+15
-22
No files found.
fs/nfs/nfs4proc.c
View file @
0dcee8bb
...
...
@@ -630,27 +630,19 @@ static int nfs40_setup_sequence(struct nfs4_slot_table *tbl,
struct
nfs4_slot
*
slot
;
if
(
nfs4_slot_tbl_draining
(
tbl
)
&&
!
args
->
sa_privileged
)
goto
out_sleep
;
return
-
EAGAIN
;
slot
=
nfs4_alloc_slot
(
tbl
);
if
(
IS_ERR
(
slot
))
{
if
(
slot
==
ERR_PTR
(
-
ENOMEM
))
task
->
tk_timeout
=
HZ
>>
2
;
goto
out_sleep
;
return
-
EAGAIN
;
}
slot
->
privileged
=
args
->
sa_privileged
?
1
:
0
;
args
->
sa_slot
=
slot
;
res
->
sr_slot
=
slot
;
return
0
;
out_sleep:
if
(
args
->
sa_privileged
)
rpc_sleep_on_priority
(
&
tbl
->
slot_tbl_waitq
,
task
,
NULL
,
RPC_PRIORITY_PRIVILEGED
);
else
rpc_sleep_on
(
&
tbl
->
slot_tbl_waitq
,
task
,
NULL
);
return
-
EAGAIN
;
}
static
void
nfs40_sequence_free_slot
(
struct
nfs4_sequence_res
*
res
)
...
...
@@ -888,7 +880,7 @@ static int nfs41_setup_sequence(struct nfs4_session *session,
!
args
->
sa_privileged
)
{
/* The state manager will wait until the slot table is empty */
dprintk
(
"%s session is draining
\n
"
,
__func__
);
goto
out_sleep
;
return
-
EAGAIN
;
}
slot
=
nfs4_alloc_slot
(
tbl
);
...
...
@@ -897,7 +889,7 @@ static int nfs41_setup_sequence(struct nfs4_session *session,
if
(
slot
==
ERR_PTR
(
-
ENOMEM
))
task
->
tk_timeout
=
HZ
>>
2
;
dprintk
(
"<-- %s: no free slots
\n
"
,
__func__
);
goto
out_sleep
;
return
-
EAGAIN
;
}
slot
->
privileged
=
args
->
sa_privileged
?
1
:
0
;
...
...
@@ -916,14 +908,6 @@ static int nfs41_setup_sequence(struct nfs4_session *session,
res
->
sr_status
=
1
;
trace_nfs4_setup_sequence
(
session
,
args
);
return
0
;
out_sleep:
/* Privileged tasks are queued with top priority */
if
(
args
->
sa_privileged
)
rpc_sleep_on_priority
(
&
tbl
->
slot_tbl_waitq
,
task
,
NULL
,
RPC_PRIORITY_PRIVILEGED
);
else
rpc_sleep_on
(
&
tbl
->
slot_tbl_waitq
,
task
,
NULL
);
return
-
EAGAIN
;
}
static
void
nfs41_call_sync_prepare
(
struct
rpc_task
*
task
,
void
*
calldata
)
...
...
@@ -993,13 +977,22 @@ int nfs4_setup_sequence(const struct nfs_client *client,
#endif
/* CONFIG_NFS_V4_1 */
ret
=
nfs40_setup_sequence
(
client
->
cl_slot_tbl
,
args
,
res
,
task
);
if
(
ret
==
-
EAGAIN
)
goto
out_sleep
;
spin_unlock
(
&
tbl
->
slot_tbl_lock
);
if
(
ret
<
0
)
return
ret
;
out_start:
rpc_call_start
(
task
);
return
0
;
out_sleep:
if
(
args
->
sa_privileged
)
rpc_sleep_on_priority
(
&
tbl
->
slot_tbl_waitq
,
task
,
NULL
,
RPC_PRIORITY_PRIVILEGED
);
else
rpc_sleep_on
(
&
tbl
->
slot_tbl_waitq
,
task
,
NULL
);
spin_unlock
(
&
tbl
->
slot_tbl_lock
);
return
-
EAGAIN
;
}
EXPORT_SYMBOL_GPL
(
nfs4_setup_sequence
);
...
...
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