diff options
author | J. Bruce Fields <bfields@redhat.com> | 2010-11-24 17:17:34 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2010-12-17 15:47:41 -0500 |
commit | 6e5f15c93dc745d46c2bb9e4597b44463203844b (patch) | |
tree | 9190dba16b3c1a6368c30811f65636a38cf9bfaa /fs/nfsd/nfs4state.c | |
parent | ec66ee3797e5848356cf593c6ec7aabf30a00cf1 (diff) |
nfsd4: replace unintuitive match_clientid_establishment
Reviewed-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r-- | fs/nfsd/nfs4state.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 4d542cfd6960..0c61cc1eadca 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -1135,19 +1135,13 @@ find_unconfirmed_client(clientid_t *clid) | |||
1135 | } | 1135 | } |
1136 | 1136 | ||
1137 | /* | 1137 | /* |
1138 | * Return 1 iff clp's clientid establishment method matches the use_exchange_id | ||
1139 | * parameter. Matching is based on the fact the at least one of the | ||
1140 | * EXCHGID4_FLAG_USE_{NON_PNFS,PNFS_MDS,PNFS_DS} flags must be set for v4.1 | ||
1141 | * | ||
1142 | * FIXME: we need to unify the clientid namespaces for nfsv4.x | 1138 | * FIXME: we need to unify the clientid namespaces for nfsv4.x |
1143 | * and correctly deal with client upgrade/downgrade in EXCHANGE_ID | 1139 | * and correctly deal with client upgrade/downgrade in EXCHANGE_ID |
1144 | * and SET_CLIENTID{,_CONFIRM} | 1140 | * and SET_CLIENTID{,_CONFIRM} |
1145 | */ | 1141 | */ |
1146 | static inline int | 1142 | static bool clp_used_exchangeid(struct nfs4_client *clp) |
1147 | match_clientid_establishment(struct nfs4_client *clp, bool use_exchange_id) | ||
1148 | { | 1143 | { |
1149 | bool has_exchange_flags = (clp->cl_exchange_flags != 0); | 1144 | return clp->cl_exchange_flags != 0; |
1150 | return use_exchange_id == has_exchange_flags; | ||
1151 | } | 1145 | } |
1152 | 1146 | ||
1153 | static struct nfs4_client * | 1147 | static struct nfs4_client * |
@@ -1158,7 +1152,7 @@ find_confirmed_client_by_str(const char *dname, unsigned int hashval, | |||
1158 | 1152 | ||
1159 | list_for_each_entry(clp, &conf_str_hashtbl[hashval], cl_strhash) { | 1153 | list_for_each_entry(clp, &conf_str_hashtbl[hashval], cl_strhash) { |
1160 | if (same_name(clp->cl_recdir, dname) && | 1154 | if (same_name(clp->cl_recdir, dname) && |
1161 | match_clientid_establishment(clp, use_exchange_id)) | 1155 | clp_used_exchangeid(clp) == use_exchange_id) |
1162 | return clp; | 1156 | return clp; |
1163 | } | 1157 | } |
1164 | return NULL; | 1158 | return NULL; |
@@ -1172,7 +1166,7 @@ find_unconfirmed_client_by_str(const char *dname, unsigned int hashval, | |||
1172 | 1166 | ||
1173 | list_for_each_entry(clp, &unconf_str_hashtbl[hashval], cl_strhash) { | 1167 | list_for_each_entry(clp, &unconf_str_hashtbl[hashval], cl_strhash) { |
1174 | if (same_name(clp->cl_recdir, dname) && | 1168 | if (same_name(clp->cl_recdir, dname) && |
1175 | match_clientid_establishment(clp, use_exchange_id)) | 1169 | clp_used_exchangeid(clp) == use_exchange_id) |
1176 | return clp; | 1170 | return clp; |
1177 | } | 1171 | } |
1178 | return NULL; | 1172 | return NULL; |