mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Move compose_log_line() into mirror directory.
This commit is contained in:
parent
0c09c9d943
commit
197632009b
@ -1,5 +1,6 @@
|
|||||||
Version 2.01.15 -
|
Version 2.01.15 -
|
||||||
=================================
|
=================================
|
||||||
|
Move compose_log_line() into mirror directory.
|
||||||
Factor out _get_library_path().
|
Factor out _get_library_path().
|
||||||
Don't kill idling clvmd threads.
|
Don't kill idling clvmd threads.
|
||||||
Recognise ATA over Ethernet (aoe) devices.
|
Recognise ATA over Ethernet (aoe) devices.
|
||||||
|
@ -727,8 +727,8 @@ static int _emit_target_line(struct dev_manager *dm, struct dm_task *dmt,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _build_dev_string(struct dev_manager *dm, char *dlid,
|
int build_dev_string(struct dev_manager *dm, char *dlid, char *devbuf,
|
||||||
char *devbuf, size_t bufsize, const char *desc)
|
size_t bufsize, const char *desc)
|
||||||
{
|
{
|
||||||
struct dev_layer *dl;
|
struct dev_layer *dl;
|
||||||
|
|
||||||
@ -749,45 +749,6 @@ static int _build_dev_string(struct dev_manager *dm, char *dlid,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int compose_log_line(struct dev_manager *dm, struct lv_segment *seg,
|
|
||||||
char *params, size_t paramsize, int *pos, int areas,
|
|
||||||
uint32_t region_size)
|
|
||||||
{
|
|
||||||
int tw;
|
|
||||||
char devbuf[10];
|
|
||||||
char *name;
|
|
||||||
|
|
||||||
if (!seg->log_lv)
|
|
||||||
tw = lvm_snprintf(params, paramsize, "core 1 %u %u ",
|
|
||||||
region_size, areas);
|
|
||||||
else {
|
|
||||||
if (!(name = build_dm_name(dm->mem, seg->log_lv->vg->name,
|
|
||||||
seg->log_lv->name, NULL))) {
|
|
||||||
stack;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!_build_dev_string(dm, seg->log_lv->lvid.s, devbuf,
|
|
||||||
sizeof(devbuf), "log")) {
|
|
||||||
stack;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* FIXME add sync parm? */
|
|
||||||
tw = lvm_snprintf(params, paramsize, "disk 2 %s %u %u ",
|
|
||||||
devbuf, region_size, areas);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tw < 0) {
|
|
||||||
stack;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
*pos += tw;
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int compose_areas_line(struct dev_manager *dm, struct lv_segment *seg,
|
int compose_areas_line(struct dev_manager *dm, struct lv_segment *seg,
|
||||||
char *params, size_t paramsize, int *pos, int start_area,
|
char *params, size_t paramsize, int *pos, int start_area,
|
||||||
int areas)
|
int areas)
|
||||||
@ -816,7 +777,7 @@ int compose_areas_line(struct dev_manager *dm, struct lv_segment *seg,
|
|||||||
(esize * seg_pe(seg, s))),
|
(esize * seg_pe(seg, s))),
|
||||||
trailing_space);
|
trailing_space);
|
||||||
else if (seg_type(seg, s) == AREA_LV) {
|
else if (seg_type(seg, s) == AREA_LV) {
|
||||||
if (!_build_dev_string(dm, seg_lv(seg, s)->lvid.s, devbuf,
|
if (!build_dev_string(dm, seg_lv(seg, s)->lvid.s, devbuf,
|
||||||
sizeof(devbuf), "LV")) {
|
sizeof(devbuf), "LV")) {
|
||||||
stack;
|
stack;
|
||||||
return 0;
|
return 0;
|
||||||
@ -901,7 +862,7 @@ static int _populate_origin(struct dev_manager *dm,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_build_dev_string(dm, real, params, sizeof(params), "origin")) {
|
if (!build_dev_string(dm, real, params, sizeof(params), "origin")) {
|
||||||
stack;
|
stack;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -942,13 +903,12 @@ static int _populate_snapshot(struct dev_manager *dm,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_build_dev_string(dm, origin, devbufo, sizeof(devbufo),
|
if (!build_dev_string(dm, origin, devbufo, sizeof(devbufo), "origin")) {
|
||||||
"origin")) {
|
|
||||||
stack;
|
stack;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_build_dev_string(dm, cow, devbufc, sizeof(devbufc), "cow")) {
|
if (!build_dev_string(dm, cow, devbufc, sizeof(devbufc), "cow")) {
|
||||||
stack;
|
stack;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -23,8 +23,7 @@ int compose_areas_line(struct dev_manager *dm, struct lv_segment *seg,
|
|||||||
char *params, size_t paramsize, int *pos,
|
char *params, size_t paramsize, int *pos,
|
||||||
int start_area, int areas);
|
int start_area, int areas);
|
||||||
|
|
||||||
int compose_log_line(struct dev_manager *dm, struct lv_segment *seg,
|
int build_dev_string(struct dev_manager *dm, char *dlid, char *devbuf,
|
||||||
char *params, size_t paramsize, int *pos, int areas,
|
size_t bufsize, const char *desc);
|
||||||
uint32_t region_size);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -165,6 +165,38 @@ static struct mirror_state *_init_target(struct pool *mem,
|
|||||||
return mirr_state;
|
return mirr_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int _compose_log_line(struct dev_manager *dm, struct lv_segment *seg,
|
||||||
|
char *params, size_t paramsize, int *pos,
|
||||||
|
int areas, uint32_t region_size)
|
||||||
|
{
|
||||||
|
int tw;
|
||||||
|
char devbuf[10];
|
||||||
|
|
||||||
|
if (!seg->log_lv)
|
||||||
|
tw = lvm_snprintf(params, paramsize, "core 1 %u %u ",
|
||||||
|
region_size, areas);
|
||||||
|
else {
|
||||||
|
if (!build_dev_string(dm, seg->log_lv->lvid.s, devbuf,
|
||||||
|
sizeof(devbuf), "log")) {
|
||||||
|
stack;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* FIXME add sync parm? */
|
||||||
|
tw = lvm_snprintf(params, paramsize, "disk 2 %s %u %u ",
|
||||||
|
devbuf, region_size, areas);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tw < 0) {
|
||||||
|
stack;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
*pos += tw;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static int _compose_target_line(struct dev_manager *dm, struct pool *mem,
|
static int _compose_target_line(struct dev_manager *dm, struct pool *mem,
|
||||||
struct config_tree *cft, void **target_state,
|
struct config_tree *cft, void **target_state,
|
||||||
struct lv_segment *seg, char *params,
|
struct lv_segment *seg, char *params,
|
||||||
@ -220,7 +252,7 @@ static int _compose_target_line(struct dev_manager *dm, struct pool *mem,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ret = compose_log_line(dm, seg, params, paramsize, pos,
|
if ((ret = _compose_log_line(dm, seg, params, paramsize, pos,
|
||||||
areas, region_size)) <= 0) {
|
areas, region_size)) <= 0) {
|
||||||
stack;
|
stack;
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user