X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fosd-zfs%2Fosd_handler.c;h=25ffbc6882ff6f144e438ed2eeb7312b47826656;hb=bb6ed7dcde71b3878402f1ad4c2d88bc8edd8557;hp=fe41089df03be3a3926f471f4aecd106a098c4ec;hpb=1385dbf8b9caedca7bb32f35db1529e4d5c52d4f;p=fs%2Flustre-release.git diff --git a/lustre/osd-zfs/osd_handler.c b/lustre/osd-zfs/osd_handler.c index fe41089..25ffbc6 100644 --- a/lustre/osd-zfs/osd_handler.c +++ b/lustre/osd-zfs/osd_handler.c @@ -39,7 +39,6 @@ #define DEBUG_SUBSYSTEM S_OSD -#include #include #include #include @@ -47,7 +46,7 @@ #include #include #include -#include +#include #include #include "osd_internal.h" @@ -292,7 +291,7 @@ static int osd_trans_stop(const struct lu_env *env, struct dt_device *dt, if (oh->ot_assigned == 0) { LASSERT(oh->ot_tx); dmu_tx_abort(oh->ot_tx); - osd_object_sa_dirty_rele(oh); + osd_object_sa_dirty_rele(env, oh); osd_unlinked_list_emptify(env, osd, &unlinked, false); /* there won't be any commit, release reserved quota space now, * if any */ @@ -311,7 +310,7 @@ static int osd_trans_stop(const struct lu_env *env, struct dt_device *dt, LASSERT(oh->ot_tx); txg = oh->ot_tx->tx_txg; - osd_object_sa_dirty_rele(oh); + osd_object_sa_dirty_rele(env, oh); /* XXX: Once dmu_tx_commit() called, oh/th could have been freed * by osd_trans_commit_cb already. */ dmu_tx_commit(oh->ot_tx); @@ -357,7 +356,6 @@ static struct thandle *osd_trans_create(const struct lu_env *env, INIT_LIST_HEAD(&oh->ot_stop_dcb_list); INIT_LIST_HEAD(&oh->ot_unlinked_list); INIT_LIST_HEAD(&oh->ot_sa_list); - sema_init(&oh->ot_sa_lock, 1); memset(&oh->ot_quota_trans, 0, sizeof(oh->ot_quota_trans)); th = &oh->ot_super; th->th_dev = dt; @@ -716,6 +714,7 @@ static void osd_key_fini(const struct lu_context *ctx, info->oti_ins_cache = NULL; info->oti_ins_cache_size = 0; } + lu_buf_free(&info->oti_xattr_lbuf); OBD_FREE_PTR(info); } @@ -851,9 +850,10 @@ static int osd_objset_open(struct osd_device *o) int rc; ENTRY; - rc = -dmu_objset_own(o->od_mntdev, DMU_OST_ZFS, + rc = -osd_dmu_objset_own(o->od_mntdev, DMU_OST_ZFS, o->od_dt_dev.dd_rdonly ? B_TRUE : B_FALSE, - o, &o->od_os); + B_FALSE, o, &o->od_os); + if (rc) { CERROR("%s: can't open %s\n", o->od_svname, o->od_mntdev); o->od_os = NULL; @@ -917,7 +917,7 @@ static int osd_objset_open(struct osd_device *o) out: if (rc != 0 && o->od_os != NULL) { - dmu_objset_disown(o->od_os, o); + osd_dmu_objset_disown(o->od_os, B_FALSE, o); o->od_os = NULL; } @@ -1100,6 +1100,13 @@ static int osd_mount(const struct lu_env *env, GOTO(err, rc); } +#ifdef HAVE_DMU_USEROBJ_ACCOUNTING + if (!osd_dmu_userobj_accounting_available(o)) + CWARN("%s: dnode accounting not enabled: " + "enable feature@userobj_accounting in pool\n", + o->od_mntdev); +#endif + /* parse mount option "noacl", and enable ACL by default */ opts = lustre_cfg_string(cfg, 3); if (opts == NULL || strstr(opts, "noacl") == NULL) @@ -1108,7 +1115,7 @@ static int osd_mount(const struct lu_env *env, osd_unlinked_drain(env, o); err: if (rc && o->od_os) { - dmu_objset_disown(o->od_os, o); + osd_dmu_objset_disown(o->od_os, B_FALSE, o); o->od_os = NULL; } @@ -1148,8 +1155,7 @@ static void osd_umount(const struct lu_env *env, struct osd_device *o) txg_wait_synced(dmu_objset_pool(o->od_os), 0ULL); /* close the object set */ - dmu_objset_disown(o->od_os, o); - + osd_dmu_objset_disown(o->od_os, B_FALSE, o); o->od_os = NULL; }