1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 20:25:52 +03:00
lvm2/lib/format1
Peter Rajnoha 32ae07cef1 pv_write: clean up non-orphan format1 PV write
...to not pollute the common and format-independent code in the
abstraction layer above.

The format1 pv_write has common code for writing metadata and
PV header by calling the "write_disks" fn and when rewriting
the header itself only (e.g. just for the purpose of changing
the PV UUID) during the pvchange operation, we had to tweak
this functionality for the format1 case and we had to assign
the PV the orphan state temporarily.

This patch removes the need for this format1 tweak and it calls
the write_disks with appropriate flag indicating whether this is
a PV write call or a VG write call, allowing for metatada update
for the latter one.

Also, a side effect of the former tweak was that it effectively
invalidated the cache (even for the non-format1 PVs) as we
assigned it the orphan state temporarily just for the format1
PV write to pass.

Also, that tweak made it difficult to directly detect whether
a PV was part of a VG or not because the state was incorrect.

Also, it's not necessary to backup and restore some PV fields
when doing a PV write:

  orig_pe_size = pv_pe_size(pv);
  orig_pe_start = pv_pe_start(pv);
  orig_pe_count = pv_pe_count(pv);
  ...
  pv_write(pv)
  ...
  pv->pe_size = orig_pe_size;
  pv->pe_start = orig_pe_start;
  pv->pe_count = orig_pe_count;

...this is already done by the layer below itself (the _format1_pv_write fn).

So let's have this cleaned up so we don't need to be bothered
about any 'format1 special case for pv_write' anymore.
2013-03-25 15:08:26 +01:00
..
.exported_symbols .export.sym generation 2004-03-26 14:51:23 +00:00
disk-rep.c pv_write: clean up non-orphan format1 PV write 2013-03-25 15:08:26 +01:00
disk-rep.h pv_write: clean up non-orphan format1 PV write 2013-03-25 15:08:26 +01:00
format1.c pv_write: clean up non-orphan format1 PV write 2013-03-25 15:08:26 +01:00
format1.h split orphan VG by format type 2008-02-06 15:47:28 +00:00
import-export.c cleanup: drop unneeded included header files 2012-08-23 14:37:20 +02:00
import-extents.c cleanup: format1 test whether PV was found 2012-08-23 14:37:52 +02:00
layout.c cleanup: uint64_t casts 2012-08-23 14:37:21 +02:00
lvm1-label.c cleanup: uint64_t casts 2012-08-23 14:37:21 +02:00
lvm1-label.h Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
Makefile.in Install plugins to subdirs 2010-05-06 10:07:46 +00:00
vg_number.c cleanup: replace memset with struct initilization 2012-06-22 13:23:03 +02:00