From patchwork Wed Jul 5 19:01:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13302772 X-Patchwork-Delegate: bpf@iogearbox.net Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7F28620 for ; Wed, 5 Jul 2023 19:05:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 132EAC433C7; Wed, 5 Jul 2023 19:05:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583939; bh=fuAcROkTvzWt2oLhwWrBRUVTBdgYfzuMksRnIzfqmIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C6fBOQcWDc/pi/H95I+kf1JujNXMjelHZVfb8qt4mTiNkNM6c6jDvFKaihRMDr5AG ZbTxTPNng7DHr+2qgsCcMoh1vXTuuBrUh60Kz20uVdmvRFACmim8lw7S/nX74+8Phi JVojm6xelMYsFECol+OmTAfJiVC6IOtTOqRg8StKBa2mUapqgcgeyk0OsG0DiJHMxq F5iUXroxJyxAh6dglCanl133Fy67F9KKjMrbY9vxv4eHozCZojPMr5mF8u78WGKdru zc/SidxREFDoR8sGbx2kwknTcaksqY+qzmc7U7+0UXqNqwFI21TmSKnMuG75Iw5F0i uiuomrNVRF2Hw== From: Jeff Layton To: Christian Brauner , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH v2 86/92] bpf: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:51 -0400 Message-ID: <20230705190309.579783-84-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> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: bpf@iogearbox.net 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 Reviewed-by: Jan Kara --- kernel/bpf/inode.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/bpf/inode.c b/kernel/bpf/inode.c index 4174f76133df..99d0625b6c82 100644 --- a/kernel/bpf/inode.c +++ b/kernel/bpf/inode.c @@ -118,9 +118,8 @@ static struct inode *bpf_get_inode(struct super_block *sb, return ERR_PTR(-ENOSPC); inode->i_ino = get_next_ino(); - inode->i_atime = current_time(inode); + inode->i_atime = inode_set_ctime_current(inode); inode->i_mtime = inode->i_atime; - inode->i_ctime = inode->i_atime; inode_init_owner(&nop_mnt_idmap, inode, dir, mode); @@ -148,8 +147,7 @@ static void bpf_dentry_finalize(struct dentry *dentry, struct inode *inode, d_instantiate(dentry, inode); dget(dentry); - dir->i_mtime = current_time(dir); - dir->i_ctime = dir->i_mtime; + dir->i_mtime = inode_set_ctime_current(dir); } static int bpf_mkdir(struct mnt_idmap *idmap, struct inode *dir, From patchwork Wed Jul 5 19:01:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13302827 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A95C3620 for ; Wed, 5 Jul 2023 19:05:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D925CC433CA; Wed, 5 Jul 2023 19:05:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583943; bh=PupGEBmpc4BS3GR/o7WIzvxzbsSfu55Z8rACvDIEA1c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UeAwqR8Xl0h07N6K15EXbDERNSWmUYaYGEVGFgjnZMtepCmt1llB/o23xcjhlwLas 6CiwqQJJtoCwixWGV/lVcUuZZKO6JsD8SiSt3FCk1RDYxFjY1KFUCBzxplJ4PXtI+x 4/ADpSVzofY0F4F1Q2YdzkkG+4AFvl6W/8UJtqbe9omwrrQ1fV58teVyo6S+1Ndtta cpR+KOH3XFCEY6W2LvMIs1W3/oR8PY2YrCXkn6ZQIysVDp8v74+o5QHGoKYUw9IojB VwDQslscQGW9cYBZbGedv9tH1cMnorngGns+cDo2tXLg4WKBJ1PK3U4rc1mtPRAKWQ aUfgQraSQYuZg== From: Jeff Layton To: Christian Brauner , Trond Myklebust , Anna Schumaker , Chuck Lever , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v2 88/92] sunrpc: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:53 -0400 Message-ID: <20230705190309.579783-86-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> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org 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 Reviewed-by: Jan Kara --- net/sunrpc/rpc_pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index 0b6034fab9ab..f420d8457345 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c @@ -472,7 +472,7 @@ rpc_get_inode(struct super_block *sb, umode_t mode) return NULL; inode->i_ino = get_next_ino(); inode->i_mode = mode; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); switch (mode & S_IFMT) { case S_IFDIR: inode->i_fop = &simple_dir_operations;