From: Alex Zhuravlev Date: Sat, 19 Mar 2016 19:17:26 +0000 (+0300) Subject: LU-7900 obdclass: lu_object_assign_fid() do not lookup X-Git-Tag: 2.8.56~70 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=b2d6651eda081139cb168069d256b651a5435781 LU-7900 obdclass: lu_object_assign_fid() do not lookup as the object is supposed to be new and unique by definition. this method is used only with OST objects being created on MDT. Change-Id: I9e641ab208654ea64eb42394a3618c9f30e7d751 Signed-off-by: Alex Zhuravlev Reviewed-on: http://review.whamcloud.com/19081 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Niu Yawei Reviewed-by: Mike Pershin Reviewed-by: Oleg Drokin --- diff --git a/lustre/obdclass/lu_object.c b/lustre/obdclass/lu_object.c index f76917c..e8c976d 100644 --- a/lustre/obdclass/lu_object.c +++ b/lustre/obdclass/lu_object.c @@ -2296,19 +2296,24 @@ void lu_object_assign_fid(const struct lu_env *env, struct lu_object *o, { struct lu_site *s = o->lo_dev->ld_site; struct lu_fid *old = &o->lo_header->loh_fid; - struct lu_object *shadow; - wait_queue_t waiter; struct cfs_hash *hs; struct cfs_hash_bd bd; - __u64 version = 0; LASSERT(fid_is_zero(old)); + /* supposed to be unique */ hs = s->ls_obj_hash; cfs_hash_bd_get_and_lock(hs, (void *)fid, &bd, 1); - shadow = htable_lookup(s, &bd, fid, &waiter, &version); - /* supposed to be unique */ - LASSERT(IS_ERR(shadow) && PTR_ERR(shadow) == -ENOENT); +#ifdef CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK + { + __u64 version = 0; + wait_queue_t waiter; + struct lu_object *shadow; + shadow = htable_lookup(s, &bd, fid, &waiter, &version); + /* supposed to be unique */ + LASSERT(IS_ERR(shadow) && PTR_ERR(shadow) == -ENOENT); + } +#endif *old = *fid; cfs_hash_bd_add_locked(hs, &bd, &o->lo_header->loh_hash); cfs_hash_bd_unlock(hs, &bd, 1);