+static int lod_dom_stripesize_seq_show(struct seq_file *m, void *v)
+{
+ struct obd_device *dev = m->private;
+ struct lod_device *lod;
+
+ LASSERT(dev != NULL);
+ lod = lu2lod_dev(dev->obd_lu_dev);
+ seq_printf(m, "%u\n", lod->lod_dom_max_stripesize);
+ return 0;
+}
+
+/**
+ * Set default stripe size.
+ *
+ * \param[in] file proc file
+ * \param[in] buffer string containing the maximum number of bytes stored in
+ * each object before moving to the next object in the
+ * layout (if any)
+ * \param[in] count @buffer length
+ * \param[in] off unused for single entry
+ *
+ * \retval @count on success
+ * \retval negative error code if failed
+ */
+static ssize_t
+lod_dom_stripesize_seq_write(struct file *file, const char __user *buffer,
+ size_t count, loff_t *off)
+{
+ struct seq_file *m = file->private_data;
+ struct obd_device *dev = m->private;
+ struct lod_device *lod;
+ s64 val;
+ int rc;
+
+ LASSERT(dev != NULL);
+ lod = lu2lod_dev(dev->obd_lu_dev);
+ rc = lprocfs_str_with_units_to_s64(buffer, count, &val, '1');
+ if (rc)
+ return rc;
+ if (val < 0)
+ return -ERANGE;
+
+ /* 1GB is the limit */
+ if (val > (1ULL << 30))
+ return -ERANGE;
+ else if (val > 0) {
+ if (val < LOV_MIN_STRIPE_SIZE) {
+ LCONSOLE_INFO("Increasing provided stripe size to "
+ "a minimum value %u\n",
+ LOV_MIN_STRIPE_SIZE);
+ val = LOV_MIN_STRIPE_SIZE;
+ } else if (val & (LOV_MIN_STRIPE_SIZE - 1)) {
+ val &= ~(LOV_MIN_STRIPE_SIZE - 1);
+ LCONSOLE_WARN("Changing provided stripe size to %llu "
+ "(a multiple of minimum %u)\n",
+ val, LOV_MIN_STRIPE_SIZE);
+ }
+ }
+
+ lod->lod_dom_max_stripesize = val;
+
+ return count;
+}
+LPROC_SEQ_FOPS(lod_dom_stripesize);
+
+/**
+ * Show default stripe size.
+ *
+ * \param[in] m seq file
+ * \param[in] v unused for single entry
+ *
+ * \retval 0 on success
+ * \retval negative error code if failed
+ */