diff options
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/nfs4proc.c | 59 |
1 files changed, 22 insertions, 37 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index d9f4d78c3413..a64aa56e140a 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -5021,23 +5021,6 @@ out: | |||
5021 | return ret; | 5021 | return ret; |
5022 | } | 5022 | } |
5023 | 5023 | ||
5024 | /* | ||
5025 | * Reset the forechannel and backchannel slot tables | ||
5026 | */ | ||
5027 | static int nfs4_reset_slot_tables(struct nfs4_session *session) | ||
5028 | { | ||
5029 | int status; | ||
5030 | |||
5031 | status = nfs4_reset_slot_table(&session->fc_slot_table, | ||
5032 | session->fc_attrs.max_reqs, 1); | ||
5033 | if (status) | ||
5034 | return status; | ||
5035 | |||
5036 | status = nfs4_reset_slot_table(&session->bc_slot_table, | ||
5037 | session->bc_attrs.max_reqs, 0); | ||
5038 | return status; | ||
5039 | } | ||
5040 | |||
5041 | /* Destroy the slot table */ | 5024 | /* Destroy the slot table */ |
5042 | static void nfs4_destroy_slot_tables(struct nfs4_session *session) | 5025 | static void nfs4_destroy_slot_tables(struct nfs4_session *session) |
5043 | { | 5026 | { |
@@ -5083,29 +5066,35 @@ out: | |||
5083 | } | 5066 | } |
5084 | 5067 | ||
5085 | /* | 5068 | /* |
5086 | * Initialize the forechannel and backchannel tables | 5069 | * Initialize or reset the forechannel and backchannel tables |
5087 | */ | 5070 | */ |
5088 | static int nfs4_init_slot_tables(struct nfs4_session *session) | 5071 | static int nfs4_setup_session_slot_tables(struct nfs4_session *ses) |
5089 | { | 5072 | { |
5090 | struct nfs4_slot_table *tbl; | 5073 | struct nfs4_slot_table *tbl; |
5091 | int status = 0; | 5074 | int status; |
5092 | 5075 | ||
5093 | tbl = &session->fc_slot_table; | 5076 | dprintk("--> %s\n", __func__); |
5077 | /* Fore channel */ | ||
5078 | tbl = &ses->fc_slot_table; | ||
5094 | if (tbl->slots == NULL) { | 5079 | if (tbl->slots == NULL) { |
5095 | status = nfs4_init_slot_table(tbl, | 5080 | status = nfs4_init_slot_table(tbl, ses->fc_attrs.max_reqs, 1); |
5096 | session->fc_attrs.max_reqs, 1); | 5081 | if (status) /* -ENOMEM */ |
5082 | return status; | ||
5083 | } else { | ||
5084 | status = nfs4_reset_slot_table(tbl, ses->fc_attrs.max_reqs, 1); | ||
5097 | if (status) | 5085 | if (status) |
5098 | return status; | 5086 | return status; |
5099 | } | 5087 | } |
5100 | 5088 | /* Back channel */ | |
5101 | tbl = &session->bc_slot_table; | 5089 | tbl = &ses->bc_slot_table; |
5102 | if (tbl->slots == NULL) { | 5090 | if (tbl->slots == NULL) { |
5103 | status = nfs4_init_slot_table(tbl, | 5091 | status = nfs4_init_slot_table(tbl, ses->bc_attrs.max_reqs, 0); |
5104 | session->bc_attrs.max_reqs, 0); | ||
5105 | if (status) | 5092 | if (status) |
5106 | nfs4_destroy_slot_tables(session); | 5093 | /* Fore and back channel share a connection so get |
5107 | } | 5094 | * both slot tables or neither */ |
5108 | 5095 | nfs4_destroy_slot_tables(ses); | |
5096 | } else | ||
5097 | status = nfs4_reset_slot_table(tbl, ses->bc_attrs.max_reqs, 0); | ||
5109 | return status; | 5098 | return status; |
5110 | } | 5099 | } |
5111 | 5100 | ||
@@ -5293,13 +5282,9 @@ int nfs4_proc_create_session(struct nfs_client *clp) | |||
5293 | if (status) | 5282 | if (status) |
5294 | goto out; | 5283 | goto out; |
5295 | 5284 | ||
5296 | /* Init and reset the fore channel */ | 5285 | /* Init or reset the session slot tables */ |
5297 | status = nfs4_init_slot_tables(session); | 5286 | status = nfs4_setup_session_slot_tables(session); |
5298 | dprintk("slot table initialization returned %d\n", status); | 5287 | dprintk("slot table setup returned %d\n", status); |
5299 | if (status) | ||
5300 | goto out; | ||
5301 | status = nfs4_reset_slot_tables(session); | ||
5302 | dprintk("slot table reset returned %d\n", status); | ||
5303 | if (status) | 5288 | if (status) |
5304 | goto out; | 5289 | goto out; |
5305 | 5290 | ||