diff options
author | J. Bruce Fields <bfields@redhat.com> | 2013-03-14 18:24:52 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2013-04-03 11:48:37 -0400 |
commit | bfa85e83a87aec71cbb231256eaad7341aa8b4fa (patch) | |
tree | 679776c8bd9141e5f7cad1bd839a98a482b690a6 /fs/nfsd | |
parent | c0293b0131a8d582af85023c684786f7536f0767 (diff) |
nfsd4: clientid lookup cleanup
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4state.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 905a5b511047..c89bb3c40a0b 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -1380,12 +1380,12 @@ move_to_confirmed(struct nfs4_client *clp) | |||
1380 | } | 1380 | } |
1381 | 1381 | ||
1382 | static struct nfs4_client * | 1382 | static struct nfs4_client * |
1383 | find_confirmed_client(clientid_t *clid, bool sessions, struct nfsd_net *nn) | 1383 | find_client_in_id_table(struct list_head *tbl, clientid_t *clid, bool sessions) |
1384 | { | 1384 | { |
1385 | struct nfs4_client *clp; | 1385 | struct nfs4_client *clp; |
1386 | unsigned int idhashval = clientid_hashval(clid->cl_id); | 1386 | unsigned int idhashval = clientid_hashval(clid->cl_id); |
1387 | 1387 | ||
1388 | list_for_each_entry(clp, &nn->conf_id_hashtbl[idhashval], cl_idhash) { | 1388 | list_for_each_entry(clp, &tbl[idhashval], cl_idhash) { |
1389 | if (same_clid(&clp->cl_clientid, clid)) { | 1389 | if (same_clid(&clp->cl_clientid, clid)) { |
1390 | if ((bool)clp->cl_minorversion != sessions) | 1390 | if ((bool)clp->cl_minorversion != sessions) |
1391 | return NULL; | 1391 | return NULL; |
@@ -1397,19 +1397,19 @@ find_confirmed_client(clientid_t *clid, bool sessions, struct nfsd_net *nn) | |||
1397 | } | 1397 | } |
1398 | 1398 | ||
1399 | static struct nfs4_client * | 1399 | static struct nfs4_client * |
1400 | find_confirmed_client(clientid_t *clid, bool sessions, struct nfsd_net *nn) | ||
1401 | { | ||
1402 | struct list_head *tbl = nn->conf_id_hashtbl; | ||
1403 | |||
1404 | return find_client_in_id_table(tbl, clid, sessions); | ||
1405 | } | ||
1406 | |||
1407 | static struct nfs4_client * | ||
1400 | find_unconfirmed_client(clientid_t *clid, bool sessions, struct nfsd_net *nn) | 1408 | find_unconfirmed_client(clientid_t *clid, bool sessions, struct nfsd_net *nn) |
1401 | { | 1409 | { |
1402 | struct nfs4_client *clp; | 1410 | struct list_head *tbl = nn->unconf_id_hashtbl; |
1403 | unsigned int idhashval = clientid_hashval(clid->cl_id); | ||
1404 | 1411 | ||
1405 | list_for_each_entry(clp, &nn->unconf_id_hashtbl[idhashval], cl_idhash) { | 1412 | return find_client_in_id_table(tbl, clid, sessions); |
1406 | if (same_clid(&clp->cl_clientid, clid)) { | ||
1407 | if ((bool)clp->cl_minorversion != sessions) | ||
1408 | return NULL; | ||
1409 | return clp; | ||
1410 | } | ||
1411 | } | ||
1412 | return NULL; | ||
1413 | } | 1413 | } |
1414 | 1414 | ||
1415 | static bool clp_used_exchangeid(struct nfs4_client *clp) | 1415 | static bool clp_used_exchangeid(struct nfs4_client *clp) |