+LDEBUGFS_SEQ_FOPS(ll_max_cached_mb);
+
+static ssize_t checksums_show(struct kobject *kobj, struct attribute *attr,
+ char *buf)
+{
+ struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
+ ll_kset.kobj);
+
+ return sprintf(buf, "%u\n", (sbi->ll_flags & LL_SBI_CHECKSUM) ? 1 : 0);
+}
+
+static ssize_t checksums_store(struct kobject *kobj, struct attribute *attr,
+ const char *buffer, size_t count)
+{
+ struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
+ ll_kset.kobj);
+ bool val;
+ int tmp;
+ int rc;
+
+ if (!sbi->ll_dt_exp)
+ /* Not set up yet */
+ return -EAGAIN;
+
+ rc = kstrtobool(buffer, &val);
+ if (rc)
+ return rc;
+ if (val)
+ sbi->ll_flags |= LL_SBI_CHECKSUM;
+ else
+ sbi->ll_flags &= ~LL_SBI_CHECKSUM;
+ tmp = val;
+
+ rc = obd_set_info_async(NULL, sbi->ll_dt_exp, sizeof(KEY_CHECKSUM),
+ KEY_CHECKSUM, sizeof(tmp), &tmp, NULL);
+ if (rc)
+ CWARN("Failed to set OSC checksum flags: %d\n", rc);
+
+ return count;
+}
+LUSTRE_RW_ATTR(checksums);
+
+LUSTRE_ATTR(checksum_pages, 0644, checksums_show, checksums_store);
+
+static ssize_t ll_rd_track_id(struct kobject *kobj, char *buf,
+ enum stats_track_type type)
+{
+ struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
+ ll_kset.kobj);
+
+ if (sbi->ll_stats_track_type == type)
+ return sprintf(buf, "%d\n", sbi->ll_stats_track_id);
+ else if (sbi->ll_stats_track_type == STATS_TRACK_ALL)
+ return sprintf(buf, "0 (all)\n");
+
+ return sprintf(buf, "untracked\n");
+}
+
+static ssize_t ll_wr_track_id(struct kobject *kobj, const char *buffer,
+ size_t count, enum stats_track_type type)
+{
+ struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
+ ll_kset.kobj);
+ unsigned long pid;
+ int rc;
+
+ rc = kstrtoul(buffer, 10, &pid);
+ if (rc)
+ return rc;
+
+ sbi->ll_stats_track_id = pid;
+ if (pid == 0)
+ sbi->ll_stats_track_type = STATS_TRACK_ALL;
+ else
+ sbi->ll_stats_track_type = type;
+ lprocfs_clear_stats(sbi->ll_stats);
+ return count;
+}
+
+static ssize_t stats_track_pid_show(struct kobject *kobj,
+ struct attribute *attr,
+ char *buf)
+{
+ return ll_rd_track_id(kobj, buf, STATS_TRACK_PID);
+}
+
+static ssize_t stats_track_pid_store(struct kobject *kobj,
+ struct attribute *attr,
+ const char *buffer,
+ size_t count)
+{
+ return ll_wr_track_id(kobj, buffer, count, STATS_TRACK_PID);
+}
+LUSTRE_RW_ATTR(stats_track_pid);
+
+static ssize_t stats_track_ppid_show(struct kobject *kobj,
+ struct attribute *attr,
+ char *buf)
+{
+ return ll_rd_track_id(kobj, buf, STATS_TRACK_PPID);
+}
+
+static ssize_t stats_track_ppid_store(struct kobject *kobj,
+ struct attribute *attr,
+ const char *buffer,
+ size_t count)
+{
+ return ll_wr_track_id(kobj, buffer, count, STATS_TRACK_PPID);
+}
+LUSTRE_RW_ATTR(stats_track_ppid);
+
+static ssize_t stats_track_gid_show(struct kobject *kobj,
+ struct attribute *attr,
+ char *buf)
+{
+ return ll_rd_track_id(kobj, buf, STATS_TRACK_GID);
+}
+
+static ssize_t stats_track_gid_store(struct kobject *kobj,
+ struct attribute *attr,
+ const char *buffer,
+ size_t count)
+{
+ return ll_wr_track_id(kobj, buffer, count, STATS_TRACK_GID);
+}
+LUSTRE_RW_ATTR(stats_track_gid);
+
+static ssize_t statahead_running_max_show(struct kobject *kobj,
+ struct attribute *attr,
+ char *buf)
+{
+ struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
+ ll_kset.kobj);
+
+ return scnprintf(buf, PAGE_SIZE, "%u\n", sbi->ll_sa_running_max);
+}
+
+static ssize_t statahead_running_max_store(struct kobject *kobj,
+ struct attribute *attr,
+ const char *buffer,
+ size_t count)
+{
+ struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
+ ll_kset.kobj);
+ unsigned long val;
+ int rc;
+
+ rc = kstrtoul(buffer, 0, &val);
+ if (rc)
+ return rc;
+
+ if (val <= LL_SA_RUNNING_MAX) {
+ sbi->ll_sa_running_max = val;
+ return count;
+ }
+
+ CERROR("Bad statahead_running_max value %lu. Valid values "
+ "are in the range [0, %d]\n", val, LL_SA_RUNNING_MAX);
+
+ return -ERANGE;
+}
+LUSTRE_RW_ATTR(statahead_running_max);