lu_device_put(lud);
th->th_dev = NULL;
- lu_context_exit(&th->th_ctx);
- lu_context_fini(&th->th_ctx);
OBD_FREE_PTR(oh);
EXIT;
/* add commit callback */
dmu_tx_callback_register(oh->ot_tx, osd_trans_commit_cb, oh);
oh->ot_assigned = 1;
- lu_context_init(&th->th_ctx, th->th_tags);
- lu_context_enter(&th->th_ctx);
lu_device_get(&d->dd_lu_dev);
}
th = &oh->ot_super;
th->th_dev = dt;
th->th_result = 0;
- th->th_tags = LCT_TX_HANDLE;
RETURN(th);
}
osd->od_prop_rdonly = !!newval;
}
+static void osd_dnodesize_changed_cb(void *arg, uint64_t newval)
+{
+ struct osd_device *osd = arg;
+
+ osd->od_dnsize = newval;
+}
+
/*
* This function unregisters all registered callbacks. It's harmless to
* unregister callbacks that were never registered so it is used to safely
osd_recordsize_changed_cb, o);
(void) dsl_prop_unregister(ds, zfs_prop_to_name(ZFS_PROP_READONLY),
osd_readonly_changed_cb, o);
+ (void) dsl_prop_unregister(ds, zfs_prop_to_name(ZFS_PROP_DNODESIZE),
+ osd_readonly_changed_cb, o);
if (o->arc_prune_cb != NULL) {
arc_remove_prune_callback(o->arc_prune_cb);
if (rc)
GOTO(err, rc);
+ rc = -dsl_prop_register(ds, zfs_prop_to_name(ZFS_PROP_DNODESIZE),
+ osd_dnodesize_changed_cb, o);
+ if (rc)
+ GOTO(err, rc);
+
o->arc_prune_cb = arc_add_prune_callback(arc_prune_func, o);
err:
dsl_pool_config_exit(dp, FTAG);
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;
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;
}
if (rc)
GOTO(err, rc);
+#ifdef ZFS_PROJINHERIT
+ if (dmu_objset_projectquota_enabled(o->od_os)) {
+ rc = __osd_obj2dnode(o->od_os, DMU_PROJECTUSED_OBJECT,
+ &o->od_projectused_dn);
+ if (rc && rc != -ENOENT)
+ GOTO(err, rc);
+ }
+#endif
+
/* 1. initialize oi before any file create or file open */
rc = osd_oi_init(env, o);
if (rc)
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)
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;
}
o->od_groupused_dn = NULL;
}
+#ifdef ZFS_PROJINHERIT
+ if (o->od_projectused_dn) {
+ osd_dnode_rele(o->od_projectused_dn);
+ o->od_projectused_dn = NULL;
+ }
+#endif
+
if (o->od_os != NULL) {
if (!o->od_dt_dev.dd_rdonly)
/* force a txg sync to get all commit callbacks */
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;
}