From patchwork Mon Nov 21 02:44:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhen Lei X-Patchwork-Id: 23518 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1361274wrr; Sun, 20 Nov 2022 18:59:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf6Tr26TsuIdKDwSTbf/8PRjSBYznS8PrhIlsY2Es2o2nvalIGGWuTDZbOT3Fi9V5+V2ZUZ0 X-Received: by 2002:a17:903:3241:b0:186:dcc3:5d1d with SMTP id ji1-20020a170903324100b00186dcc35d1dmr10007787plb.20.1668999589874; Sun, 20 Nov 2022 18:59:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668999589; cv=none; d=google.com; s=arc-20160816; b=UNma94rFhxhko3df0YHy9MhDdNe8ayouDwLYwCxJ8qYjF+nFq9kZrZNU6PTR4Y0VKW NQ6O/oRMwtZsk4pE31gr7eHVLmLM1QxQBERmM4Wr5iXuL5s+YS3HwoWIgnJXdzI/a7W2 OfKEQyroAKj8M/Nf8ugIUQRouYrcf1OYSSICa84Klw8h1XmphxiWTiWOu+or/sKHISzc L0kpPDqMuSgN8oaon9bW1VDmCleF84YkaHy5E1gfxAUnEg3jEhjsQqmdJIlRdofHW/cU UxG75O28T98l35+cpEwTvY+zNk+++AsQmBrlRWFQ+E2Al6tH4ke1xR86WXUllQ9+1zZt orCg== 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=I6h0o4f9owFxkxlTdLLdEb7AR5odieZLmoYT9bRfn+M=; b=HPH+c/B7xT01lCZpqKPULTyWhjDrdcTw6VTw9sXHEK2ZIP9FAojexqddzvYfBl63Zm U/Xqq0kq1Wfa8bb4Q8KXCxK2xpuVm/2fo7/DtccFGyys/+g98dARW0d25oE6Uw4bFpOL Sjt5p9y5M8z54Vd+HYQgCA7niExfZ1hbY8WfrvgAacWBpzI/uW+vNZxBQ2qY8vYPOpQV 7b95xMHlo3qkWhvFTAhj10fV7x+UiShB/2v7b4gvKCmhz6YBCLlMe0K8R4P92Cfql+kv sFwRyHxA/3FCT5s9dC2MDoVh7eApqIB3FXOozGj+8K85i0NIRoRDM0lTppb2GBUfvpK3 Es3w== 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 h9-20020aa79f49000000b0057369d88b47si4431419pfr.219.2022.11.20.18.59.14; Sun, 20 Nov 2022 18:59:49 -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 S229886AbiKUCol (ORCPT + 99 others); Sun, 20 Nov 2022 21:44:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229645AbiKUCoj (ORCPT ); Sun, 20 Nov 2022 21:44:39 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D087420366; Sun, 20 Nov 2022 18:44:38 -0800 (PST) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NFsCt4tM0zRpNN; Mon, 21 Nov 2022 10:44:10 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 21 Nov 2022 10:44:37 +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; Mon, 21 Nov 2022 10:44:36 +0800 From: Zhen Lei To: Alexander Viro , Eric Biggers , , Chris Mason , Josef Bacik , David Sterba , , CC: Zhen Lei Subject: [PATCH v2 1/2] btrfs: replace INT_LIMIT(loff_t) with OFFSET_MAX Date: Mon, 21 Nov 2022 10:44:17 +0800 Message-ID: <20221121024418.1800-2-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.37.3.windows.1 In-Reply-To: <20221121024418.1800-1-thunder.leizhen@huawei.com> References: <20221121024418.1800-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.178.55] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) 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?1750072913720635873?= X-GMAIL-MSGID: =?utf-8?q?1750072913720635873?= 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