[lvm-devel] [PATCH 06/30] Update lvreadahead_disp to call liblvm 'get' function.

Dave Wysochanski dwysocha at redhat.com
Mon May 11 13:01:19 UTC 2009


Should be no functional change.  Just move the dereference inside 'get'
function and call from 'disp' function.

Signed-off-by: Dave Wysochanski <dwysocha at redhat.com>
---
 lib/report/lvm_object_prop.c |    3 +--
 lib/report/report.c          |    6 ++++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/report/lvm_object_prop.c b/lib/report/lvm_object_prop.c
index 15b7991..c92bc2b 100644
--- a/lib/report/lvm_object_prop.c
+++ b/lib/report/lvm_object_prop.c
@@ -89,8 +89,7 @@ int lvm_lv_set_minor(lv_t *lv, const uint64_t value)
  */
 uint64_t lvm_lv_get_read_ahead(const lv_t *lv)
 {
-	/* FIXME: implement function body */
-	return 0;
+	return lv->read_ahead;
 }
 int lvm_lv_set_read_ahead(lv_t *lv, const uint64_t value)
 {
diff --git a/lib/report/report.c b/lib/report/report.c
index e43f9b4..e933453 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -668,13 +668,15 @@ static int _lvreadahead_disp(struct dm_report *rh, struct dm_pool *mem,
 			     const void *data, void *private __attribute((unused)))
 {
 	const struct logical_volume *lv = (const struct logical_volume *) data;
+	uint32_t value;
 
-	if (lv->read_ahead == DM_READ_AHEAD_AUTO) {
+	value = lvm_lv_get_read_ahead(lv);
+	if (value == DM_READ_AHEAD_AUTO) {
 		dm_report_field_set_value(field, "auto", &_minusone);
 		return 1;
 	}
 
-	return _size32_disp(rh, mem, field, &lv->read_ahead, private);
+	return _size32_disp(rh, mem, field, &value, private);
 }
 
 static int _lvkreadahead_disp(struct dm_report *rh, struct dm_pool *mem,
-- 
1.6.0.6




More information about the lvm-devel mailing list