Message ID | 20230309094317.69773-1-frank.li@vivo.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp202199wrd; Thu, 9 Mar 2023 02:04:54 -0800 (PST) X-Google-Smtp-Source: AK7set9iDz7A9G1p1CxoA4kpTWdOWH2+sv6X5ZPLC3V9DazaoLwq++DFZt8Hu2lsIYIHhiaBYCnH X-Received: by 2002:a05:6a20:8403:b0:cc:76ec:70dc with SMTP id c3-20020a056a20840300b000cc76ec70dcmr27007345pzd.26.1678356294049; Thu, 09 Mar 2023 02:04:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678356294; cv=pass; d=google.com; s=arc-20160816; b=E2T5gf5QrCeMPtsLyn0OYsd173F442Sos/CsULseuLoy8Ip199PGnnJmqMGo7nfZ+l ej2HcNA8itotCa+bPS0l36TSR7ad9daRSjzsRMSygDbnFTn12rRdXhdNc3fKxWGQf/mW jHffLij64fQGL4isArC+gs+McKz+mtwUMcgPN7MSmykkv2tHmNxs8NxlumMsO6xniYuG LNiKqO5ZYpJsrQfOiRYMvmDSZ+PKH/1ps5pCRj0eE1FB2uXjbC2HddwA/ftwKZimDn8g 6u9ZQi8yBSMNcy26OKJkQ9oamQB8sq4mcv30KK8EXI+NBK8bEHAmjoD5w9In/whyHBjD PO4Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=zUYza8g2PyCIiC2OrOmKbG3IQTXkQ4xS0l+bQ/UtoeM=; b=ZoU6t5O3sVFaDZc56M0dA9lDQMtwzPOr/LKduVULK3ZeCY45wc3SJwbdTHf9zhRMO/ c0rkDBj7RHzMVpTfJWka34dTnbD610XKcEyVi9pw9pbEYrsuF4o5n0Okaywbbd6PF5AB uQ4WBLQukn9pt8i5AB13HVyJGwKzvo+zqQEIZmHuW+tPhnhe5UdxAVlmXqWYXY16Cwx7 ol8MBAOW6iobUxZ8s7NJMakbM4waiuB1cbTeQz7Xay4rKFYvI0QKlXBJ+ruaEXRXzQOQ C/jK8DQACmgwpRbdobNX4M8VvLA3tqDp2u1iqlq/dB2WFx59k8tQ72ybtbD7fY1bqR8U OJEA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=KpMPMDOZ; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l190-20020a6388c7000000b00502f49a9b86si17492743pgd.635.2023.03.09.02.04.39; Thu, 09 Mar 2023 02:04:54 -0800 (PST) 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=@vivo.com header.s=selector2 header.b=KpMPMDOZ; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231232AbjCIJnv (ORCPT <rfc822;carlos.wei.hk@gmail.com> + 99 others); Thu, 9 Mar 2023 04:43:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231360AbjCIJnk (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 9 Mar 2023 04:43:40 -0500 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2104.outbound.protection.outlook.com [40.107.117.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 256D1D462D; Thu, 9 Mar 2023 01:43:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cyn7YCxxuNbOxWA+YYTRV8tYUDLT5HgTfGm7rfviLCvo8YHu1ElfhF+2gYgHGz1kuZVIJvuh1GeCWXKt83foYawjf5GunbgeVW8DS4U5z07fukFMNVjATuN060kg3XoBULOWiyF42qcKtSjwvoP3cZYVfc+N+0tKmr3PIIt3fjvsXThXysOVKwNFpQWWtIzmOF3u6UzC/7jy+j1pY+PSsQ8z45Y9z1uh3ys+pi7Tun5B6q6lWJ96yds8wicqBxHYgB9R9vrTjQE2Q6RmkJ3o6BR+RXTRgjwD0Ha8reeHYPISJ6F2QgmkBruKt1Oq0GHju80rLbnpwBzr9ldhyNZWTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zUYza8g2PyCIiC2OrOmKbG3IQTXkQ4xS0l+bQ/UtoeM=; b=CxzQ5LIKO/AVNQrWynR4wv8ePw+K/B+Bpj96+a6/YcM8HjJJiDw4InnL/Hk8LL4UIlCCTJH4iK/E3sEM7KSeM+uY5a7nePGNGSsELXIhpsruBj8dMpQoGy4ceuV3TiRxkYxm62AuAANMVXoKiBJ5JIIHc120BzYyyJU0Kcg4bRcFM5LFVbtaa5w9znf+bReHAGj3FV2ZY+vJPI6GIz8OI1h8+ftsXKBnaJw2LRQ9p6Vjisz7ilSm2IsV5iiA6pf3/dNxa/IguTpotqiy9X3n9qDXPqxxxYS/vwGn3L/blsELPk+TnkcnPlJ9HE5oU+gO3qb1OtdrL/krc5DeZM3AVA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zUYza8g2PyCIiC2OrOmKbG3IQTXkQ4xS0l+bQ/UtoeM=; b=KpMPMDOZ9tHyaFfdBYeDIe6tyJnYr2ez2I5X8ZzUQmzCs0GJ30RAdaPPPZQr7kQnhvHC48GnVFlYtWZGGCXyNeA1u83HWFZgWGOjjn3E7svPHYeXKDvkET0/Ps9ZsRHNI4seeWkyFLnqf5tCUX3rHHtWW4pgDmkgba0gDXqOoLXdds8qWmtpeXAGM9cB1Njov7XRffcUoO73g1yGI1GWO4U7u3zEmWtyC7XntYr7w1c5VNWng2yljY35F5gsmqTnpMTkjkQqWM9eDHgkk2tQpRnVe8kD6z6uhKAkkNVIxktpR8xp8kbMBiv4iUvCnsJrn2BuOuNCXJJOlbDwzrABwQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB5275.apcprd06.prod.outlook.com (2603:1096:400:1f5::6) by SI2PR06MB5412.apcprd06.prod.outlook.com (2603:1096:4:1ef::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.18; Thu, 9 Mar 2023 09:43:31 +0000 Received: from TYZPR06MB5275.apcprd06.prod.outlook.com ([fe80::a2c6:4a08:7779:5190]) by TYZPR06MB5275.apcprd06.prod.outlook.com ([fe80::a2c6:4a08:7779:5190%2]) with mapi id 15.20.6156.028; Thu, 9 Mar 2023 09:43:31 +0000 From: Yangtao Li <frank.li@vivo.com> To: xiang@kernel.org, chao@kernel.org, huyue2@coolpad.com, jefflexu@linux.alibaba.com, tytso@mit.edu, adilger.kernel@dilger.ca, rpeterso@redhat.com, agruenba@redhat.com, viro@zeniv.linux.org.uk, brauner@kernel.org Cc: linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org, cluster-devel@redhat.com, linux-fsdevel@vger.kernel.org, Yangtao Li <frank.li@vivo.com> Subject: [PATCH 1/4] fs: add i_blocksize_mask() Date: Thu, 9 Mar 2023 17:43:14 +0800 Message-Id: <20230309094317.69773-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2P153CA0035.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::22) To TYZPR06MB5275.apcprd06.prod.outlook.com (2603:1096:400:1f5::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB5275:EE_|SI2PR06MB5412:EE_ X-MS-Office365-Filtering-Correlation-Id: ccdfc196-f1b2-4666-7081-08db2082bdd2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qae3vB1q5azCwwMFBxFyNfulkS2fKl26dHrPR5EE2x89+PmGv+wkF4/+4aKLws+K7tg8UH2kUAZO771w1fj59D5/YRnvOqbqaNGxw/L9+6R4e9MlwrJ89LG+aO7hP5uPVucjhn9HQVzG7Vd6h1sTMpvYGa7IKcA0GqEqL9yOinjY54lR3g1tQX69gg1Pi00ck9+rrauET6gapdYqqNfoz4PIOKsXCKnpga8DbQZxpv/GOpKGazvOlVAvT5b1YOn8CoWMOLLFS0Vs1alJOdhrJ2tA7KMQ+MQn83aOHkYTfiGl9sb4D1H9XmVZasohnH9srt/IW0HrF2npeyFvyzcLEgPYNUft/Sja1P96GOVSsYR71QkbFBtJZRIGVzwSW3hJO9ZkYN5pfkRcKCQng2voJNcQm2Ti5Qh7HpTwP75UmRR81QjoosxLTVIE1MdfG+LvZUzPAqrcTQEzrTUkTu59KALngE4jJeF0asBpip6l4zlLvWphQvjvLEEOLgdbZUvs5ZJ1H7knJrSAxkroXDaHLnISfO1IphYeyWe0mDtbKi94bL3lPhpMptOweVXd5g9ZwVUW9GVZ8nbsqgXn03rA1zc2RDtPcyAgXSnEwjx88rsperdZf3ZiJYccY5e/8F3wxEYywh4ThQbzpCtYkRFaXGTVRZOtfJOTQaa0wIKoxcPcQdDPHm8Th1a7AP4zywn447BAzuVTD4CXEJHXiUq0q9byEhNehwijGoPn2g76q+0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYZPR06MB5275.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(366004)(136003)(376002)(39860400002)(396003)(346002)(451199018)(107886003)(6666004)(83380400001)(36756003)(478600001)(921005)(38350700002)(316002)(38100700002)(6486002)(2616005)(6512007)(52116002)(6506007)(186003)(26005)(1076003)(5660300002)(4744005)(7416002)(66476007)(66556008)(2906002)(8936002)(41300700001)(8676002)(4326008)(86362001)(66946007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Jegshxbn02X1nQ9NnM0gp3J6Xyonqyz267OOMRqinh4BkSeL3sTf6HJBFoQRg28Nq5NlTjXow0dveGB5xSz9VCunB/WBFaN0pphNfUfW9+QOgNN4nldxdg7DQMREfd2XUCC3IFhFKaFrSiUOZbAb3i3rNDAchTCFwbV24SswW1UK5wE5nopnBNAiGz2hr9KwxThzquTdnrouRTl0TCfLgdkEFTZ0wBnnCoO8hlKhqK1rAOev7ltEAKcwC+TigMLZHJeXcvNlDQ1RpPPidCu4J5ELguM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m9eZwlfuQVDGkva875ouyireaBY9gj0KH3Ah3u+wcbVUeUxPuJwt0L3+e3dwfAfa0E9ixPRs0HL3gT3ghYBSrMzQAB5yWzUZI1dPOfa3oDN/PSFKfJNyREEHaq1JekyPDjfPuGXdZpJynIMF6/rkqLHLoj0A42LqL+5uzHoJU1uq13V/cLGA/EotBOlITFqskY8MdmMDWbiCAxhSRdoEr5ZKFV6ofdSTmnx3+7Tzol4eWcbM X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: ccdfc196-f1b2-4666-7081-08db2082bdd2 X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB5275.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 09:43:30.8079 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yFyq14KB3cuZWCF5cyf54mK1ICs+rCE80rakkE22SpYH+jFpm73e0dq8Ro89rResc+AGFx8Lcowq7SYuTmndCw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB5412 X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL,SPF_HELO_PASS,SPF_PASS autolearn=no 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759884129268194428?= X-GMAIL-MSGID: =?utf-8?q?1759884129268194428?= |
Series |
[1/4] fs: add i_blocksize_mask()
|
|
Commit Message
李扬韬
March 9, 2023, 9:43 a.m. UTC
Introduce i_blocksize_mask() to simplify code, which replace
(i_blocksize(node) - 1). Like done in commit
93407472a21b("fs: add i_blocksize()").
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
include/linux/fs.h | 5 +++++
1 file changed, 5 insertions(+)
Comments
On Thu, Mar 9, 2023 at 10:43 AM Yangtao Li <frank.li@vivo.com> wrote: > Introduce i_blocksize_mask() to simplify code, which replace > (i_blocksize(node) - 1). Like done in commit > 93407472a21b("fs: add i_blocksize()"). I would call this i_blockmask(). Note that it could be used in ocfs2_is_io_unaligned() as well. > > Signed-off-by: Yangtao Li <frank.li@vivo.com> > --- > include/linux/fs.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/include/linux/fs.h b/include/linux/fs.h > index c85916e9f7db..db335bd9c256 100644 > --- a/include/linux/fs.h > +++ b/include/linux/fs.h > @@ -711,6 +711,11 @@ static inline unsigned int i_blocksize(const struct inode *node) > return (1 << node->i_blkbits); > } > > +static inline unsigned int i_blocksize_mask(const struct inode *node) > +{ > + return i_blocksize(node) - 1; > +} > + > static inline int inode_unhashed(struct inode *inode) > { > return hlist_unhashed(&inode->i_hash); > -- > 2.25.1 > Thanks, Andreas
diff --git a/include/linux/fs.h b/include/linux/fs.h index c85916e9f7db..db335bd9c256 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -711,6 +711,11 @@ static inline unsigned int i_blocksize(const struct inode *node) return (1 << node->i_blkbits); } +static inline unsigned int i_blocksize_mask(const struct inode *node) +{ + return i_blocksize(node) - 1; +} + static inline int inode_unhashed(struct inode *inode) { return hlist_unhashed(&inode->i_hash);