mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-22 17:35:59 +03:00
_find_parallel_space -> _find_segment_space
This commit is contained in:
parent
ebf78e7d19
commit
c00f802202
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
*
|
*
|
||||||
@ -647,7 +647,7 @@ static int _check_contiguous(struct lv_segment *prev_lvseg,
|
|||||||
* Choose sets of parallel areas to use, respecting any constraints.
|
* Choose sets of parallel areas to use, respecting any constraints.
|
||||||
*/
|
*/
|
||||||
/* FIXME Also accept existing areas new space must be parallel to */
|
/* FIXME Also accept existing areas new space must be parallel to */
|
||||||
static int _find_parallel_space(struct alloc_handle *ah, alloc_policy_t alloc,
|
static int _find_segment_space(struct alloc_handle *ah, alloc_policy_t alloc,
|
||||||
struct list *pvms, struct pv_area **areas,
|
struct list *pvms, struct pv_area **areas,
|
||||||
uint32_t areas_size, unsigned can_split,
|
uint32_t areas_size, unsigned can_split,
|
||||||
struct lv_segment *prev_lvseg,
|
struct lv_segment *prev_lvseg,
|
||||||
@ -700,7 +700,7 @@ static int _find_parallel_space(struct alloc_handle *ah, alloc_policy_t alloc,
|
|||||||
pvm->pv,
|
pvm->pv,
|
||||||
pva, areas)) {
|
pva, areas)) {
|
||||||
contiguous_count++;
|
contiguous_count++;
|
||||||
break; /* Next PV */
|
goto next_pv;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -710,7 +710,7 @@ static int _find_parallel_space(struct alloc_handle *ah, alloc_policy_t alloc,
|
|||||||
((!can_split && !ah->log_count) ||
|
((!can_split && !ah->log_count) ||
|
||||||
(already_found_one &&
|
(already_found_one &&
|
||||||
!(alloc == ALLOC_ANYWHERE))))
|
!(alloc == ALLOC_ANYWHERE))))
|
||||||
break; /* Next PV */
|
goto next_pv;
|
||||||
|
|
||||||
if (!already_found_one ||
|
if (!already_found_one ||
|
||||||
alloc == ALLOC_ANYWHERE) {
|
alloc == ALLOC_ANYWHERE) {
|
||||||
@ -720,8 +720,9 @@ static int _find_parallel_space(struct alloc_handle *ah, alloc_policy_t alloc,
|
|||||||
|
|
||||||
areas[ix + ix_offset - 1] = pva;
|
areas[ix + ix_offset - 1] = pva;
|
||||||
|
|
||||||
break; /* Next PV */
|
goto next_pv;
|
||||||
}
|
}
|
||||||
|
next_pv:
|
||||||
if (ix >= areas_size)
|
if (ix >= areas_size)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -757,6 +758,17 @@ static int _find_parallel_space(struct alloc_handle *ah, alloc_policy_t alloc,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int _find_parallel_space(struct alloc_handle *ah, alloc_policy_t alloc,
|
||||||
|
struct list *pvms, struct pv_area **areas,
|
||||||
|
uint32_t areas_size, unsigned can_split,
|
||||||
|
struct lv_segment *prev_lvseg,
|
||||||
|
uint32_t *allocated, uint32_t needed)
|
||||||
|
{
|
||||||
|
return _find_segment_space(ah, alloc, pvms, areas, areas_size,
|
||||||
|
can_split, prev_lvseg,
|
||||||
|
allocated, needed);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Allocate several segments, each the same size, in parallel.
|
* Allocate several segments, each the same size, in parallel.
|
||||||
* If mirrored_pv and mirrored_pe are supplied, it is used as
|
* If mirrored_pv and mirrored_pe are supplied, it is used as
|
||||||
|
Loading…
Reference in New Issue
Block a user