X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fosd-zfs%2Fosd_object.c;h=b53490677a91455c4d3fa242f8a718133716079c;hb=9765c6174ef580fb4deef4e7faea6d5ed634b00f;hp=f00d4545a71561198c10b5016fb64bc0f67747b2;hpb=f21b415d15eda21aa7f489242b0eb844b968be7a;p=fs%2Flustre-release.git diff --git a/lustre/osd-zfs/osd_object.c b/lustre/osd-zfs/osd_object.c index f00d454..b534906 100644 --- a/lustre/osd-zfs/osd_object.c +++ b/lustre/osd-zfs/osd_object.c @@ -417,6 +417,9 @@ static int osd_object_init(const struct lu_env *env, struct lu_object *l, 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); @@ -795,7 +798,7 @@ static inline int qsd_transfer(const struct lu_env *env, if (unlikely(qsd == NULL)) return 0; - LASSERT(qtype >= 0 && qtype < MAXQUOTAS); + LASSERT(qtype >= 0 && qtype < LL_MAXQUOTAS); qi->lqi_type = qtype; /* inode accounting */ @@ -1290,9 +1293,8 @@ int __osd_object_create(const struct lu_env *env, struct osd_object *obj, fid_seq_is_local_file(fid_seq(fid)))) type = DMU_OTN_UINT8_METADATA; - /* Create a new DMU object. */ - oid = dmu_object_alloc(osd->od_os, type, 0, - DMU_OT_SA, DN_MAX_BONUSLEN, tx); + /* Create a new DMU object using the default dnode size. */ + oid = osd_dmu_object_alloc(osd->od_os, type, 0, 0, tx); rc = -sa_buf_hold(osd->od_os, oid, osd_obj_tag, dbp); LASSERTF(rc == 0, "sa_buf_hold "LPU64" failed: %d\n", oid, rc); @@ -1332,11 +1334,11 @@ int __osd_zap_create(const struct lu_env *env, struct osd_device *osd, transaction group. */ LASSERT(tx->tx_txg != 0); - oid = zap_create_flags(osd->od_os, 0, flags | ZAP_FLAG_HASH64, - DMU_OT_DIRECTORY_CONTENTS, - 14, /* == ZFS fzap_default_block_shift */ - DN_MAX_INDBLKSHIFT, /* indirect block shift */ - DMU_OT_SA, DN_MAX_BONUSLEN, tx); + oid = osd_zap_create_flags(osd->od_os, 0, flags | ZAP_FLAG_HASH64, + DMU_OT_DIRECTORY_CONTENTS, + 14, /* == ZFS fzap_default_blockshift */ + DN_MAX_INDBLKSHIFT, /* indirect blockshift */ + 0, tx); rc = -sa_buf_hold(osd->od_os, oid, osd_obj_tag, zap_dbp); if (rc) @@ -1387,8 +1389,9 @@ static dmu_buf_t *osd_mkreg(const struct lu_env *env, struct osd_object *obj, struct lu_attr *la, uint64_t parent, struct osd_thandle *oh) { - dmu_buf_t *db; - int rc; + const struct lu_fid *fid = lu_object_fid(&obj->oo_dt.do_lu); + dmu_buf_t *db; + int rc; struct osd_device *osd = osd_obj2dev(obj); LASSERT(S_ISREG(la->la_mode)); @@ -1403,7 +1406,7 @@ static dmu_buf_t *osd_mkreg(const struct lu_env *env, struct osd_object *obj, * blocksize is selected based on the file size rather than the * making broad assumptions based on the osd type. */ - if (!lu_device_is_md(osd2lu_dev(osd))) { + if ((fid_is_idif(fid) || fid_is_norm(fid)) && osd->od_is_ost) { rc = -dmu_object_set_blocksize(osd->od_os, db->db_object, osd->od_max_blksz, 0, oh->ot_tx); if (unlikely(rc)) {