From patchwork Wed Jul 5 19:01:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13302759 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF890EB64DD for ; Wed, 5 Jul 2023 19:04:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5835C8D0005; Wed, 5 Jul 2023 15:04:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 534458D0001; Wed, 5 Jul 2023 15:04:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3FBC48D0005; Wed, 5 Jul 2023 15:04:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 2E7408D0001 for ; Wed, 5 Jul 2023 15:04:40 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 04768120C1C for ; Wed, 5 Jul 2023 19:04:39 +0000 (UTC) X-FDA: 80978484720.22.CFDAF84 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf09.hostedemail.com (Postfix) with ESMTP id B05BB140028 for ; Wed, 5 Jul 2023 19:04:37 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=cT6gBYHC; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf09.hostedemail.com: domain of jlayton@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jlayton@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688583877; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Q0hjCfQouy2HldOFx4lZvIHbaxQxrlWvTefb6aOXcbs=; b=nVPCfPNBRPIp4S0SXR49o3ylfha6fRAsx1wvu+sI6jg8Q/rhFU7OP+s0tRsdRtxv7nrdkd 0FFaZdtoCZH+fstJVCi7eqflE51T+hMjeVdvO+xuhWVGzvkrUiB4jnl3v7bJeGuWfOx5xt W0kYn/DUFEVPBj29Zbfw2L5j/c8nywU= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=cT6gBYHC; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf09.hostedemail.com: domain of jlayton@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jlayton@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688583877; a=rsa-sha256; cv=none; b=Yub+q2LgsxDrfDJjMLu8PF2p8YdfUQrJFpsA3czVvtue23t6P+GiXnMKXkPOdR4eGRTF2W Z5mqZh4yfbuk/J5xjpPd0ZkukDiCh99WEoT9Ml2s/Y4vximezMTUZkO8smExEYbKQFvebW Vtpo92/arH0le3TTEnnBFVHdbgUhJVU= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 88458616E4; Wed, 5 Jul 2023 19:04:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93859C433C8; Wed, 5 Jul 2023 19:04:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583876; bh=VTN22iDlc64pJ0V7tpQfQ3Y7pWhLYJcjLyC9KHu7DZ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cT6gBYHCRs/6tnJ8EKp/GPZRquTdOojJPymszidSu2ZcARD5LhhDsRCtQ6+No8KUO rWhc+OTLxB7j9N3UYTZJn0n6tMjSqrC4/u/HuImKHsYD0G1SJxZvMx5NI2xIzOOwic rErhRbOUiS0DqVGDECpI1QGtTByyDJE6Mwf/oKnBXAozpV1CEFcb5FMAKc11ogfUFx /b/Cc3Xz+DkxbPOaudF4TIdmqE/pndqJs6e6BnoK9UDx/gEO0k1ygvDuk5VBLAY68d Blo/yJZIJajDp0TtVHTaS1MCU5xXSTP+iO8MID38E8as5ZqTXr5/Jti4q6QUzNNl6E i4xIcbxGtrIVw== From: Jeff Layton To: Christian Brauner , Mike Kravetz , Muchun Song Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v2 52/92] hugetlbfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:17 -0400 Message-ID: <20230705190309.579783-50-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: B05BB140028 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: e3e5gifeiq3ori69b8djefot5fzdqxa5 X-HE-Tag: 1688583877-578468 X-HE-Meta: U2FsdGVkX19eZ0Qz71tl3WTIsRQAmPF34BHtB2u5WFjUx3CpPRjPVx40toyR58aYmjDj59u+rVqfHvq5oX+ereS7tgToyr/xTKWRo6jcLz0etR4JnQRprrGKi5Iu2LCGlmrhGicV2pF6pDOAdCjOmSadS7+zOl2UI7V0lYI7WeC4Me0X4fNq+F6iLMosW/7aB1DUtA3agET/BHwTJndbz3rh6IuWhVy+/icYqtB6UPIM6zBg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unhf339BHFLV7yCAYw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Acked-by: Mike Kravetz Reviewed-by: Jan Kara --- fs/hugetlbfs/inode.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 7b17ccfa039d..93d3bcfd4fc8 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -887,7 +887,7 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset, if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + len > inode->i_size) i_size_write(inode, offset + len); - inode->i_ctime = current_time(inode); + inode_set_ctime_current(inode); out: inode_unlock(inode); return error; @@ -935,7 +935,7 @@ static struct inode *hugetlbfs_get_root(struct super_block *sb, inode->i_mode = S_IFDIR | ctx->mode; inode->i_uid = ctx->uid; inode->i_gid = ctx->gid; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); inode->i_op = &hugetlbfs_dir_inode_operations; inode->i_fop = &simple_dir_operations; /* directory inodes start off with i_nlink == 2 (for "." entry) */ @@ -979,7 +979,7 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb, lockdep_set_class(&inode->i_mapping->i_mmap_rwsem, &hugetlbfs_i_mmap_rwsem_key); inode->i_mapping->a_ops = &hugetlbfs_aops; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); inode->i_mapping->private_data = resv_map; info->seals = F_SEAL_SEAL; switch (mode & S_IFMT) { @@ -1022,7 +1022,7 @@ static int hugetlbfs_mknod(struct mnt_idmap *idmap, struct inode *dir, inode = hugetlbfs_get_inode(dir->i_sb, dir, mode, dev); if (!inode) return -ENOSPC; - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); d_instantiate(dentry, inode); dget(dentry);/* Extra count - pin the dentry in core */ return 0; @@ -1054,7 +1054,7 @@ static int hugetlbfs_tmpfile(struct mnt_idmap *idmap, inode = hugetlbfs_get_inode(dir->i_sb, dir, mode | S_IFREG, 0); if (!inode) return -ENOSPC; - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); d_tmpfile(file, inode); return finish_open_simple(file, 0); } @@ -1076,7 +1076,7 @@ static int hugetlbfs_symlink(struct mnt_idmap *idmap, } else iput(inode); } - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_set_ctime_current(dir); return error; }