Whamcloud - gitweb
LU-7904 osd: honor LOC_F_NEW 89/19089/7
authorAlex Zhuravlev <alexey.zhuravlev@intel.com>
Wed, 23 Mar 2016 12:37:57 +0000 (15:37 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 4 May 2016 15:01:49 +0000 (15:01 +0000)
the caller passes this flag to ensure OSD that the object being
initialized is new so OSD can skip save on lookup in OI.

Change-Id: Iaebc23071420f812571c7652a9f29a7e9fc7b67e
Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-on: http://review.whamcloud.com/19089
Tested-by: Jenkins
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osd-zfs/osd_object.c

index f00d454..fa9ec89 100644 (file)
@@ -417,6 +417,9 @@ static int osd_object_init(const struct lu_env *env, struct lu_object *l,
                RETURN(0);
        }
 
                RETURN(0);
        }
 
+       if (conf != NULL && conf->loc_flags & LOC_F_NEW)
+               GOTO(out, rc = 0);
+
        rc = osd_fid_lookup(env, osd, lu_object_fid(l), &oid);
        if (rc == 0) {
                LASSERT(obj->oo_db == NULL);
        rc = osd_fid_lookup(env, osd, lu_object_fid(l), &oid);
        if (rc == 0) {
                LASSERT(obj->oo_db == NULL);