Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp29496206rwd; Wed, 5 Jul 2023 12:44:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlGJVy2j6VngV1o1os98EPM68q95NZgKCV5NuZnPRrg1jqZUsQXnAg135gO1KR6ztGDn+4aq X-Received: by 2002:a05:6a00:1a0b:b0:67e:4313:811e with SMTP id g11-20020a056a001a0b00b0067e4313811emr16775950pfv.0.1688586269509; Wed, 05 Jul 2023 12:44:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586269; cv=none; d=google.com; s=arc-20160816; b=dJIZH9Kbm/Gxav3aYXNXmclVtssum9dj+wkRJwStSTfHRyK2uajvsyEqoSV2UMuVUv t79xc2s1QAgCklybS4af3np9hZ9KyBa+e9uFIUUIxsxwzJRsluYr1UqeC/CXAATVh4cV 43UCyr5igOeulH38+CEy+qkFcxdSFNAlss5CDAgw53IkVVTJITRw0g6E4S7phhHcTEPT AyWG/SDGsdevBsSTm4pOt/rQxhqdrVF7oa+scIYs/4uVmp1cdAnrTd3Kc405yohZhyks EH67TLjvsv6rPI+gESjQ5RrMZKdP70UqKl/bsxrW9Mk43YgSmYow4RDIEiEyH8/R8ayv uugw== 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 :dkim-signature; bh=3XB6yX6vqQZ+nFwZsNKdva94nwaaeSK969Wy3lnhZWI=; fh=2Cm7PmyORhSdb4ojVPN+M1G6zRlXP8f6OCOck5tStqM=; b=F90a6DA7O1exXd2JlhUAyH/gnyav3P5S+uTRkdmznTRnEGm+e1jlfXVzSvm+KrMfFy v2V2mWEmGLUIK6GHnWbfbxq12MaP66rytsxK4Na4QKMzKhH3YQwpdCQSTge1nXV75edP cfFwXtWb8F/I657hx8i3SvvmnOLIaP6X3nfzFy4nZbBn8xXvgGOg9HIuJhUiZPEki+BB 7ZX00EmPPnr0EIhLGz/gRxLZIR4drF6ciZj5N6zUYk9RCJpWjE7/GkWgA5oKkeVoZIRt LtXA291o23SUV7H+1iQv+4Uzf0d5A+y53KgY0+t8I372rX9E14IgakFx6DbXZtBurxBd loag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iGyVesnY; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 193-20020a6300ca000000b0051b48085aaasi24427721pga.858.2023.07.05.12.44.15; Wed, 05 Jul 2023 12:44:29 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iGyVesnY; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234056AbjGETJ4 (ORCPT + 99 others); Wed, 5 Jul 2023 15:09:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234238AbjGETIj (ORCPT ); Wed, 5 Jul 2023 15:08:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A28E3A9A; Wed, 5 Jul 2023 12:05:35 -0700 (PDT) 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 328E1616E4; Wed, 5 Jul 2023 19:05:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4BEFC433C9; Wed, 5 Jul 2023 19:04:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583899; bh=JAvhSQ39mq266aIrwqMbso8j9j8kS0A2nuJOE+YNoPw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iGyVesnYPolO+I26oFXGQS0HFfyLSnyKHr0IztOkcR37+k04gEYGhfLV5iXWbRzUb EObq2VlxILLQJwNu6v40Vw44mKIR/hEv7r12FxATyp+fCsjMdDpE0sJFCVA4/Uc8jR pN57YUcYfoRHHDZhRKvJLBjhf0JfE3TzTVXVb4mkufQmeoj4i9Oc3f7BwJrVnxwcbY PK6IV5XHVTCd/DXK6HdeyC4G7JL6Q7TCWgCtpA3Snu0BM4ejCHtnfKglypX1Fq6CNy 54j3+ODltMqFWVJ/dby/A8lzOQWxNhnRprW4AI4HYD/2TaeQq3/oK5h+aXHpt0gCmT 3N3286UmPeCAg== From: Jeff Layton To: Christian Brauner , Bob Copeland Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-karma-devel@lists.sourceforge.net Subject: [PATCH v2 63/92] omfs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:28 -0400 Message-ID: <20230705190309.579783-61-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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 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. Acked-by: Bob Copeland Signed-off-by: Jeff Layton --- fs/omfs/dir.c | 4 ++-- fs/omfs/inode.c | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/omfs/dir.c b/fs/omfs/dir.c index 82cf7e9a665f..6bda275826d6 100644 --- a/fs/omfs/dir.c +++ b/fs/omfs/dir.c @@ -143,7 +143,7 @@ static int omfs_add_link(struct dentry *dentry, struct inode *inode) mark_buffer_dirty(bh); brelse(bh); - dir->i_ctime = current_time(dir); + inode_set_ctime_current(dir); /* mark affected inodes dirty to rebuild checksums */ mark_inode_dirty(dir); @@ -399,7 +399,7 @@ static int omfs_rename(struct mnt_idmap *idmap, struct inode *old_dir, if (err) goto out; - old_inode->i_ctime = current_time(old_inode); + inode_set_ctime_current(old_inode); mark_inode_dirty(old_inode); out: return err; diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c index c4c79e07efc7..2f8c1882f45c 100644 --- a/fs/omfs/inode.c +++ b/fs/omfs/inode.c @@ -51,7 +51,7 @@ struct inode *omfs_new_inode(struct inode *dir, umode_t mode) inode_init_owner(&nop_mnt_idmap, inode, NULL, mode); inode->i_mapping->a_ops = &omfs_aops; - 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_op = &omfs_dir_inops; @@ -134,8 +134,8 @@ static int __omfs_write_inode(struct inode *inode, int wait) oi->i_head.h_magic = OMFS_IMAGIC; oi->i_size = cpu_to_be64(inode->i_size); - ctime = inode->i_ctime.tv_sec * 1000LL + - ((inode->i_ctime.tv_nsec + 999)/1000); + ctime = inode_get_ctime(inode).tv_sec * 1000LL + + ((inode_get_ctime(inode).tv_nsec + 999)/1000); oi->i_ctime = cpu_to_be64(ctime); omfs_update_checksums(oi); @@ -232,10 +232,9 @@ struct inode *omfs_iget(struct super_block *sb, ino_t ino) inode->i_atime.tv_sec = ctime; inode->i_mtime.tv_sec = ctime; - inode->i_ctime.tv_sec = ctime; + inode_set_ctime(inode, ctime, nsecs); inode->i_atime.tv_nsec = nsecs; inode->i_mtime.tv_nsec = nsecs; - inode->i_ctime.tv_nsec = nsecs; inode->i_mapping->a_ops = &omfs_aops; -- 2.41.0