summaryrefslogtreecommitdiffstats
path: root/fs/nfs/flexfilelayout
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2015-06-12 18:58:50 +0200
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-06-16 17:14:03 +0200
commit455b6ee6452751dc471b5a434f9398fb825d5149 (patch)
treed5919151d4bb4026d4a40b420f2a83f8aecaf732 /fs/nfs/flexfilelayout
parentSUNRPC: never enqueue a ->rq_cong request on ->sending (diff)
downloadlinux-455b6ee6452751dc471b5a434f9398fb825d5149.tar.xz
linux-455b6ee6452751dc471b5a434f9398fb825d5149.zip
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>
Diffstat (limited to 'fs/nfs/flexfilelayout')
-rw-r--r--fs/nfs/flexfilelayout/flexfilelayout.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
index 7d05089e52d6..0f1410c94827 100644
--- a/fs/nfs/flexfilelayout/flexfilelayout.c
+++ b/fs/nfs/flexfilelayout/flexfilelayout.c
@@ -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]);
}
}