Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6270775rwr; Mon, 24 Apr 2023 17:11:06 -0700 (PDT) X-Google-Smtp-Source: AKy350ax0aPe80DfwDa0uF/rO4wP3hjLuJF9/6S4xSXGEMM4A0CfhKTDV0JzGLknu5FVvDFMc5af X-Received: by 2002:a17:903:2441:b0:1a0:50bd:31a8 with SMTP id l1-20020a170903244100b001a050bd31a8mr20042565pls.26.1682381466255; Mon, 24 Apr 2023 17:11:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682381466; cv=none; d=google.com; s=arc-20160816; b=W0BzhfKAa8ANI8rvrGgATkyP3FD1MkunZUQEmHUlaSjx0gXjg6flBKIsYKgv0S9kMv 4wbsRkOzp0A80i1DcmpLQ21pgmAtr0elAs5v33DJemt8j4xWkNiDyNy9lmrfWdSP+XaU uooomFTrAn881//HxQk7HIqgMErawPhJlKQ8TUsvwB55FK9kGNVOsHBcLg8sYDYNM1q/ qg6sFbIHBc50f/lup/MuPO6qi2zeStc/HYsXhUz+w7rPx/smbXM3essDi84QgcpnXi0m /Hm9fjHxXdlNZqH7xA0jOEyx0olCUj3A0eSfIeEvfd983XBa3i+sTWU26s7f2UKvwBZ1 9vSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=OLdQoVKAUqPHofRG1MGFuuzT1ofAR4coofzzDBwGgNU=; b=jL/LNmSVZJnyk5Sc3KPR0ziYWo1igd4p7WxX5hREUFWAPgHORrnSCuM4YDpWv85OAE XohqLNsba1BrCNAIyJO0dGt2C3cSz3uVkTeiLPYC0epuiFlxXEI4GbUZrcJHewpN8Idb VIXp+b/HB3ytZvOR0dgYLc/GL6ZN9mqCt7vTSXvzf1eP55nRsu/MIhx4to4MJztxmCdL 7dbqnp2JxoGxzHVlRXfddDY1NdHZgULkPue4C/hsde8wh3NXn35S6upc40+GX3ReDrRg vf7IgQ9+CwvA8G7oY7ZsOhEJMwjUQNaPv50JjGTkxzV9joZ04bjqWw0g3bHuJ6IqLKdX 7a7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dsfphbNw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a10-20020a170902710a00b001a1e4051da5si11362053pll.498.2023.04.24.17.10.49; Mon, 24 Apr 2023 17:11:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dsfphbNw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232801AbjDYADo (ORCPT + 99 others); Mon, 24 Apr 2023 20:03:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232336AbjDYADm (ORCPT ); Mon, 24 Apr 2023 20:03:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CD115274; Mon, 24 Apr 2023 17:03:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0A7D462A62; Tue, 25 Apr 2023 00:03:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64BB5C433A0; Tue, 25 Apr 2023 00:03:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682381020; bh=trnIgor0xX4q/91c1oebGULzgj8kBzmPIz2WyUUR4fs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=dsfphbNwZy7ol45+HO89fFOFBVmbtLKbVFYU0+3lRL47HiJpa9sHbkNeu0acGZDcH RaYMGES44ByO2JY0pyqpUsucD8TQJvyhwHquSnu5mfTOK1ctKl8hspfTPmvrC7rOWo vXjmS/s7bRIP7nWuDV0rzNvUpqk84YX7PSDz9xeJFZul4hjgd981THJWdaIunfBQm3 tV5eImY6lSCVLEmgQR3bRqFmecC9WtkV0X18EuXi/1DjcadULIAB5j3JW9g7dUwOku uM1ppt6wnHBzvVfN16WWpQmSgvphrlVCkEFR9E9PKIgClRUTtyRqmaIHg+d9sAK9B3 Dj/gTmXGNB8UQ== Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2a8ad872ea5so49564221fa.2; Mon, 24 Apr 2023 17:03:40 -0700 (PDT) X-Gm-Message-State: AAQBX9eSaF3AgWXHPbCRyhrvNV7pO94+A9L6ZbAVBIXogDMvyKQKxJ3k ziNb1c3pQjIcjRtRjjiYbmVtXyduESEINkWRsOA= X-Received: by 2002:a2e:9595:0:b0:2a8:c249:63a4 with SMTP id w21-20020a2e9595000000b002a8c24963a4mr2976379ljh.47.1682381018366; Mon, 24 Apr 2023 17:03:38 -0700 (PDT) MIME-Version: 1.0 References: <20230420112946.2869956-1-yukuai1@huaweicloud.com> <20230420112946.2869956-3-yukuai1@huaweicloud.com> In-Reply-To: <20230420112946.2869956-3-yukuai1@huaweicloud.com> From: Song Liu Date: Mon, 24 Apr 2023 17:03:26 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH -next 2/8] md/raid1-10: rename raid1-10.c to raid1-10.h To: Yu Kuai Cc: neilb@suse.de, akpm@osdl.org, linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yi.zhang@huawei.com, yangerkun@huawei.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 20, 2023 at 4:31=E2=80=AFAM Yu Kuai w= rote: > > From: Yu Kuai > > raid1-10.c contains definitions that are used both for raid1 and raid10, > it's werid to use ".c" suffix. type: weird. Please see the original discussion about raid1-10.c here: https://lore.kernel.org/linux-raid/20170712082912.491-1-ming.lei@redhat.com= / Let's keep raid1-10.c for now. Thanks, Song > > Signed-off-by: Yu Kuai > --- > drivers/md/{raid1-10.c =3D> raid1-10.h} | 10 +++++++--- > drivers/md/raid1.c | 2 -- > drivers/md/raid1.h | 2 ++ > drivers/md/raid10.c | 2 -- > drivers/md/raid10.h | 2 ++ > 5 files changed, 11 insertions(+), 7 deletions(-) > rename drivers/md/{raid1-10.c =3D> raid1-10.h} (92%) > > diff --git a/drivers/md/raid1-10.c b/drivers/md/raid1-10.h > similarity index 92% > rename from drivers/md/raid1-10.c > rename to drivers/md/raid1-10.h > index e61f6cad4e08..04beef35142d 100644 > --- a/drivers/md/raid1-10.c > +++ b/drivers/md/raid1-10.h > @@ -1,4 +1,7 @@ > // SPDX-License-Identifier: GPL-2.0 > +#ifndef _RAID1_10_H > +#define _RAID1_10_H > + > /* Maximum size of each resync request */ > #define RESYNC_BLOCK_SIZE (64*1024) > #define RESYNC_PAGES ((RESYNC_BLOCK_SIZE + PAGE_SIZE-1) / PAGE_SIZE) > @@ -33,7 +36,7 @@ struct raid1_plug_cb { > struct bio_list pending; > }; > > -static void rbio_pool_free(void *rbio, void *data) > +static inline void rbio_pool_free(void *rbio, void *data) > { > kfree(rbio); > } > @@ -91,8 +94,8 @@ static inline struct resync_pages *get_resync_pages(str= uct bio *bio) > } > > /* generally called after bio_reset() for reseting bvec */ > -static void md_bio_reset_resync_pages(struct bio *bio, struct resync_pag= es *rp, > - int size) > +static inline void md_bio_reset_resync_pages(struct bio *bio, > + struct resync_pages *rp, int= size) > { > int idx =3D 0; > > @@ -109,3 +112,4 @@ static void md_bio_reset_resync_pages(struct bio *bio= , struct resync_pages *rp, > size -=3D len; > } while (idx++ < RESYNC_PAGES && size > 0); > } > +#endif > diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c > index 2f1011ffdf09..84724b9b20b8 100644 > --- a/drivers/md/raid1.c > +++ b/drivers/md/raid1.c > @@ -49,8 +49,6 @@ static void lower_barrier(struct r1conf *conf, sector_t= sector_nr); > #define raid1_log(md, fmt, args...) \ > do { if ((md)->queue) blk_add_trace_msg((md)->queue, "raid1 " fmt= , ##args); } while (0) > > -#include "raid1-10.c" > - > #define START(node) ((node)->start) > #define LAST(node) ((node)->last) > INTERVAL_TREE_DEFINE(struct serial_info, node, sector_t, _subtree_last, > diff --git a/drivers/md/raid1.h b/drivers/md/raid1.h > index 468f189da7a0..80de4d66f010 100644 > --- a/drivers/md/raid1.h > +++ b/drivers/md/raid1.h > @@ -2,6 +2,8 @@ > #ifndef _RAID1_H > #define _RAID1_H > > +#include "raid1-10.h" > + > /* > * each barrier unit size is 64MB fow now > * note: it must be larger than RESYNC_DEPTH > diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c > index a116b7c9d9f3..50d56b6af42f 100644 > --- a/drivers/md/raid10.c > +++ b/drivers/md/raid10.c > @@ -77,8 +77,6 @@ static void end_reshape(struct r10conf *conf); > #define raid10_log(md, fmt, args...) \ > do { if ((md)->queue) blk_add_trace_msg((md)->queue, "raid10 " fm= t, ##args); } while (0) > > -#include "raid1-10.c" > - > #define NULL_CMD > #define cmd_before(conf, cmd) \ > do { \ > diff --git a/drivers/md/raid10.h b/drivers/md/raid10.h > index 63e48b11b552..63e88dd774f7 100644 > --- a/drivers/md/raid10.h > +++ b/drivers/md/raid10.h > @@ -2,6 +2,8 @@ > #ifndef _RAID10_H > #define _RAID10_H > > +#include "raid1-10.h" > + > /* Note: raid10_info.rdev can be set to NULL asynchronously by > * raid10_remove_disk. > * There are three safe ways to access raid10_info.rdev. > -- > 2.39.2 >