1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 20:25:52 +03:00
Commit Graph

1781 Commits

Author SHA1 Message Date
Zdenek Kabelac
20b22cd023 libdm: still better API
Do not use 'any' policy name as a value in config tree - so we stick
with 'policy_settings' and extra 'policy_name' for libdm params.

Update lvm2 API as well.

Example of supported metadata:

 policy = "mq"
 policy_settings {
      migration_threshold = 2048
      sequential_threshold = 512
      random_threshold = 4
      read_promote_adjustment = 10
 }
2014-11-11 00:54:03 +01:00
Zdenek Kabelac
a7fc108298 mirror: layer remove doesn't work properly with mirrors 2014-11-10 22:32:43 +01:00
Zdenek Kabelac
e5d3f81285 cleanup: indents comments backtraces 2014-11-10 22:05:49 +01:00
Zdenek Kabelac
f5e265a07f cache: use LV_PENDING_DELETE 2014-11-10 22:05:49 +01:00
Zdenek Kabelac
6effcb16fc cache: option 2014-11-10 22:05:49 +01:00
Zdenek Kabelac
3e230a8ad8 cache: new API for libdm 2014-11-10 22:05:49 +01:00
Zdenek Kabelac
3dbcd2a1c9 cleanup: cache API get/set 2014-11-10 22:05:48 +01:00
Zdenek Kabelac
2e0c926d56 cleanup: API get/set fixes 2014-11-10 22:05:48 +01:00
Zdenek Kabelac
8d7340b7a1 report: for cache LV report chunksize
Cache LV reports chunksize via cache-pool.
2014-11-10 22:05:48 +01:00
Zdenek Kabelac
6a41286c01 snapshot: virtual save commit
More efficient spare volume creation. Save 1 extra commit
and properly activate this volume according to our cluster
activation rules (using lv_active_change() for this).
2014-11-10 22:05:48 +01:00
Zdenek Kabelac
ff30783a4f lv_manip: remove_layer_from_lv restore lv name
Since we 'layer' for cache origin which and we support dropping
cache layer - we need to restore origin name in case
the origin LV is more complex target  - i.e. raid.

Drop _corig from name

Cleanup and rename parent -> parent_lv.
2014-11-10 22:05:48 +01:00
Zdenek Kabelac
979d12eb4a lvremove: few more validation before archive
Before we finally call archive, we still can do a few more validation
without modifying VG. So delay archive() call few lines.
2014-11-10 22:05:48 +01:00
Zdenek Kabelac
e2c4a3ef67 segtype: add SEG_ONLY_EXCLUSIVE flag
Mark segtypes which do require exclusive activation in cluster.r
2014-11-10 22:05:48 +01:00
Zdenek Kabelac
62c7027a7c raid: fix activation order
Cannot 'activate' volumes in suspend state and we need to use
lock holding LV for suspend/resume.
2014-11-10 22:05:48 +01:00
Zdenek Kabelac
32e4af6479 cache: used cache-pool becomes invisible
While cache-pool is in use - it is considered invisible.
2014-11-10 21:36:21 +01:00
Zdenek Kabelac
09e32e4add pools: prompt only when metadata lv exists
If the VG has no pool metadata volume, don't prompt about
removal of _pmspare.
2014-11-10 21:35:56 +01:00
Zdenek Kabelac
138c2417c0 pools: after fail of vg_write no restore
Revert part of commit 51a29e6056,
it's probably bad idea to continue with any recovery, when
vg_write() or vg_commit() fail - so it's better to leave it as it is.
2014-11-10 21:34:02 +01:00
Zdenek Kabelac
94e4d5fcf5 cleanup: avoid dm_list size calc in common path
Calculate dm_list_size only when there is not just a single
ont segment in list - so it's only counted on error path.
2014-11-05 15:30:59 +01:00
Zdenek Kabelac
a3a2c792a8 lv: lv_active_change add needs_exclusive flag
Let's use this function for more activations in the code.

'needs_exlusive' will enforce exlusive type for any given LV.

We may want to activate LV in exlusive mode, even when we know
the LV (as is) supports non-exlusive activation as well.

lvcreate -ay   -> exclusive & local
lvcreate -aay  -> exclusive & local
lvcreate -aly  -> exclusive & local
lvcreate -aey  -> exclusive  (might be on any node).
2014-11-05 15:29:43 +01:00
Zdenek Kabelac
a82dcadf66 snapshot: no snapshot of any cache type LVs
Unsupported as of now.
2014-11-05 15:28:38 +01:00
Zdenek Kabelac
8563c3e1a9 thin: check for new pool before creating thin volume
Call check_new_thin_pool() to detect in-use thin-pool.
Save extra reactivation of thin-pool when thin pool is not active.
(it's now a bit more expensive to invoke thin_check for new pools.)

For new pools:

We now active locally exclusively thin-pool as 'public' LV.
Validate transaction_id is till 0.
Deactive.
Prepare create message for thin-pool and exclusively active pool.
Active new thin LV.
And deactivate thin pool if it used to be inactive.
2014-11-04 15:29:19 +01:00
Zdenek Kabelac
6116b1d6e3 thin: validate unused thin pool
Function tests, that given new thin pool is still unused.
2014-11-04 15:28:00 +01:00
Zdenek Kabelac
26aa912b46 thin: add lv_is_new_thin_pool
Recognize 'new' (and never used) lvm2 thin pool - it has 'transaction_id' == 0
(lv_is_used_thin_pool() has slightly different meaning).
2014-11-04 15:28:00 +01:00
Zdenek Kabelac
d6c5445bea cleanup: correcting tracing
Use log_error for real error.
2014-11-03 14:19:34 +01:00
Zdenek Kabelac
b7bc28b7b7 cache: wipe cache-pool before reuse
Before we reuse cache-pool - we need to ensure metadata volume
has wiped header.
2014-11-03 14:19:33 +01:00
Zdenek Kabelac
ab49120465 cache: lv_cache_status
Replace lv_cache_block_info() and lv_cache_policy_info()
with lv_cache_status() which directly returns
dm_status_cache structure together with some calculated
values.

After use  mem pool stored inside lv_status_cache structure
needs to be destroyed.
2014-11-03 14:19:33 +01:00
Zdenek Kabelac
cb931eed72 cleanup: rename virtual_extents
Use standard 'virtual_extents' naming.
Move virtual_size into  'lcp' struct out of lvcreate_params.
2014-11-03 14:19:33 +01:00
Zdenek Kabelac
913f025d3e cleanup: use extents to pass size to /lib
Lib takes sizes in extens - do the same for pool_metadata.
2014-11-03 14:19:33 +01:00
Zdenek Kabelac
d2e9802ba7 cache: add wipe_cache_pool
Add function for wiping cache pool volume.
Only unused cache-pool could be wiped.
2014-11-03 14:19:33 +01:00
Zdenek Kabelac
969ab6bbf0 cache: convert thin-pool
Support caching of thin-pool.

lvresize needs to be resolved - so far, user
has to manually drop cache-pool before resizing.
2014-11-03 14:19:33 +01:00
Zdenek Kabelac
fe245d78ff cleanup: shorter code 2014-10-30 23:58:49 +01:00
Zdenek Kabelac
888b21e9bd cleanup: extents_from_size is 32bit value
Current lvm2 does support only 32bit extents count.
2014-10-30 23:58:49 +01:00
Zdenek Kabelac
9a6cf3d9f4 cleanup: prints and stacks 2014-10-30 23:58:49 +01:00
Zdenek Kabelac
0da749c9a4 cleanup: remove unneeded assign 2014-10-30 23:58:49 +01:00
Zdenek Kabelac
8bf4cd464f metadata: add extents_from_percent_size
Add API call to calculate extents from percentage value.
Size is based in DM_PERCENT_1 units.
(Supporting decimal point number).
This commit is preparing functionality for more global
usage of % with i.e. --size option.
2014-10-30 23:58:49 +01:00
Zdenek Kabelac
375d7f1c2d pv_manip: check for pe_ranges 2014-10-30 23:58:49 +01:00
Zdenek Kabelac
97cccfbf1c segtype: drop cmdcontex pointer
Users of context provide their cmd pointer,
so don't keep it inside segtype.
2014-10-30 23:58:49 +01:00
Zdenek Kabelac
e223c801fc pools: workaround hints
Missing code for stacked hint estimation
2014-10-26 19:45:17 +01:00
Zdenek Kabelac
205e3ff888 lvcreate: delay check for free extents
As the rounding for cache creation may change the value of extents
postpone check for free extents.
2014-10-26 18:37:13 +01:00
Zdenek Kabelac
c9fbbf48ba cache: support more args
Unlike with thin-pool - with cache we support all args also
directly when create cache volume.

So the result of 'separate' cache-pool creation and setting its
options should give same result as specifying those args
during cache creation.

Cache-pool values are used as defaults if the params are
not specified with cache creation.
2014-10-26 18:37:13 +01:00
Zdenek Kabelac
ff2e8b0de6 thin: simplify thin volume creation
Move code for creation of thin volume into a single place
out of lv_extend().  This allows to drop extra pool arg
for alloc_lv_segment() && lv_extend() and makes code
more easier to read and follow.
2014-10-26 18:37:13 +01:00
Zdenek Kabelac
52dfa6dd44 cache: apply chunk rounding also for cache creation.
When we create volumes with chunk size bigger then extent size
we try to round up to some nearest chunk boundary.
Until now we did this for thins - use same logic for
cache volumes.
2014-10-26 18:37:13 +01:00
Zdenek Kabelac
25307e4add pools: prefetch pool_lv and origin_lv
Load pool_lv and origin_lv at a single place and
use it for more types as they need them.
2014-10-26 18:37:13 +01:00
David Teigland
7916cae697 vg_read: Remove unused READ_WITHOUT_LOCK.
Unused since 67a7b7a87d:
  report: Iterate over labels instead of PVs for label-only reports.
(included in 2.02.105).
2014-10-24 21:54:04 +01:00
Zdenek Kabelac
11ea72cfd8 mirror: extra parsing for mirrorlog arg
Put validation of mirrorlog arg into a separate function.
2014-10-24 16:39:32 +02:00
Zdenek Kabelac
fd00d2c6ec cache: separate func for pool/origin validation
Split validate_lv_cache_create() into 2 function
once is called for pool validation other for origin.

It's less misleading the accepting NULLs.
2014-10-24 16:39:32 +02:00
Zdenek Kabelac
d13239b054 lvcreate: new validation code
Refactor lvcreate code.

Prefer to use arg_outside_list_is_set() so we get automatic 'white-list'
validation of supported options with different segment types.

Drop used lp->cache, lp->cache and use seg_is_cache(), seg_is_thin()

Draw clear border where is the last moment we could change create
segment type.

When segment type is given with --type - do not allow it to be changed
later.

Put together tests related to individual segment types.

Finish cache conversion at proper part of lv_manip code after
the vg_metadata are written - so we could correcly clean-up created
stripe LV for cache volume.
2014-10-24 16:39:32 +02:00
Zdenek Kabelac
51a29e6056 pools: error path removes metadata
When pool volume is create - it has already managed to update metadata
once within lv_extend - so revert new created LV here.
2014-10-24 16:39:32 +02:00
Zdenek Kabelac
7359a9df88 pool: better error path handling
Move test for size of new LV names in front before
any creation of LV.

Properly check striped  segtype kernel presence,
since passed 'segtype' is already tested.

Keep deactivation error path local to wiping part of the function.

Create metadata with temporary flag (it's activated, zeroed
and deactivated).
2014-10-24 16:39:32 +02:00
Zdenek Kabelac
21798418fc cleanup: better stack tracing
Show proper backtrace on error path.
2014-10-24 16:39:32 +02:00