From patchwork Thu Apr 10 10:49:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boaz Harrosh X-Patchwork-Id: 3962061 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3E383BFF02 for ; Thu, 10 Apr 2014 10:50:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4326D2018A for ; Thu, 10 Apr 2014 10:50:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 15A3120429 for ; Thu, 10 Apr 2014 10:50:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965605AbaDJKuM (ORCPT ); Thu, 10 Apr 2014 06:50:12 -0400 Received: from natasha.panasas.com ([209.166.131.148]:34813 "EHLO natasha.panasas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965557AbaDJKuK (ORCPT ); Thu, 10 Apr 2014 06:50:10 -0400 Received: from seabiscuit.panasas.com (seabiscuit.panasas.com [172.17.132.204]) by natasha.panasas.com (8.13.1/8.13.1) with ESMTP id s3AAo44R001356; Thu, 10 Apr 2014 06:50:04 -0400 Received: from [172.17.142.251] (172.17.142.251) by seabiscuit.int.panasas.com (172.17.132.204) with Microsoft SMTP Server (TLS) id 14.1.438.0; Thu, 10 Apr 2014 03:50:03 -0700 Message-ID: <53467757.40909@panasas.com> Date: Thu, 10 Apr 2014 13:49:59 +0300 From: Boaz Harrosh User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: open-osd , NFS list , Daniel Gryniewicz , Elizabeth Ellenbogen Ziph , "Pathak, Santosh" CC: Benny Halevy , Sachin bhamare Subject: [PATCH 1/3] ore: (trivial) reformat some code References: <53467667.3010304@panasas.com> In-Reply-To: <53467667.3010304@panasas.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 rearrange some source lines. Nothing changed. Signed-off-by: Boaz Harrosh --- fs/exofs/ore.c | 19 ++++++++----------- fs/exofs/ore_raid.c | 4 +--- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/fs/exofs/ore.c b/fs/exofs/ore.c index dae8846..98f2137 100644 --- a/fs/exofs/ore.c +++ b/fs/exofs/ore.c @@ -675,8 +675,8 @@ static int _prepare_for_striping(struct ore_io_state *ios) si->cur_pg = si->unit_off / PAGE_SIZE; while (length) { - unsigned comp = dev - first_dev; - struct ore_per_dev_state *per_dev = &ios->per_dev[comp]; + struct ore_per_dev_state *per_dev = + &ios->per_dev[dev - first_dev]; unsigned cur_len, page_off = 0; if (!per_dev->length) { @@ -708,11 +708,9 @@ static int _prepare_for_striping(struct ore_io_state *ios) if (unlikely(ret)) goto out; - dev += mirrors_p1; - dev = (dev % devs_in_group) + first_dev; - length -= cur_len; + dev = ((dev + mirrors_p1) % devs_in_group) + first_dev; si->cur_comp = (si->cur_comp + 1) % group_width; if (unlikely((dev == si->par_dev) || (!length && ios->sp2d))) { if (!length && ios->sp2d) { @@ -721,11 +719,6 @@ static int _prepare_for_striping(struct ore_io_state *ios) */ dev = si->par_dev; } - if (ios->sp2d) - /* In writes cur_len just means if it's the - * last one. See _ore_add_parity_unit. - */ - cur_len = length; per_dev = &ios->per_dev[dev - first_dev]; if (!per_dev->length) { /* Only/always the parity unit of the first @@ -736,7 +729,11 @@ static int _prepare_for_striping(struct ore_io_state *ios) per_dev->offset = si->obj_offset - si->unit_off; } - ret = _ore_add_parity_unit(ios, si, per_dev, cur_len); + /* In writes cur_len just means if it's the + * last one. See _ore_add_parity_unit. + */ + ret = _ore_add_parity_unit(ios, si, per_dev, + ios->sp2d : length : cur_len); if (unlikely(ret)) goto out; diff --git a/fs/exofs/ore_raid.c b/fs/exofs/ore_raid.c index 4e2c032..af417d3 100644 --- a/fs/exofs/ore_raid.c +++ b/fs/exofs/ore_raid.c @@ -226,9 +226,7 @@ static void _gen_xor_unit(struct __stripe_pages_2d *sp2d) init_async_submit(&_1ps->submit, ASYNC_TX_XOR_ZERO_DST | ASYNC_TX_ACK, - NULL, - NULL, NULL, - (addr_conv_t *)_1ps->scribble); + NULL, NULL, NULL, (addr_conv_t *)_1ps->scribble); /* TODO: raid6 */ _1ps->tx = async_xor(_1ps->pages[sp2d->data_devs], _1ps->pages,