mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-11 20:58:50 +03:00
A cache LV - from LVM's perpective - is a user accessible device that links the cachepool LV and the origin LV. The following functions were added to facilitate the creation and removal of this top-level LV: 1) 'lv_cache_create' - takes a cachepool and an origin device and links them into a new top-level LV of 'cache' segment type. No allocation is necessary in this function, as the sub-LVs contain all of the necessary allocated space. Only the top-level layer needs to be created. 2) 'lv_cache_remove' - this function removes the top-level LV of a cache LV - promoting the cachepool and origin sub-LVs to top-level devices and leaving them exposed to the user. That is, the cachepool is unlinked and free to be used with another origin to form a new cache LV; and the origin is no longer cached. (Currently, if the cache needs to be flushed, it is done in this function and the function waits for it to complete before proceeding. This will be taken out in a future patch in favor of polling.)