]> sourceware.org Git - lvm2.git/commitdiff
cleanup: move _lvactive_disp and _thinzero_disp under 'attribute' display functions
authorPeter Rajnoha <prajnoha@redhat.com>
Wed, 9 Jul 2014 12:37:01 +0000 (14:37 +0200)
committerPeter Rajnoha <prajnoha@redhat.com>
Wed, 9 Jul 2014 13:57:05 +0000 (15:57 +0200)
So all attribute reporting functions are all in one section of code
for quick orientation (all these functions are defined in the order
of their attribute character displayed in pv/vg/lv_attr field).

lib/report/report.c

index d28c767b631de7585f6094d0531a90d07eac8420..198fdfa09701031fe50b945309ecc3461469225f 100644 (file)
@@ -750,18 +750,6 @@ static int _chunksize_disp(struct dm_report *rh, struct dm_pool *mem,
        return _size64_disp(rh, mem, field, &size, private);
 }
 
-static int _thinzero_disp(struct dm_report *rh, struct dm_pool *mem,
-                          struct dm_report_field *field,
-                          const void *data, void *private)
-{
-       const struct lv_segment *seg = (const struct lv_segment *) data;
-
-       if (seg_is_thin_pool(seg))
-               return _uint32_disp(rh, mem, field, &seg->zero_new_blocks, private);
-
-       return _field_set_value(field, "", &_reserved_number_undef_64);
-}
-
 static int _transactionid_disp(struct dm_report *rh, struct dm_pool *mem,
                                struct dm_report_field *field,
                                const void *data, void *private)
@@ -1275,20 +1263,6 @@ static int _lvhost_disp(struct dm_report *rh, struct dm_pool *mem,
        return _field_set_value(field, repstr, NULL);
 }
 
-static int _lvactive_disp(struct dm_report *rh, struct dm_pool *mem,
-                            struct dm_report_field *field,
-                            const void *data, void *private)
-{
-       char *repstr;
-
-       if (!(repstr = lv_active_dup(mem, (const struct logical_volume *) data))) {
-               log_error("Failed to allocate buffer for active.");
-               return 0;
-       }
-
-       return _field_set_value(field, repstr, NULL);
-}
-
 /* PV/VG/LV Attributes */
 
 static int _pvallocatable_disp(struct dm_report *rh, struct dm_pool *mem,
@@ -1477,6 +1451,20 @@ static int _lvfixedminor_disp(struct dm_report *rh, struct dm_pool *mem,
        return _binary_disp(rh, mem, field, fixed_minor, FIRST_NAME(lv_fixed_minor), private);
 }
 
+static int _lvactive_disp(struct dm_report *rh, struct dm_pool *mem,
+                            struct dm_report_field *field,
+                            const void *data, void *private)
+{
+       char *repstr;
+
+       if (!(repstr = lv_active_dup(mem, (const struct logical_volume *) data))) {
+               log_error("Failed to allocate buffer for active.");
+               return 0;
+       }
+
+       return _field_set_value(field, repstr, NULL);
+}
+
 static int _lvactivelocally_disp(struct dm_report *rh, struct dm_pool *mem,
                                 struct dm_report_field *field,
                                 const void *data, void *private)
@@ -1626,6 +1614,18 @@ static int _lvtargettype_disp(struct dm_report *rh, struct dm_pool *mem,
        return _string_disp(rh, mem, field, &target_type, private);
 }
 
+static int _thinzero_disp(struct dm_report *rh, struct dm_pool *mem,
+                          struct dm_report_field *field,
+                          const void *data, void *private)
+{
+       const struct lv_segment *seg = (const struct lv_segment *) data;
+
+       if (seg_is_thin_pool(seg))
+               return _uint32_disp(rh, mem, field, &seg->zero_new_blocks, private);
+
+       return _field_set_value(field, "", &_reserved_number_undef_64);
+}
+
 static int _lvhealthstatus_disp(struct dm_report *rh, struct dm_pool *mem,
                                struct dm_report_field *field,
                                const void *data, void *private)
This page took 0.040727 seconds and 5 git commands to generate.