Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp29497038rwd; Wed, 5 Jul 2023 12:45:25 -0700 (PDT) X-Google-Smtp-Source: APBJJlHU63xlE+i0OhlhQ//XTe8YNwcPIoHnAsbLGRBjJknHiJs8szBAJONmvPH+x9tQen942oVR X-Received: by 2002:a05:6a20:6729:b0:12f:dc60:4817 with SMTP id q41-20020a056a20672900b0012fdc604817mr1100669pzh.47.1688586324740; Wed, 05 Jul 2023 12:45:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586324; cv=none; d=google.com; s=arc-20160816; b=oiui6UocE0JD9Ht9JdLUs5cN6sGrtBGBhYBDX/qbQu1cZfz4EbSgpU4f6VLz5NkdLq AGPTTacUMM/7vdEjNMoCx71AIbUjJvSJqqlyIvbCSH2GL+ErlOSB9bX4zVi/sWY59kw9 80T0fh7koZZNz0jWlvXYC4xhyM8AihmaOiBPkmAYjnRvEY19P0f68t9OHOQnizf9iMiY F3e7H2wX7y0GUKAFRfVBKDEjeiwK50ehBFxvf5lm32mWQBrx9OrmnQQ2xHoa+T6xUjxO QBG5SwVM416MBZsnoXcMDbMdnsBxJkufqXeRMs3zp1Ub95ixw/ylccpY5x4qbm9GvAMH long== 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=MOsnav18iYqFZ1Yygak9tCaNPEpv67xnki5KwCjoYUg=; fh=Kc/Yi9ULky76Bvw8G88y52WdFbmBuUWyAHoq+9u/0QQ=; b=pYwbfnoyUj3UeSLa8xCm6corgzBFExfPRvXhAJAWbIRN+b9cXQWjy/X52Y5MlWR+QS PCa1UNeA6kFFZIS+T9UaA/NDogzjquWC13iqkWYwJrQ5Rd+pzsI5F5Z1R4k34dIxuBKv slpcDv7rMKQSiUDfDdyHbw0JX35Ph3/WLmeynuWIh4sdlfWFD4/+LIpHPATc1Zo0bZL3 MANVt/fjz83JO8FvMbWxFZnGTw2rqKYgyfvnEYJK1hmLuNjmK/6EElfruDPuShdb17Bo v5NXsFcD6KYJHCFtNLA3sSZ0ZUuOp451WzPEJX7S54Jtpj+HqwUT0haddMP0gP5fwq1v kAOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=n1SGksIN; 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 w29-20020a63161d000000b0055bc3404854si4413538pgl.757.2023.07.05.12.45.10; Wed, 05 Jul 2023 12:45:24 -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=n1SGksIN; 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 S233553AbjGETLP (ORCPT + 99 others); Wed, 5 Jul 2023 15:11:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234104AbjGETKa (ORCPT ); Wed, 5 Jul 2023 15:10:30 -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 EA1FC3C3F; Wed, 5 Jul 2023 12:05:56 -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 0CD87616FC; Wed, 5 Jul 2023 19:05:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6872EC433C8; Wed, 5 Jul 2023 19:05:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583945; bh=TXSxRuiJHKwV/2Aw+LtmUoK8B39D2LWcTb8UoUWUREI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n1SGksING+sQkSnN9pPB8r2jPmytKLeyeNQ0IzlMjkQkcicrH6T9e8aGRlLggrjhe J6B4enXwNi16W4Ah8QPypWlzkFqH/iXM7cWqjd/cNYkaPrP0KaV6hjZrjRKHjCyFZa g2DUNicQOhlYpSZciRlbC9RcyVoh9r5mjlOaTey4Yv0cMYJdPGvUaZopG8lTw1zb9a EhEBFvnzo8gpXeJGfjhh1EeFc2c3kqZzKxVnRrMxUib82DKwTaZtyo9dmJNp/zS653 XUtANaW6EQC42ddwpG8D/c+sBtdhPJtoTwMnW/QAxTRUrYUfuFm49RseWr/a2IpHJY f5QKpWIh9oHFA== From: Jeff Layton To: Christian Brauner , John Johansen , Paul Moore , James Morris , "Serge E. Hallyn" Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org Subject: [PATCH v2 89/92] apparmor: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:54 -0400 Message-ID: <20230705190309.579783-87-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. Signed-off-by: Jeff Layton --- security/apparmor/apparmorfs.c | 6 +++--- security/apparmor/policy_unpack.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index 3d0d370d6ffd..7dbd0a5aaeeb 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -226,7 +226,7 @@ static int __aafs_setup_d_inode(struct inode *dir, struct dentry *dentry, 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); inode->i_private = data; if (S_ISDIR(mode)) { inode->i_op = iops ? iops : &simple_dir_inode_operations; @@ -1557,7 +1557,7 @@ void __aafs_profile_migrate_dents(struct aa_profile *old, if (new->dents[i]) { struct inode *inode = d_inode(new->dents[i]); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); } old->dents[i] = NULL; } @@ -2546,7 +2546,7 @@ static int aa_mk_null_file(struct dentry *parent) inode->i_ino = get_next_ino(); inode->i_mode = S_IFCHR | S_IRUGO | S_IWUGO; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); init_special_inode(inode, S_IFCHR | S_IRUGO | S_IWUGO, MKDEV(MEM_MAJOR, 3)); d_instantiate(dentry, inode); diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c index ed180722a833..8b8846073e14 100644 --- a/security/apparmor/policy_unpack.c +++ b/security/apparmor/policy_unpack.c @@ -89,10 +89,10 @@ void __aa_loaddata_update(struct aa_loaddata *data, long revision) struct inode *inode; inode = d_inode(data->dents[AAFS_LOADDATA_DIR]); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); inode = d_inode(data->dents[AAFS_LOADDATA_REVISION]); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_set_ctime_current(inode); } } -- 2.41.0