mirror of
git://sourceware.org/git/lvm2.git
synced 2025-02-25 21:57:45 +03:00
lvmcache: add shorter way to delete dev info
Don't make the caller look up the info first.
This commit is contained in:
parent
570c6239ee
commit
1717d4cb17
8
lib/cache/lvmcache.c
vendored
8
lib/cache/lvmcache.c
vendored
@ -1608,6 +1608,14 @@ void lvmcache_del(struct lvmcache_info *info)
|
||||
dm_free(info);
|
||||
}
|
||||
|
||||
void lvmcache_del_dev(struct device *dev)
|
||||
{
|
||||
struct lvmcache_info *info;
|
||||
|
||||
if ((info = lvmcache_info_from_pvid((const char *)dev->pvid, dev, 0)))
|
||||
lvmcache_del(info);
|
||||
}
|
||||
|
||||
/*
|
||||
* vginfo must be info->vginfo unless info is NULL (orphans)
|
||||
*/
|
||||
|
2
lib/cache/lvmcache.h
vendored
2
lib/cache/lvmcache.h
vendored
@ -59,6 +59,7 @@ struct lvmcache_vgsummary {
|
||||
const char *lock_type;
|
||||
uint32_t mda_checksum;
|
||||
size_t mda_size;
|
||||
int zero_offset;
|
||||
};
|
||||
|
||||
int lvmcache_init(void);
|
||||
@ -83,6 +84,7 @@ struct lvmcache_info *lvmcache_add(struct labeller *labeller, const char *pvid,
|
||||
uint32_t vgstatus);
|
||||
int lvmcache_add_orphan_vginfo(const char *vgname, struct format_type *fmt);
|
||||
void lvmcache_del(struct lvmcache_info *info);
|
||||
void lvmcache_del_dev(struct device *dev);
|
||||
|
||||
/* Update things */
|
||||
int lvmcache_update_vgname_and_id(struct lvmcache_info *info,
|
||||
|
Loading…
x
Reference in New Issue
Block a user