From patchwork Wed Oct 4 18:53:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 148538 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp344915vqb; Wed, 4 Oct 2023 12:04:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEzvhAc+3KQYb0W/nufrqtzTOTSMah1omkX6B8wZBc7/6OhMRK6UUl8CcGyrZUcORYlNyXY X-Received: by 2002:a05:6e02:1a45:b0:34b:aa34:a5c4 with SMTP id u5-20020a056e021a4500b0034baa34a5c4mr3509297ilv.30.1696446261984; Wed, 04 Oct 2023 12:04:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446261; cv=none; d=google.com; s=arc-20160816; b=eR9diTfoiiNikPnIti55JBgi1IVkp5Ncsgf5Z4/Hf71spNd1x3aYLlDHoQ2rpQJyKj dpyEDH0jXPpnkW7UGs8vdrgT0pdpNA60AYE15vQ/t/QLFhGoRG9kVCPtAw21w1Idi5Xm hvlyYmBefeQdSTdI1c6LIf3PLA6lpj3btnx1jcmx9Crc3OlIE5YxsowPj+OpY5NcVP1g SSEOLqHsMTbIgOj5X+UQqD/41CJZTMecSu1+dRIZXfuFG7VcxOQjKSrALDODD/5AWMr3 k7KK2+d7p1zSpJtgS4VMFMsDx9WLT/z+p2h3/G3oHMR/Axh5sufu9q+ESC3h1/RlNSsp PxHA== 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=qR2hBddCj8Yqx5h6MrxdR575gIAbWo6jOiEhh8FLQ1o=; fh=oiowXySz2F+J4jdl2t70kJesSvr0fL+txr5uWibwDGw=; b=u8OkcIC6621AsTviHt0UdOBrK8D3Dn8VVF51FgrgxbtxQzqQWWEPZRHqHD72CIcaNy fQ9jJ7POWczXABH4Ci5Sv2/R9Fy8uH72tP5ZRLnfFqL777okA19PRCoyhiWNEnxoV5lN VIVAxyECQicosp6K/0vSHXz9nXjXN0ZuF/nuM9Yxe3vE55W3FCOy0u8zQ4Nt+VCOiwXW 5QtDx/q3F8oiW0QT+m7v/TdDHAYccz47KFoUlLBkLBTI9RiV9zZzlE3xlP90s1KFMCib Y1jM3YZWnMdwlOUn0s9WlLXxrKyB9iK8ZOq5Oc234zeUghCaZ9HXRbNFyAsUDJ5LQb+0 zX5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JPqhVdWs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id x28-20020a63b21c000000b0057ab7f46d3dsi4225252pge.108.2023.10.04.12.04.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:04:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JPqhVdWs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 2D44883EB326; Wed, 4 Oct 2023 12:04:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245365AbjJDTBR (ORCPT + 19 others); Wed, 4 Oct 2023 15:01:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245229AbjJDS7S (ORCPT ); Wed, 4 Oct 2023 14:59:18 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C0281FFD; Wed, 4 Oct 2023 11:55:28 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3EFB6C433CD; Wed, 4 Oct 2023 18:55:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445727; bh=MoIiW0tMHURG7cJf6w6ln0tYlsyoiEpsfqWIhLoofRM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JPqhVdWskSIIpfDDjPHzSCqQNZIl417YlCoBc9LPz5sjsfGqE07PJZOhE6sbqYP2X 0U1dSNp6FcjR7IOU1yow1ION3UjDnESIbSQDkdDpWksH/8zYMZcB3idwbfTAzC0HXB /qVg/1XnBw320D6Hhx0qh2KItlWeJkAItTSMRcgeDL9uG/CHgx4Ckr4D4rAbL+jDlv QwK/9vxexr4tqB/vjwaQtmI63IBMlRihiEOuGgDK0Y/BnD4ubIzD95kSWb57EJGSzJ nPT6UIVKEBcI2UHtAFu84iqq2l6M7LkuDXctHZOMs99yMKIepLnPV/675uCcQfewxu QIoYrlMYYkRpQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org Subject: [PATCH v2 84/89] apparmor: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:53:09 -0400 Message-ID: <20231004185347.80880-82-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004185347.80880-1-jlayton@kernel.org> References: <20231004185221.80802-1-jlayton@kernel.org> <20231004185347.80880-1-jlayton@kernel.org> MIME-Version: 1.0 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 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:04:21 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852835755016114 X-GMAIL-MSGID: 1778852835755016114 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- security/apparmor/apparmorfs.c | 7 ++++--- security/apparmor/policy_unpack.c | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index c198a8a2047b..27b0540a761c 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_set_ctime_current(inode); + simple_inode_init_ts(inode); inode->i_private = data; if (S_ISDIR(mode)) { inode->i_op = iops ? iops : &simple_dir_inode_operations; @@ -1557,7 +1557,8 @@ 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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, + inode_set_ctime_current(inode)); } old->dents[i] = NULL; } @@ -2546,7 +2547,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_set_ctime_current(inode); + simple_inode_init_ts(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 94d0f801eb49..7f0e58f3e1fc 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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); inode = d_inode(data->dents[AAFS_LOADDATA_REVISION]); - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); } }