+
+static int ldiskfs_osd_index_backup_seq_show(struct seq_file *m, void *data)
+{
+ struct osd_device *dev = osd_dt_dev((struct dt_device *)m->private);
+
+ LASSERT(dev != NULL);
+ if (unlikely(dev->od_mnt == NULL))
+ return -EINPROGRESS;
+
+ seq_printf(m, "%d\n", dev->od_index_backup_policy);
+ return 0;
+}
+
+static ssize_t ldiskfs_osd_index_backup_seq_write(struct file *file,
+ const char __user *buffer,
+ size_t count, loff_t *off)
+{
+ struct seq_file *m = file->private_data;
+ struct dt_device *dt = m->private;
+ struct osd_device *dev = osd_dt_dev(dt);
+ int val;
+ int rc;
+
+ LASSERT(dev != NULL);
+ if (unlikely(dev->od_mnt == NULL))
+ return -EINPROGRESS;
+
+ rc = kstrtoint_from_user(buffer, count, 0, &val);
+ if (rc)
+ return rc;
+
+ dev->od_index_backup_policy = val;
+ return count;
+}
+LPROC_SEQ_FOPS(ldiskfs_osd_index_backup);
+
+LPROC_SEQ_FOPS_RO_TYPE(ldiskfs, dt_blksize);
+LPROC_SEQ_FOPS_RO_TYPE(ldiskfs, dt_kbytestotal);
+LPROC_SEQ_FOPS_RO_TYPE(ldiskfs, dt_kbytesfree);
+LPROC_SEQ_FOPS_RO_TYPE(ldiskfs, dt_kbytesavail);
+LPROC_SEQ_FOPS_RO_TYPE(ldiskfs, dt_filestotal);
+LPROC_SEQ_FOPS_RO_TYPE(ldiskfs, dt_filesfree);
+
+struct lprocfs_vars lprocfs_osd_obd_vars[] = {
+ { .name = "blocksize",
+ .fops = &ldiskfs_dt_blksize_fops },
+ { .name = "kbytestotal",
+ .fops = &ldiskfs_dt_kbytestotal_fops },
+ { .name = "kbytesfree",
+ .fops = &ldiskfs_dt_kbytesfree_fops },
+ { .name = "kbytesavail",
+ .fops = &ldiskfs_dt_kbytesavail_fops },
+ { .name = "filestotal",
+ .fops = &ldiskfs_dt_filestotal_fops },
+ { .name = "filesfree",
+ .fops = &ldiskfs_dt_filesfree_fops },
+ { .name = "fstype",
+ .fops = &ldiskfs_osd_fstype_fops },
+ { .name = "mntdev",
+ .fops = &ldiskfs_osd_mntdev_fops },
+ { .name = "force_sync",
+ .fops = &ldiskfs_osd_force_sync_fops },
+ { .name = "pdo",
+ .fops = &ldiskfs_osd_pdo_fops },
+ { .name = "auto_scrub",
+ .fops = &ldiskfs_osd_auto_scrub_fops },
+ { .name = "full_scrub_ratio",
+ .fops = &ldiskfs_osd_full_scrub_ratio_fops },
+ { .name = "full_scrub_threshold_rate",
+ .fops = &ldiskfs_osd_full_scrub_threshold_rate_fops },
+ { .name = "oi_scrub",
+ .fops = &ldiskfs_osd_oi_scrub_fops },
+ { .name = "read_cache_enable",
+ .fops = &ldiskfs_osd_cache_fops },
+ { .name = "writethrough_cache_enable",
+ .fops = &ldiskfs_osd_wcache_fops },
+ { .name = "readcache_max_filesize",
+ .fops = &ldiskfs_osd_readcache_fops },
+ { .name = "index_backup",
+ .fops = &ldiskfs_osd_index_backup_fops },
+ { NULL }