X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fobdclass%2Fobd_sysfs.c;h=d0f09aa20803376cc6955713b00d74c17161d0a3;hb=e383791b1ca45ea14f38c98b9ff55faf7590ef30;hp=02f6642c922ab93bca84df7b271ec1fda28a58fd;hpb=3fcddf6dcdd92df6557c59913a61944f21d58615;p=fs%2Flustre-release.git diff --git a/lustre/obdclass/obd_sysfs.c b/lustre/obdclass/obd_sysfs.c index 02f6642..d0f09aa 100644 --- a/lustre/obdclass/obd_sysfs.c +++ b/lustre/obdclass/obd_sysfs.c @@ -70,6 +70,9 @@ #include #include +bool obd_enable_health_write; +EXPORT_SYMBOL(obd_enable_health_write); + struct static_lustre_uintvalue_attr { struct { struct attribute attr; @@ -269,6 +272,30 @@ health_check_show(struct kobject *kobj, struct attribute *attr, char *buf) return len; } +#ifdef HAVE_SERVER_SUPPORT +static ssize_t enable_health_write_show(struct kobject *kobj, + struct attribute *attr, + char *buf) +{ + return scnprintf(buf, PAGE_SIZE, "%u\n", + obd_enable_health_write); +} + +static ssize_t enable_health_write_store(struct kobject *kobj, + struct attribute *attr, + const char *buf, size_t count) +{ + int rc = 0; + + rc = kstrtobool(buf, &obd_enable_health_write); + if (rc) + return rc; + + return count; +} +LUSTRE_RW_ATTR(enable_health_write); +#endif /* HAVE_SERVER_SUPPORT */ + static ssize_t jobid_var_show(struct kobject *kobj, struct attribute *attr, char *buf) { @@ -437,6 +464,7 @@ static struct attribute *lustre_attrs[] = { &lustre_attr_memused_max.attr, &lustre_attr_memused.attr, #ifdef HAVE_SERVER_SUPPORT + &lustre_attr_enable_health_write.attr, &lustre_sattr_ldlm_timeout.u.attr, &lustre_sattr_bulk_timeout.u.attr, &lustre_attr_no_transno.attr,