Whamcloud - gitweb
LU-8066 osc: restore cur_dirty_grant_bytes 40/39740/3
authorMr NeilBrown <neilb@suse.de>
Wed, 19 Aug 2020 04:58:09 +0000 (14:58 +1000)
committerOleg Drokin <green@whamcloud.com>
Sat, 12 Sep 2020 15:44:50 +0000 (15:44 +0000)
A previous patch which moved some attrs from /proc to /sys
inadvertently removed 'cur_dirty_grant_bytes'.
This patch restores it in /sys.

Test-Parameters: trivial
Fixes: 32fb31f3bf3d ("LU-8066 osc: move suitable values from procfs to sysfs")
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Ic6cff067d3634d1b1406dad4eb156ad1967042c9
Reviewed-on: https://review.whamcloud.com/39740
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
lustre/osc/lproc_osc.c

index 3e0ef83..498e03f 100644 (file)
@@ -334,6 +334,18 @@ static ssize_t cur_lost_grant_bytes_show(struct kobject *kobj,
 }
 LUSTRE_RO_ATTR(cur_lost_grant_bytes);
 
+static ssize_t cur_dirty_grant_bytes_show(struct kobject *kobj,
+                                         struct attribute *attr,
+                                         char *buf)
+{
+       struct obd_device *obd = container_of(kobj, struct obd_device,
+                                             obd_kset.kobj);
+       struct client_obd *cli = &obd->u.cli;
+
+       return scnprintf(buf, PAGE_SIZE, "%lu\n", cli->cl_dirty_grant);
+}
+LUSTRE_RO_ATTR(cur_dirty_grant_bytes);
+
 static ssize_t grant_shrink_interval_show(struct kobject *kobj,
                                          struct attribute *attr,
                                          char *buf)
@@ -943,6 +955,7 @@ static struct attribute *osc_attrs[] = {
        &lustre_attr_contention_seconds.attr,
        &lustre_attr_cur_dirty_bytes.attr,
        &lustre_attr_cur_lost_grant_bytes.attr,
+       &lustre_attr_cur_dirty_grant_bytes.attr,
        &lustre_attr_destroys_in_flight.attr,
        &lustre_attr_grant_shrink_interval.attr,
        &lustre_attr_lockless_truncate.attr,