From: Jacob Keller Date: Thu, 30 Sep 2021 21:20:50 +0000 (-0700) Subject: devlink: print maximum number of snapshots if available X-Git-Tag: v5.16.0~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b90174354dce29d3b699558709d851b35b0c5a22;p=thirdparty%2Fiproute2.git devlink: print maximum number of snapshots if available Recently the kernel gained ability to report the maximum number of snapshots a region can have. Print this value out if it was reported. Signed-off-by: Jacob Keller Signed-off-by: David Ahern --- diff --git a/devlink/devlink.c b/devlink/devlink.c index 2f2142ed3..07c4e08ab 100644 --- a/devlink/devlink.c +++ b/devlink/devlink.c @@ -7845,6 +7845,10 @@ static void pr_out_region(struct dl *dl, struct nlattr **tb) if (tb[DEVLINK_ATTR_REGION_SNAPSHOT_ID]) pr_out_snapshot(dl, tb); + if (tb[DEVLINK_ATTR_REGION_MAX_SNAPSHOTS]) + pr_out_u64(dl, "max", + mnl_attr_get_u32(tb[DEVLINK_ATTR_REGION_MAX_SNAPSHOTS])); + pr_out_region_handle_end(dl); }