+ return count;
+}
+LUSTRE_RW_ATTR(dom_stripesize_max_kb);
+
+/**
+ * Show DoM default stripe size.
+ */
+static ssize_t dom_stripesize_cur_kb_show(struct kobject *kobj,
+ struct attribute *attr,
+ char *buf)
+{
+ struct dt_device *dt = container_of(kobj, struct dt_device, dd_kobj);
+ struct lod_device *lod = dt2lod_dev(dt);
+
+ return snprintf(buf, PAGE_SIZE, "%u\n", lod->lod_dom_stripesize_cur_kb);
+}
+
+LUSTRE_RO_ATTR(dom_stripesize_cur_kb);
+
+/**
+ * Show DoM threshold.
+ */
+static ssize_t dom_threshold_free_mb_show(struct kobject *kobj,
+ struct attribute *attr, char *buf)
+{
+ struct dt_device *dt = container_of(kobj, struct dt_device, dd_kobj);
+ struct lod_device *lod = dt2lod_dev(dt);
+
+ return snprintf(buf, PAGE_SIZE, "%llu\n",
+ lod->lod_dom_threshold_free_mb);
+}
+
+/**
+ * Set DoM default stripe size.
+ */
+static ssize_t dom_threshold_free_mb_store(struct kobject *kobj,
+ struct attribute *attr,
+ const char *buffer, size_t count)
+{
+ struct dt_device *dt = container_of(kobj, struct dt_device, dd_kobj);
+ struct lod_device *lod = dt2lod_dev(dt);
+ u64 val;
+ int rc;
+ char *pct;
+
+ pct = strnchr(buffer, count, '%');
+ if (pct) {
+ rc = string_to_size(&val, buffer, pct - buffer);
+ if (rc < 0)
+ return rc;
+ val = mult_frac(lod->lod_lsfs_total_mb,
+ min_t(unsigned int, val, 100), 100);
+ } else {
+ rc = sysfs_memparse(buffer, count, &val, "MiB");
+ if (rc < 0)
+ return rc;
+ val >>= 20;
+ }
+
+ spin_lock(&lod->lod_lsfs_lock);
+ lod->lod_dom_threshold_free_mb = val;
+ lod_dom_stripesize_recalc(lod);
+ spin_unlock(&lod->lod_lsfs_lock);
+
+ return count;
+}
+
+LUSTRE_RW_ATTR(dom_threshold_free_mb);
+
+static ssize_t stripesize_show(struct kobject *kobj, struct attribute *attr,
+ char *buf)
+{
+ struct dt_device *dt = container_of(kobj, struct dt_device,
+ dd_kobj);
+ struct lod_device *lod = dt2lod_dev(dt);
+
+ return snprintf(buf, PAGE_SIZE, "%llu\n",
+ lod->lod_ost_descs.ltd_lov_desc.ld_default_stripe_size);
+}
+
+static ssize_t stripesize_store(struct kobject *kobj, struct attribute *attr,
+ const char *buffer, size_t count)
+{
+ struct dt_device *dt = container_of(kobj, struct dt_device,
+ dd_kobj);
+ struct lod_device *lod = dt2lod_dev(dt);
+ u64 val;
+ int rc;
+
+ rc = sysfs_memparse(buffer, count, &val, "B");
+ if (rc < 0)
+ return rc;