mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
lib/cache/lvmetad: s/pvscan_lvmetad/lvmetad_pvscan/ in the API
This commit is contained in:
parent
c9f56d639b
commit
ca0c8673b2
18
lib/cache/lvmetad.c
vendored
18
lib/cache/lvmetad.c
vendored
@ -123,7 +123,7 @@ retry:
|
|||||||
_lvmetad_token = (char *) "update in progress";
|
_lvmetad_token = (char *) "update in progress";
|
||||||
if (!_token_update()) goto out;
|
if (!_token_update()) goto out;
|
||||||
|
|
||||||
if (pvscan_lvmetad_all_devs(_lvmetad_cmd, NULL)) {
|
if (lvmetad_pvscan_all_devs(_lvmetad_cmd, NULL)) {
|
||||||
_lvmetad_token = future_token;
|
_lvmetad_token = future_token;
|
||||||
if (!_token_update()) goto out;
|
if (!_token_update()) goto out;
|
||||||
}
|
}
|
||||||
@ -773,14 +773,14 @@ int lvmetad_pv_gone_by_dev(struct device *dev, activation_handler handler)
|
|||||||
* The following code implements pvscan --cache.
|
* The following code implements pvscan --cache.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct _pvscan_lvmetad_baton {
|
struct _lvmetad_pvscan_baton {
|
||||||
struct volume_group *vg;
|
struct volume_group *vg;
|
||||||
struct format_instance *fid;
|
struct format_instance *fid;
|
||||||
};
|
};
|
||||||
|
|
||||||
static int _pvscan_lvmetad_single(struct metadata_area *mda, void *baton)
|
static int _lvmetad_pvscan_single(struct metadata_area *mda, void *baton)
|
||||||
{
|
{
|
||||||
struct _pvscan_lvmetad_baton *b = baton;
|
struct _lvmetad_pvscan_baton *b = baton;
|
||||||
struct volume_group *this = mda->ops->vg_read(b->fid, "", mda, 1);
|
struct volume_group *this = mda->ops->vg_read(b->fid, "", mda, 1);
|
||||||
|
|
||||||
/* FIXME Also ensure contents match etc. */
|
/* FIXME Also ensure contents match etc. */
|
||||||
@ -792,12 +792,12 @@ static int _pvscan_lvmetad_single(struct metadata_area *mda, void *baton)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int pvscan_lvmetad_single(struct cmd_context *cmd, struct device *dev,
|
int lvmetad_pvscan_single(struct cmd_context *cmd, struct device *dev,
|
||||||
activation_handler handler)
|
activation_handler handler)
|
||||||
{
|
{
|
||||||
struct label *label;
|
struct label *label;
|
||||||
struct lvmcache_info *info;
|
struct lvmcache_info *info;
|
||||||
struct _pvscan_lvmetad_baton baton;
|
struct _lvmetad_pvscan_baton baton;
|
||||||
/* Create a dummy instance. */
|
/* Create a dummy instance. */
|
||||||
struct format_instance_ctx fic = { .type = 0 };
|
struct format_instance_ctx fic = { .type = 0 };
|
||||||
|
|
||||||
@ -822,7 +822,7 @@ int pvscan_lvmetad_single(struct cmd_context *cmd, struct device *dev,
|
|||||||
if (!baton.fid)
|
if (!baton.fid)
|
||||||
goto_bad;
|
goto_bad;
|
||||||
|
|
||||||
lvmcache_foreach_mda(info, _pvscan_lvmetad_single, &baton);
|
lvmcache_foreach_mda(info, _lvmetad_pvscan_single, &baton);
|
||||||
if (!baton.vg)
|
if (!baton.vg)
|
||||||
lvmcache_fmt(info)->ops->destroy_instance(baton.fid);
|
lvmcache_fmt(info)->ops->destroy_instance(baton.fid);
|
||||||
|
|
||||||
@ -847,7 +847,7 @@ bad:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int pvscan_lvmetad_all_devs(struct cmd_context *cmd, activation_handler handler)
|
int lvmetad_pvscan_all_devs(struct cmd_context *cmd, activation_handler handler)
|
||||||
{
|
{
|
||||||
struct dev_iter *iter;
|
struct dev_iter *iter;
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
@ -859,7 +859,7 @@ int pvscan_lvmetad_all_devs(struct cmd_context *cmd, activation_handler handler)
|
|||||||
}
|
}
|
||||||
|
|
||||||
while ((dev = dev_iter_get(iter))) {
|
while ((dev = dev_iter_get(iter))) {
|
||||||
if (!pvscan_lvmetad_single(cmd, dev, handler)) {
|
if (!lvmetad_pvscan_single(cmd, dev, handler)) {
|
||||||
r = 0;
|
r = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
8
lib/cache/lvmetad.h
vendored
8
lib/cache/lvmetad.h
vendored
@ -125,10 +125,10 @@ struct volume_group *lvmetad_vg_lookup(struct cmd_context *cmd,
|
|||||||
/*
|
/*
|
||||||
* Scan a single device and update lvmetad with the result(s).
|
* Scan a single device and update lvmetad with the result(s).
|
||||||
*/
|
*/
|
||||||
int pvscan_lvmetad_single(struct cmd_context *cmd, struct device *dev,
|
int lvmetad_pvscan_single(struct cmd_context *cmd, struct device *dev,
|
||||||
activation_handler handler);
|
activation_handler handler);
|
||||||
|
|
||||||
int pvscan_lvmetad_all_devs(struct cmd_context *cmd, activation_handler handler);
|
int lvmetad_pvscan_all_devs(struct cmd_context *cmd, activation_handler handler);
|
||||||
|
|
||||||
# else /* LVMETAD_SUPPORT */
|
# else /* LVMETAD_SUPPORT */
|
||||||
|
|
||||||
@ -148,8 +148,8 @@ int pvscan_lvmetad_all_devs(struct cmd_context *cmd, activation_handler handler)
|
|||||||
# define lvmetad_pv_lookup_by_dev(cmd, dev, found) (0)
|
# define lvmetad_pv_lookup_by_dev(cmd, dev, found) (0)
|
||||||
# define lvmetad_vg_list_to_lvmcache(cmd) (1)
|
# define lvmetad_vg_list_to_lvmcache(cmd) (1)
|
||||||
# define lvmetad_vg_lookup(cmd, vgname, vgid) (NULL)
|
# define lvmetad_vg_lookup(cmd, vgname, vgid) (NULL)
|
||||||
# define pvscan_lvmetad_single(cmd, dev, handler) (0)
|
# define lvmetad_pvscan_single(cmd, dev, handler) (0)
|
||||||
# define pvscan_lvmetad_all_devs(cmd, handler) (0)
|
# define lvmetad_pvscan_all_devs(cmd, handler) (0)
|
||||||
|
|
||||||
# endif /* LVMETAD_SUPPORT */
|
# endif /* LVMETAD_SUPPORT */
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ static int _pvscan_lvmetad(struct cmd_context *cmd, int argc, char **argv)
|
|||||||
|
|
||||||
/* Scan everything? */
|
/* Scan everything? */
|
||||||
if (!argc && !devno_args) {
|
if (!argc && !devno_args) {
|
||||||
if (!pvscan_lvmetad_all_devs(cmd, handler))
|
if (!lvmetad_pvscan_all_devs(cmd, handler))
|
||||||
ret = ECMD_FAILED;
|
ret = ECMD_FAILED;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@ -159,7 +159,7 @@ static int _pvscan_lvmetad(struct cmd_context *cmd, int argc, char **argv)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pvscan_lvmetad_single(cmd, dev, handler)) {
|
if (!lvmetad_pvscan_single(cmd, dev, handler)) {
|
||||||
ret = ECMD_FAILED;
|
ret = ECMD_FAILED;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -198,7 +198,7 @@ static int _pvscan_lvmetad(struct cmd_context *cmd, int argc, char **argv)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pvscan_lvmetad_single(cmd, dev, handler)) {
|
if (!lvmetad_pvscan_single(cmd, dev, handler)) {
|
||||||
ret = ECMD_FAILED;
|
ret = ECMD_FAILED;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user