1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
lvm2/lib
Jonathan Brassow 96626f64fa cache: Code to allow the create/remove of cache LVs
This patch allows users to create cache LVs with 'lvcreate'.  An origin
or a cache pool LV must be created first.  Then, while supplying the
origin or cache pool to the lvcreate command, the cache can be created.

Ex1:
Here the cache pool is created first, followed by the origin which will
be cached.
~> lvcreate --type cache_pool -L 500M -n cachepool vg /dev/small_n_fast
~> lvcreate --type cache -L 1G -n lv vg/cachepool /dev/large_n_slow

Ex2:
Here the origin is created first, followed by the cache pool - allowing
a cache LV to be created covering the origin.
~> lvcreate -L 1G -n lv vg /dev/large_n_slow
~> lvcreate --type cache -L 500M -n cachepool vg/lv /dev/small_n_fast

The code determines which type of LV was supplied (cache pool or origin)
by checking its type.  It ensures the right argument was given by ensuring
that the origin is larger than the cache pool.

If the user wants to remove just the cache for an LV.  They specify
the LV's associated cache pool when removing:
~> lvremove vg/cachepool

If the user wishes to remove the origin, but leave the cachepool to be
used for another LV, they specify the cache LV.
~> lvremove vg/lv

In order to remove it all, specify both LVs.

This patch also includes tests to create and remove cache pools and
cache LVs.
2014-02-04 16:50:16 -06:00
..
activate cache: Code to allow the create/remove of cache LVs 2014-02-04 16:50:16 -06:00
cache lvmetad: respect LVM_LVMETAD_PIDFILE settings in lvm 2014-01-24 15:59:38 +01:00
cache_segtype cleanup: fix cut&paste and move initialization 2014-01-29 09:00:16 +01:00
commands cache: New 'cachepool' segment type 2014-01-27 05:27:16 -06:00
config cache: Code changes to allow creation of cache pools 2014-02-04 11:57:08 -06:00
datastruct cleanup: self compilable headers 2013-12-12 13:28:19 +01:00
device devices: support zvol 2014-01-28 10:33:29 +01:00
display tools: Add internal tags command. 2014-01-30 13:09:15 +00:00
error cleanup: drop unneeded included header files 2012-08-23 14:37:20 +02:00
filters filters: drop extra slash from sysfs path 2013-11-22 20:53:31 +01:00
format1 format1: Mark obsolete and do not use with lvmetad. 2014-01-14 03:27:45 +00:00
format_pool pvscan: use format feature flags in lvmetad code 2014-01-08 02:13:13 +00:00
format_text cache: Code changes to allow creation of cache pools 2014-02-04 11:57:08 -06:00
freeseg cleanup: drop unneeded included header files 2012-08-23 14:37:20 +02:00
label cleanup: add missing backtrace in fail path 2013-12-12 13:29:59 +01:00
locking locking: avoid dropping locks 2014-01-27 12:13:29 +01:00
log cleanup: simplify logging code 2013-12-12 13:27:59 +01:00
metadata cache: Code to allow the create/remove of cache LVs 2014-02-04 16:50:16 -06:00
mirror config: add profile arg to find_config_tree_str 2013-07-02 15:19:09 +02:00
misc cache: New 'cachepool' segment type 2014-01-27 05:27:16 -06:00
mm gcc: replace #ifdef linux with __linux__ 2013-11-13 13:56:29 +00:00
properties lvm2app: Add thin and thin pool lv creation 2013-07-12 16:52:16 -05:00
raid cleanup: shorter raid initialization 2013-12-10 11:16:51 +01:00
replicator cleanup: drop unneeded included header files 2012-08-23 14:37:20 +02:00
report compilation: Rename tags variables to tagsl. 2014-01-30 21:09:28 +00:00
snapshot snapshot: rework parsing of snapshot metadata 2013-10-14 00:26:58 +02:00
striped Add activation/use_linear_target enabled by default. (prajnoha) 2011-11-28 20:37:51 +00:00
thin thin: validate external origin size 2014-01-29 14:58:13 +01:00
unknown cleanup: drop unneeded included header files 2012-08-23 14:37:20 +02:00
uuid cleanup: self compilable headers 2013-12-12 13:28:19 +01:00
zero cleanup: drop unneeded included header files 2012-08-23 14:37:20 +02:00
Makefile.in cache: Add functions that create/remove cache LVs 2014-02-04 07:59:58 -06:00