don't hash a export pointer as string.
check a situation when we don't delete a export from nodemap
hash.
Signed-off-by: Alexey Lyashkov <alexey_lyashkov@xyratex.com>
Change-Id: Id53281078f165ce984abebc74992bde30fcc9f31
Reviewed-on: http://review.whamcloud.com/12881
Tested-by: Jenkins
Reviewed-by: Andrew Perepechko <andrew_perepechko@xyratex.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Kit Westneat <kit.westneat@gmail.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
static __u32 nm_member_hashfn(cfs_hash_t *hash_body,
const void *key, unsigned mask)
{
static __u32 nm_member_hashfn(cfs_hash_t *hash_body,
const void *key, unsigned mask)
{
- return cfs_hash_djb2_hash(key, strlen(key), mask);
+ return hash_long((unsigned long)key, hash_body->hs_bkt_bits) & mask;
}
static void *nm_member_hs_key(struct hlist_node *hnode)
}
static void *nm_member_hs_key(struct hlist_node *hnode)
*/
void nm_member_del(struct lu_nodemap *nodemap, struct obd_export *exp)
{
*/
void nm_member_del(struct lu_nodemap *nodemap, struct obd_export *exp)
{
+ struct obd_export *exp1;
- exp->exp_target_data.ted_nodemap = NULL;
- exp = cfs_hash_del_key(nodemap->nm_member_hash, exp);
- if (exp == NULL)
- return;
+ exp1 = cfs_hash_del_key(nodemap->nm_member_hash, exp);
+ if (exp1 != NULL)
+ class_export_put(exp1);
+ LASSERT(hlist_unhashed(&exp->exp_target_data.ted_nodemap_member));
+ exp->exp_target_data.ted_nodemap = NULL;
}
static cfs_hash_ops_t nm_member_hash_operations = {
}
static cfs_hash_ops_t nm_member_hash_operations = {