mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 16:29:59 +00:00
pnfs/flexfiles: use swap() in ff_layout_sort_mirrors()
Use kernel.h macro definition. Thanks to Julia Lawall for Coccinelle scripting support. Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
parent
2980731811
commit
455b6ee645
1 changed files with 3 additions and 6 deletions
|
@ -182,17 +182,14 @@ static void _ff_layout_free_lseg(struct nfs4_ff_layout_segment *fls)
|
|||
|
||||
static void ff_layout_sort_mirrors(struct nfs4_ff_layout_segment *fls)
|
||||
{
|
||||
struct nfs4_ff_layout_mirror *tmp;
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < fls->mirror_array_cnt - 1; i++) {
|
||||
for (j = i + 1; j < fls->mirror_array_cnt; j++)
|
||||
if (fls->mirror_array[i]->efficiency <
|
||||
fls->mirror_array[j]->efficiency) {
|
||||
tmp = fls->mirror_array[i];
|
||||
fls->mirror_array[i] = fls->mirror_array[j];
|
||||
fls->mirror_array[j] = tmp;
|
||||
}
|
||||
fls->mirror_array[j]->efficiency)
|
||||
swap(fls->mirror_array[i],
|
||||
fls->mirror_array[j]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue