[PATCH] libdevmapper: (7/6) Add dm_report_get_report_types()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

This patch was missing from the last post...

Since rh->report_types can be updated after dm_report_init(),
we need an interface to obtain it later.

Thanks,
-- 
Jun'ichi Nomura, NEC Corporation of America
Add dm_report_get_report_types() to obtain updated report_types field
after dm_report_set_filter() call.

---
 dmsetup/dmsetup.c     |    1 +
 lib/.exported_symbols |    1 +
 lib/libdevmapper.h    |    1 +
 lib/libdm-report.c    |    5 +++++
 4 files changed, 8 insertions(+)

Index: device-mapper.work/lib/.exported_symbols
===================================================================
--- device-mapper.work.orig/lib/.exported_symbols
+++ device-mapper.work/lib/.exported_symbols
@@ -128,5 +128,6 @@ dm_report_field_uint32
 dm_report_field_uint64
 dm_report_field_set_value
 dm_report_set_filter
+dm_report_get_report_types
 dm_regex_create
 dm_regex_match
Index: device-mapper.work/lib/libdm-report.c
===================================================================
--- device-mapper.work.orig/lib/libdm-report.c
+++ device-mapper.work/lib/libdm-report.c
@@ -88,6 +88,11 @@ struct row {
 	struct dm_report_field *(*sort_fields)[]; /* Fields in sort order */
 };
 
+uint32_t dm_report_get_report_types(struct dm_report *rh)
+{
+	return rh->report_types;
+}
+
 static const struct dm_report_object_type *_find_type(struct dm_report *rh,
 						      uint32_t report_type)
 {
Index: device-mapper.work/lib/libdevmapper.h
===================================================================
--- device-mapper.work.orig/lib/libdevmapper.h
+++ device-mapper.work/lib/libdevmapper.h
@@ -687,6 +687,7 @@ struct dm_report *dm_report_init(uint32_
 int dm_report_object(struct dm_report *rh, void *object);
 int dm_report_output(struct dm_report *rh);
 void dm_report_free(struct dm_report *rh);
+uint32_t dm_report_get_report_types(struct dm_report *rh);
 
 /* Set filter */
 int dm_report_set_filter(struct dm_report *rh,
Index: device-mapper.work/dmsetup/dmsetup.c
===================================================================
--- device-mapper.work.orig/dmsetup/dmsetup.c
+++ device-mapper.work/dmsetup/dmsetup.c
@@ -1924,6 +1924,7 @@ static int _report_init(struct command *
 		goto out;
 	}
 
+	report_type = dm_report_get_report_types(_report);
 	r = 1;
 
 out:
--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel

[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux