From patchwork Fri Nov 25 09:13:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhen Lei X-Patchwork-Id: 25884 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3878727wrr; Fri, 25 Nov 2022 01:26:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf5rkDFccYdOX9qOdHUuuyn1x3h5exmVLwtq0fHKoo6snkG0zLeoy9wTI9SyxG+zKYfRFi/U X-Received: by 2002:a17:906:37da:b0:78d:8b89:caaa with SMTP id o26-20020a17090637da00b0078d8b89caaamr31071100ejc.431.1669368363173; Fri, 25 Nov 2022 01:26:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669368363; cv=none; d=google.com; s=arc-20160816; b=M4oFPwaYpC7hW5OoxBqSQNVUL6VNtoykJ9Expp9GwO53IXphVSwI3OvAIepMq7+2Ww pWAkZVBlB/YtKVAujZccfEHqgRN1PFHtF0JSGATxfJd5A+P3akTnLOMceJkqKFLJYT85 dqsURAWmcHdFmVb54hyQlUqksb0nlIOfBtsnuKI3XIiaSogUuwvpGPTSp/vz0+ZuzLid 1QMzhmgoIFSo6gLoTaxIgkhP6nDzLsvgrEavyjQGuVdpn5KeLMoCnhHsOL2LbREwU7Sp xpmFtDhB/A0x+LyZ8Bsh7QlU8Lx1HfL1yWdnf3SOI+J2JPAKLtQ/vMWYrVwa2xJ02zn3 c5Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=C0ydbe89Zq5rd6zKUyC0j7ZV/rK4jvQL9WJ16v18Bqg=; b=qifNf772mh48Hja+/E+WM7+UC9RS8hxJjhFD7evIG2N9XGxQtSLY4yaATQ0RSVuxTa teWtGvtV+Huk4ZPPGPiDwMarpvG+rOxGIPagteum4x9/xIrsJJTWuMtEZWrHd4KAICnQ 1lH4ezYtNODsPfcCGvQF5+74zo2hkEx13Gfg1X1YHbkvAXTMoK5DGrKmH05vJb/aJyeN gWIypdKcIRe5hGzovyaWEjcIEN5xV2SYWJsutpQUht8kUhudvsNAWyhuR8dIk4O46VUM a7jN/wZToO/Pe5eaXRgkc709uLeCN0oxPsf1mP5qTnDXJZyiXXKjq0xtKFQ+Gs4A2eMt aDng== ARC-Authentication-Results: i=1; mx.google.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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h2-20020a0564020e8200b0046277d2cb0csi3188630eda.470.2022.11.25.01.25.39; Fri, 25 Nov 2022 01:26:03 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229817AbiKYJPD (ORCPT + 99 others); Fri, 25 Nov 2022 04:15:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229515AbiKYJOv (ORCPT ); Fri, 25 Nov 2022 04:14:51 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFEB91BEB2; Fri, 25 Nov 2022 01:14:49 -0800 (PST) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4NJTh70JShz15Mtf; Fri, 25 Nov 2022 17:14:15 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 25 Nov 2022 17:14:48 +0800 Received: from thunder-town.china.huawei.com (10.174.178.55) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 25 Nov 2022 17:14:47 +0800 From: Zhen Lei To: Alexander Viro , Eric Biggers , , Chris Mason , Josef Bacik , David Sterba , , CC: Zhen Lei Subject: [PATCH v3 1/2] btrfs: replace INT_LIMIT(loff_t) with OFFSET_MAX Date: Fri, 25 Nov 2022 17:13:57 +0800 Message-ID: <20221125091358.1963-2-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.37.3.windows.1 In-Reply-To: <20221125091358.1963-1-thunder.leizhen@huawei.com> References: <20221125091358.1963-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.178.55] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750459601012461984?= X-GMAIL-MSGID: =?utf-8?q?1750459601012461984?= OFFSET_MAX is self-annotated and more readable. Signed-off-by: Zhen Lei Acked-by: David Sterba Reviewed-by: Eric Biggers --- fs/btrfs/ordered-data.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c index e54f8280031fa14..100d9f4836b177d 100644 --- a/fs/btrfs/ordered-data.c +++ b/fs/btrfs/ordered-data.c @@ -761,11 +761,11 @@ int btrfs_wait_ordered_range(struct inode *inode, u64 start, u64 len) struct btrfs_ordered_extent *ordered; if (start + len < start) { - orig_end = INT_LIMIT(loff_t); + orig_end = OFFSET_MAX; } else { orig_end = start + len - 1; - if (orig_end > INT_LIMIT(loff_t)) - orig_end = INT_LIMIT(loff_t); + if (orig_end > OFFSET_MAX) + orig_end = OFFSET_MAX; } /* start IO across the range first to instantiate any delalloc