1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-17 06:04:23 +03:00

lvmcache: add lvmcache_get_dev_mda

for future patch
This commit is contained in:
David Teigland 2020-10-15 12:53:01 -05:00
parent 2c9bb67604
commit b3cdf0d881
2 changed files with 17 additions and 0 deletions

15
lib/cache/lvmcache.c vendored
View File

@ -271,6 +271,21 @@ void lvmcache_get_mdas(struct cmd_context *cmd,
}
}
struct metadata_area *lvmcache_get_dev_mda(struct device *dev, int mda_num)
{
struct lvmcache_info *info;
struct metadata_area *mda;
if (!(info = lvmcache_info_from_pvid(dev->pvid, dev, 0)))
return NULL;
dm_list_iterate_items(mda, &info->mdas) {
if (mda->mda_num == mda_num)
return mda;
}
return NULL;
}
static void _vginfo_detach_info(struct lvmcache_info *info)
{
if (!dm_list_empty(&info->list)) {

View File

@ -220,4 +220,6 @@ void lvmcache_get_mdas(struct cmd_context *cmd,
const char *dev_filtered_reason(struct device *dev);
const char *devname_error_reason(const char *devname);
struct metadata_area *lvmcache_get_dev_mda(struct device *dev, int mda_num);
#endif