From 8ed5937d25e436add1d8a137c71e76303152b801 Mon Sep 17 00:00:00 2001 From: Mr NeilBrown Date: Wed, 19 Aug 2020 14:58:09 +1000 Subject: [PATCH] LU-8066 osc: restore cur_dirty_grant_bytes 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 Change-Id: Ic6cff067d3634d1b1406dad4eb156ad1967042c9 Reviewed-on: https://review.whamcloud.com/39740 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: James Simmons Reviewed-by: Shaun Tancheff --- lustre/osc/lproc_osc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lustre/osc/lproc_osc.c b/lustre/osc/lproc_osc.c index 3e0ef83..498e03f 100644 --- a/lustre/osc/lproc_osc.c +++ b/lustre/osc/lproc_osc.c @@ -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, -- 1.8.3.1