Skip to contentSkip to conversation

devlink: print maximum number of snapshots if available

iproute2-next Applied Jacob Keller 2 participants 2 messages Sep 30, 2021 – Oct 5, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Recently the kernel gained ability to report the maximum number of snapshots a region can have. Print this value out if it was reported.

---

This requires updating the UAPI headers to the commit which includes the DEVLINK_ATTR_REGION_MAX_SNAPSHOTS attribute.

 devlink/devlink.c | 4 ++++
 1 file changed, 4 insertions(+)
devlink/devlink.c +4 -0
index 2f2142ed3856..07c4e08ab9d8 100644
@@ -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);
 }
 

base-commit: 2f5825cb38028a14961a79844a069be4e3057eca

Signature · 1 line
2.31.1.331.gb0c09ab8796f
Applied
#1 lore raw
Quoted 12 lines · Jacob Keller

Recently the kernel gained ability to report the maximum number of snapshots a region can have. Print this value out if it was reported.

---

This requires updating the UAPI headers to the commit which includes the DEVLINK_ATTR_REGION_MAX_SNAPSHOTS attribute.

 devlink/devlink.c | 4 ++++
 1 file changed, 4 insertions(+)

applied to iproute2-next