X-Git-Url: https://git.whamcloud.com/gitweb?a=blobdiff_plain;f=lustre%2Fosd-ldiskfs%2Fosd_lproc.c;h=02cf9724a0b8f6a6be138d07836b4e2f71a5ed16;hb=68635c3d9b3113621b93fd989f1a3f8f064385b9;hp=9a2e12a3712ec27528a3e90b6bfe0c5ac37a53d1;hpb=20472b4070495c1bb2796ce2682aefdf2fe8a3f6;p=fs%2Flustre-release.git diff --git a/lustre/osd-ldiskfs/osd_lproc.c b/lustre/osd-ldiskfs/osd_lproc.c index 9a2e12a..02cf972 100644 --- a/lustre/osd-ldiskfs/osd_lproc.c +++ b/lustre/osd-ldiskfs/osd_lproc.c @@ -353,6 +353,43 @@ ssize_t force_sync_store(struct kobject *kobj, struct attribute *attr, } LUSTRE_WO_ATTR(force_sync); +static ssize_t nonrotational_show(struct kobject *kobj, struct attribute *attr, + char *buf) +{ + struct dt_device *dt = container_of(kobj, struct dt_device, + dd_kobj); + struct osd_device *osd = osd_dt_dev(dt); + + LASSERT(osd); + if (unlikely(!osd->od_mnt)) + return -EINPROGRESS; + + return sprintf(buf, "%u\n", osd->od_nonrotational); +} + +static ssize_t nonrotational_store(struct kobject *kobj, + struct attribute *attr, const char *buffer, + size_t count) +{ + struct dt_device *dt = container_of(kobj, struct dt_device, + dd_kobj); + struct osd_device *osd = osd_dt_dev(dt); + bool val; + int rc; + + LASSERT(osd); + if (unlikely(!osd->od_mnt)) + return -EINPROGRESS; + + rc = kstrtobool(buffer, &val); + if (rc) + return rc; + + osd->od_nonrotational = val; + return count; +} +LUSTRE_RW_ATTR(nonrotational); + static ssize_t pdo_show(struct kobject *kobj, struct attribute *attr, char *buf) { @@ -668,6 +705,7 @@ static struct attribute *ldiskfs_attrs[] = { &lustre_attr_fstype.attr, &lustre_attr_mntdev.attr, &lustre_attr_force_sync.attr, + &lustre_attr_nonrotational.attr, &lustre_attr_index_backup.attr, &lustre_attr_auto_scrub.attr, &lustre_attr_pdo.attr,