+static int lprocfs_osd_rd_auto_scrub(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ struct osd_device *dev = osd_dt_dev(data);
+
+ LASSERT(dev != NULL);
+ if (unlikely(dev->od_mnt == NULL))
+ return -EINPROGRESS;
+
+ *eof = 1;
+ return snprintf(page, count, "%d\n", !dev->od_noscrub);
+}
+
+static int lprocfs_osd_wr_auto_scrub(struct file *file, const char *buffer,
+ unsigned long count, void *data)
+{
+ struct osd_device *dev = osd_dt_dev(data);
+ int val, rc;
+
+ LASSERT(dev != NULL);
+ if (unlikely(dev->od_mnt == NULL))
+ return -EINPROGRESS;
+
+ rc = lprocfs_write_helper(buffer, count, &val);
+ if (rc)
+ return rc;
+
+ dev->od_noscrub = !val;
+ return count;
+}
+
+static int lprocfs_osd_rd_oi_scrub(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ struct osd_device *dev = osd_dt_dev(data);
+
+ LASSERT(dev != NULL);
+ if (unlikely(dev->od_mnt == NULL))
+ return -EINPROGRESS;
+
+ *eof = 1;
+ return osd_scrub_dump(dev, page, count);
+}
+
+int lprocfs_osd_rd_readcache(char *page, char **start, off_t off, int count,
+ int *eof, void *data)
+{
+ struct osd_device *osd = osd_dt_dev(data);
+ int rc;
+
+ LASSERT(osd != NULL);
+ if (unlikely(osd->od_mnt == NULL))
+ return -EINPROGRESS;
+
+ rc = snprintf(page, count, LPU64"\n", osd->od_readcache_max_filesize);
+ return rc;
+}
+
+int lprocfs_osd_wr_readcache(struct file *file, const char *buffer,
+ unsigned long count, void *data)
+{
+ struct osd_device *osd = osd_dt_dev(data);
+ __u64 val;
+ int rc;
+
+ LASSERT(osd != NULL);
+ if (unlikely(osd->od_mnt == NULL))
+ return -EINPROGRESS;
+
+ rc = lprocfs_write_u64_helper(buffer, count, &val);
+ if (rc)
+ return rc;
+
+ osd->od_readcache_max_filesize = val > OSD_MAX_CACHE_SIZE ?
+ OSD_MAX_CACHE_SIZE : val;
+ return count;
+}
+