From patchwork Fri Jun 12 16:58:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 6599911 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 03D8C9F2F4 for ; Fri, 12 Jun 2015 17:02:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3E7182068C for ; Fri, 12 Jun 2015 17:02:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6E6DF2066F for ; Fri, 12 Jun 2015 17:02:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755261AbbFLQ7E (ORCPT ); Fri, 12 Jun 2015 12:59:04 -0400 Received: from mailrelay108.isp.belgacom.be ([195.238.20.135]:1917 "EHLO mailrelay108.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755222AbbFLQ66 (ORCPT ); Fri, 12 Jun 2015 12:58:58 -0400 X-Belgacom-Dynamic: yes X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=E12Nk8Bf0hMlwhhcPGlCWJx/tbvGdtmOO6CYG/XBrkw= c=1 sm=2 a=kgPqUlFJGlma_hXhReIA:9 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DyeQDGDntV/zoHQFdcgXKBHgGBMqtVBQEFBQGBBJJghgmBQj0QAQEBAQEBAYEKQQOEDC8jgRo3iDMB1xmGGYowHYQXBZ8SjU6KOiZjZgFBHIFUPDGCRwEBAQ Received: from 58.7-64-87.adsl-dyn.isp.belgacom.be (HELO localhost.home.) ([87.64.7.58]) by relay.skynet.be with ESMTP; 12 Jun 2015 18:58:54 +0200 From: Fabian Frederick To: linux-kernel@vger.kernel.org Cc: Julia Lawall , Fabian Frederick , Trond Myklebust , Anna Schumaker , linux-nfs@vger.kernel.org Subject: [PATCH 1/1 linux-next] pnfs/flexfiles: use swap() in ff_layout_sort_mirrors() Date: Fri, 12 Jun 2015 18:58:50 +0200 Message-Id: <1434128330-10253-1-git-send-email-fabf@skynet.be> X-Mailer: git-send-email 2.4.2 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use kernel.h macro definition. Thanks to Julia Lawall for Coccinelle scripting support. Signed-off-by: Fabian Frederick --- fs/nfs/flexfilelayout/flexfilelayout.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index 7d05089..0f1410c 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]); } }