Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp99463rdb; Mon, 4 Dec 2023 22:47:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IGiZxobDlXNLgu6EFnZ0UOpf2O63h2pkPJoA5pk1j5DPvO5Yn6RT9uoSBQTlVf8PNgljBhr X-Received: by 2002:a17:903:4295:b0:1d0:6ffd:9e32 with SMTP id ju21-20020a170903429500b001d06ffd9e32mr4671192plb.132.1701758832125; Mon, 04 Dec 2023 22:47:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701758832; cv=none; d=google.com; s=arc-20160816; b=MduGNctDMKz9I8XeZglzUkP4QirZmg+qNokCXJD3l3v4cGRxpWnrB5kQBqJWREFumT 0TS0cmwFspLQbdxUjp8KgPkyVXK1ccmC8S2IX+EiXCmSD9fik5d7cRU8mL5JamzaHk/O 8liUpJPb8OUFgqPPwG4CMNt5d7fKfC6jluMoYGOVaVXtD9MPCHOvlhmi/qvSs7M16r9w 5n9kvlE1ogwZjXWdcxQJb2q8+UUQUdOrG1Azr7tstk0dMEKgSjnZqt/7jxodZ3rro5Nk oOYz4tPsXRzTJV1Aj1kXSr1YqJQAx8gQexRvn3Ae9ohyxsCsSw2YD4GJ+TXnUQtLCtTp obGA== 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 :message-id:date:subject:cc:to:from; bh=zEmYOnn8yBqfveA3k1jxTeZCbhUjjh0wxVe775xRyJI=; fh=VSUMJQsCNay8jimRTr0Lw5WsiXNxkITOCloOFkOAhGg=; b=MWCLFvF1O+LCqBD/Ypjzgvx8MReWMqQtEBa1/ndDWkeHtN0Xojo8qpUq9R0LFoDLYS U9Mfrug/WEEhT742r8nGPrExHIvaxd65T2Dnxi8IYnuGhj+rh6rRxDhmulATc2WGpQyW WDALL72ZY6wAYJCEekmaf5A7l1J1thn01rl/4fBYNl57/7rIK5RNy3oBzHxzqr73Rd/D 92hl7YcqNwWXw+esJVfoarlm5xr4vfIglQyRrRIiaf+Qc71CKLDHs1rXnIg8kLHEAZuj vouhq7YvHCZ1piL3Seq8f9uOvj6+LexZiFg4RpaCtqsu3HXfL4ThIcG1jQXzq71medHa TwPg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id v8-20020a1709029a0800b001d0050e246csi8987223plp.3.2023.12.04.22.47.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 22:47:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 2478580873E7; Mon, 4 Dec 2023 22:46:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344312AbjLEGqC (ORCPT + 99 others); Tue, 5 Dec 2023 01:46:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344314AbjLEGp7 (ORCPT ); Tue, 5 Dec 2023 01:45:59 -0500 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 841D4FA; Mon, 4 Dec 2023 22:46:02 -0800 (PST) X-UUID: 4c47d4fd5f5041c8903432bd1658bbbf-20231205 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.33,REQID:00b6a15c-1b73-4337-85fa-11824a6e7ffd,IP:10, URL:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:-5 X-CID-INFO: VERSION:1.1.33,REQID:00b6a15c-1b73-4337-85fa-11824a6e7ffd,IP:10,UR L:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:364b77b,CLOUDID:94142996-10ce-4e4b-85c2-c9b5229ff92b,B ulkID:231205144549Q1BJF2JL,BulkQuantity:0,Recheck:0,SF:17|19|44|66|38|24|1 02,TC:nil,Content:0,EDM:-3,IP:-2,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,CO L:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_FSI X-UUID: 4c47d4fd5f5041c8903432bd1658bbbf-20231205 X-User: gehao@kylinos.cn Received: from localhost.localdomain [(116.128.244.171)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 82101613; Tue, 05 Dec 2023 14:45:47 +0800 From: Hao Ge To: viro@zeniv.linux.org.uk, brauner@kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, gehao618@163.com, Hao Ge Subject: [PATCH] fs/inode: Make relatime_need_update return bool Date: Tue, 5 Dec 2023 14:45:45 +0800 Message-Id: <20231205064545.332322-1-gehao@kylinos.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 04 Dec 2023 22:46:26 -0800 (PST) relatime_need_update should return bool to consistent with the function __atime_needs_update that is caller Signed-off-by: Hao Ge --- fs/inode.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index f238d987dec9..c0b50cdf7154 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -1836,37 +1836,37 @@ EXPORT_SYMBOL(bmap); * earlier than or equal to either the ctime or mtime, * or if at least a day has passed since the last atime update. */ -static int relatime_need_update(struct vfsmount *mnt, struct inode *inode, +static bool relatime_need_update(struct vfsmount *mnt, struct inode *inode, struct timespec64 now) { struct timespec64 atime, mtime, ctime; if (!(mnt->mnt_flags & MNT_RELATIME)) - return 1; + return true; /* * Is mtime younger than or equal to atime? If yes, update atime: */ atime = inode_get_atime(inode); mtime = inode_get_mtime(inode); if (timespec64_compare(&mtime, &atime) >= 0) - return 1; + return true; /* * Is ctime younger than or equal to atime? If yes, update atime: */ ctime = inode_get_ctime(inode); if (timespec64_compare(&ctime, &atime) >= 0) - return 1; + return true; /* * Is the previous atime value older than a day? If yes, * update atime: */ if ((long)(now.tv_sec - atime.tv_sec) >= 24*60*60) - return 1; + return true; /* * Good, we can skip the atime update: */ - return 0; + return false; } /** -- 2.25.1