Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966683AbcJFJSu (ORCPT ); Thu, 6 Oct 2016 05:18:50 -0400 Received: from mout.web.de ([212.227.15.4]:57886 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966035AbcJFJSq (ORCPT ); Thu, 6 Oct 2016 05:18:46 -0400 Subject: [PATCH 20/54] md/raid1: Add some spaces for better code readability To: linux-raid@vger.kernel.org, Christoph Hellwig , Guoqing Jiang , Jens Axboe , Mike Christie , Neil Brown , Shaohua Li , Tomasz Majchrzak References: <566ABCD9.1060404@users.sourceforge.net> <786843ef-4b6f-eb04-7326-2f6f5b408826@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: Date: Thu, 6 Oct 2016 11:18:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <786843ef-4b6f-eb04-7326-2f6f5b408826@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:ydaF0FtZnPQNZDBeEd3S3WPXigLTOdgkZrGgdaraFbvGOADYm5D 3aRBFOi6PGJTaww+X9QsQRxIeyTvZeQD44O4vZfjs0O4pdMElLHpeyYmmBsjA3UpMnQ+nVy D5PUZ7e3Cj3W3SXlW3olWSdVAwuiYQK10KfuaDcvwoJ4JE2Sh5EBOe4gGeJmTRdm/7MwlJe O4no5mtmfHJir4/HhXBnA== X-UI-Out-Filterresults: notjunk:1;V01:K0:kKFSTbsXkjA=:AICR3OZX9NDiMlGA/LjoQQ 7LyQB5wTKTux0rKfggdcSWl/VQyYcv+AWpOzNaMnnBxJOSyYChwmJB+35k+m9g4b4iiMcQzAK udgI6snGedIE7tFE6AiIXlq44CdnoPbq7B63chsiShZwn5vxyhnlz8l+/YcYu4ykfHwf98DEE H5PlaXTN44X0jOMJPO723AV3jR0ZC07YghOcF8UF0O32adnNypx2FliNMVDdzW2K9C02cihwh 6XaTI1tyrULISSmrLgFaD3TFwG3XCBA6411p85JSVr25zhGmTdWs40GiM+TuzjKvPDJQOAh6h 5Oc4+zB8zCSepi8O6oIVXsKCTopj0cqJf/EcPJasBIypMKraTyuzhMJMpuvzTodvCAF5aHPL0 P1dJ9pqJn44Aqo3LUK37VrdigD1ZFJbCl2NCBcLBfzqNIAGOjSzp24weAlNiFjZJW1PPhziOM RsU2+VFbVOB0wxtxcpWqQqD4Afl+dyWGkfCVxKtE4SSYJgiVPPfDH55fhGsaWrkoGfMbppDKS TxLHKo5AmWo4gTIl4LJIVE2Y9KnFSEwMEevyxcAhjjinXw4TQ+3eKBrKHhW4fr+aRwhPNWfHY dsS9rRYoDoz07Z9dSsk7/4V1Kb2+APvzO+pm4nFSYqcL3JcCGCtoPgknlvFR59J3dkaEMDuI3 le1PVfMlHwf7dxr7YYNW1aE2u3m8PM1sUnFrPPFl8IgfAYpldKDo//zv/wbG4xiukhr7nSNk0 u5eP7ssMVDHHh5l0Ayiq8H4wg3u1RMlxYQ8hu6nqWxXuFZanw0aO4tR+eh/LZrf9bWu3/Rj8L HKbTn5D Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4807 Lines: 156 From: Markus Elfring Date: Tue, 4 Oct 2016 20:42:25 +0200 Use space characters at some source code places according to the Linux coding style convention. Signed-off-by: Markus Elfring --- drivers/md/raid1.c | 62 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 9754b7d..3a03d19 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -136,8 +136,8 @@ static void * r1buf_pool_alloc(gfp_t gfp_flags, void *data) } /* If not user-requests, copy the page pointers to all bios */ if (!test_bit(MD_RECOVERY_REQUESTED, &pi->mddev->recovery)) { - for (i=0; iraid_disks; j++) + for (i = 0; i < RESYNC_PAGES ; i++) + for (j = 1; j < pi->raid_disks; j++) r1_bio->bios[j]->bi_io_vec[i].bv_page = r1_bio->bios[0]->bi_io_vec[i].bv_page; } @@ -160,7 +160,7 @@ static void * r1buf_pool_alloc(gfp_t gfp_flags, void *data) static void r1buf_pool_free(void *__r1_bio, void *data) { struct pool_info *pi = data; - int i,j; + int i, j; struct r1bio *r1bio = __r1_bio; for (i = 0; i < RESYNC_PAGES; i++) @@ -170,7 +170,7 @@ static void r1buf_pool_free(void *__r1_bio, void *data) r1bio->bios[0]->bi_io_vec[i].bv_page) safe_put_page(r1bio->bios[j]->bi_io_vec[i].bv_page); } - for (i=0 ; i < pi->raid_disks; i++) + for (i = 0 ; i < pi->raid_disks; i++) bio_put(r1bio->bios[i]); r1bio_pool_free(r1bio, data); @@ -1785,7 +1785,7 @@ static int fix_sync_read_error(struct r1bio *r1_bio) int sectors = r1_bio->sectors; int idx = 0; - while(sectors) { + while (sectors) { int s = sectors; int d = r1_bio->read_disk; int success = 0; @@ -2040,7 +2040,8 @@ static void fix_read_error(struct r1conf *conf, int read_disk, sector_t sect, int sectors) { struct mddev *mddev = conf->mddev; - while(sectors) { + + while (sectors) { int s = sectors; int d = read_disk; int success = 0; @@ -2087,7 +2088,7 @@ static void fix_read_error(struct r1conf *conf, int read_disk, /* write it back and re-read */ start = d; while (d != read_disk) { - if (d==0) + if (d == 0) d = conf->raid_disks * 2; d--; rcu_read_lock(); @@ -2105,7 +2106,8 @@ static void fix_read_error(struct r1conf *conf, int read_disk, d = start; while (d != read_disk) { char b[BDEVNAME_SIZE]; - if (d==0) + + if (d == 0) d = conf->raid_disks * 2; d--; rcu_read_lock(); @@ -2942,7 +2944,7 @@ static int raid1_run(struct mddev *mddev) } mddev->degraded = 0; - for (i=0; i < conf->raid_disks; i++) + for (i = 0; i < conf->raid_disks; i++) if (!conf->mirrors[i].rdev || !test_bit(In_sync, &conf->mirrors[i].rdev->flags) || test_bit(Faulty, &conf->mirrors[i].rdev->flags)) @@ -3067,8 +3069,8 @@ static int raid1_reshape(struct mddev *mddev) raid_disks = mddev->raid_disks + mddev->delta_disks; if (raid_disks < conf->raid_disks) { - cnt=0; - for (d= 0; d < conf->raid_disks; d++) + cnt = 0; + for (d = 0; d < conf->raid_disks; d++) if (conf->mirrors[d].rdev) cnt++; if (cnt > raid_disks) @@ -3139,7 +3141,7 @@ static void raid1_quiesce(struct mddev *mddev, int state) { struct r1conf *conf = mddev->private; - switch(state) { + switch (state) { case 2: /* wake for suspend */ wake_up(&conf->wait_barrier); break; @@ -3172,24 +3174,24 @@ static void *raid1_takeover(struct mddev *mddev) } static struct md_personality raid1_personality = { - .name = "raid1", - .level = 1, - .owner = THIS_MODULE, - .make_request = raid1_make_request, - .run = raid1_run, - .free = raid1_free, - .status = raid1_status, - .error_handler = raid1_error, - .hot_add_disk = raid1_add_disk, - .hot_remove_disk= raid1_remove_disk, - .spare_active = raid1_spare_active, - .sync_request = raid1_sync_request, - .resize = raid1_resize, - .size = raid1_size, - .check_reshape = raid1_reshape, - .quiesce = raid1_quiesce, - .takeover = raid1_takeover, - .congested = raid1_congested, + .name = "raid1", + .level = 1, + .owner = THIS_MODULE, + .make_request = raid1_make_request, + .run = raid1_run, + .free = raid1_free, + .status = raid1_status, + .error_handler = raid1_error, + .hot_add_disk = raid1_add_disk, + .hot_remove_disk = raid1_remove_disk, + .spare_active = raid1_spare_active, + .sync_request = raid1_sync_request, + .resize = raid1_resize, + .size = raid1_size, + .check_reshape = raid1_reshape, + .quiesce = raid1_quiesce, + .takeover = raid1_takeover, + .congested = raid1_congested, }; static int __init raid_init(void) -- 2.10.1