1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
lvm2/lib/activate
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.c cache: New functions for gathering info on cache devices 2014-01-28 12:24:51 -06:00
activate.h cache: New functions for gathering info on cache devices 2014-01-28 12:24:51 -06:00
dev_manager.c cache: Code to allow the create/remove of cache LVs 2014-02-04 16:50:16 -06:00
dev_manager.h cache: New functions for gathering info on cache devices 2014-01-28 12:24:51 -06:00
fs.c clean-up: Typo 's/should had/should have/' 2013-03-06 08:42:03 -06:00
fs.h Fix lv_info open_count test 2011-10-14 13:23:47 +00:00
targets.h Use UUIDs instead of names while processing event handlers. 2010-04-14 13:01:38 +00:00