[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1434129477.2972.38.camel@perches.com>
Date: Fri, 12 Jun 2015 10:17:57 -0700
From: Joe Perches <joe@...ches.com>
To: Fabian Frederick <fabf@...net.be>
Cc: linux-kernel@...r.kernel.org, Julia Lawall <Julia.Lawall@...6.fr>,
Trond Myklebust <trond.myklebust@...marydata.com>,
Anna Schumaker <anna.schumaker@...app.com>,
linux-nfs@...r.kernel.org
Subject: Re: [PATCH 1/1 linux-next] pnfs/flexfiles: use swap() in
ff_layout_sort_mirrors()
On Fri, 2015-06-12 at 18:58 +0200, Fabian Frederick wrote:
> Use kernel.h macro definition.
A lot of these conversions seem to be for bubble sorts.
Maybe it'd be useful to add a generic one somewhere.
> diff --git 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]);
> }
> }
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists