Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3149892rdh; Thu, 28 Sep 2023 04:21:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF+LopBd4w5/CQULSIPXrPJqbiAf4/FMlCAmGuUtY9PLh3UyG2akTrA5yTasiAGMQq5BmtL X-Received: by 2002:a17:90a:2a8e:b0:268:ef84:b0cd with SMTP id j14-20020a17090a2a8e00b00268ef84b0cdmr789283pjd.18.1695900113511; Thu, 28 Sep 2023 04:21:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900113; cv=none; d=google.com; s=arc-20160816; b=uDJl2GqAmDGfjYyX1TKgPorP3jgXbntG8u3aEoWAijgMd8wt6kX7HNE0+vM/Lpc/0N j7D2X8p2zKhwpBCMPESBUkRPRn9FFHQ73QwCERyp1X9MwrLfGtrgcHvgscFE/5EbbhMB llsqsqyiYGz9qKW4MT54Fyz3N2tBIsQ0FUvHTYyXkS+VyQ1xfSdasjzgG7I6HMyvSSzV S7m68vNkQLcsFQUUtnqyUIu/I9Y1SVdmvQr3nB12QVt68jv7N2FxwJ0PM1P1bvysOlGY hn7FgTuX9FSEg5zBS15HtFy7W6BuUhOD+956uOnk4jRVP8XFE/tlWYoNCwehoFbKffoQ jPsQ== 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=GKXANnYgStHpijT524HZ637Y170/CJsMU8YYLb5oiq8=; fh=xIe+y0AIA/13BB/Cht5aiJtIw4tu3ICDozyOO0XAK3c=; b=z9mqvEXHTb7rLDGER8DoE2cp8S9L3KZwFlKkI3DL6iGz7W+LstLgN5VtlT3cWcwiJl eWLxp+5MwuZOGb6aIrh7MrYITphnYZmt0W/KNyw9gCvIjGARPHW7aM2PUDInEo7QD0BK 5yX2zbk4yZV/r4ooS+lv06HmMxL5i3A9yzx7aDvL2gZolqnbUDb1K3N2iP/vJ1O5jNOd ck2w0d+mR9QoKbw/H0v82AsmEATfZQcBoeCtPtsonDtYXIlKb/zr2N9StkFh6aWKtZpV JdDnoiaV23hblQ3PyngA4pDJaaVcDoYgVz9+1CRibpDKK0tOW5Iv8weAZ4/ImortDTNR 349g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Hdz1GGMD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id hk18-20020a17090b225200b0027468369b4fsi22888068pjb.177.2023.09.28.04.21.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:21:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Hdz1GGMD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 3B27782F27D8; Thu, 28 Sep 2023 04:05:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232246AbjI1LFL (ORCPT + 99 others); Thu, 28 Sep 2023 07:05:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232045AbjI1LEb (ORCPT ); Thu, 28 Sep 2023 07:04:31 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F2C2CFC; Thu, 28 Sep 2023 04:04:25 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E37FC433C7; Thu, 28 Sep 2023 11:04:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899065; bh=cXvhQkkGpOgsc0ELKlchqmSPWWV4/XY2qNHuw52SmqU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hdz1GGMD7Vkz1trWmZe+MAIrycsD6w+ykdbjJl/6qtBpgAOWCWWYLP0E5KCgjLLyN 6F6GyR/ODAdFEaO5JLfy/5T2ugxoaQXBU8QZKMkrOnws+vYgO+mdSTvRW+1GweRS7G 4f6BG2PzRVr0NamMXpGuUQWR9mh0UkecaEZyb2NP8YGjopQGKnPba0T612ARuYvF5R quDWh15wjMATCYdswtWOt7ChygA1/6S30LJaY2MSAnZSshTisF/jvz9hTrwpH0gKiC +v6pB8bOuOEwDn73gQ1XFqCJYho2w4WD1hAQhjrIicBHXYuyjIEMoR+1zy85k1XYyt /IpwnIC7DQl5w== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org Subject: [PATCH 11/87] drivers/tty: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:20 -0400 Message-ID: <20230928110413.33032-10-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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 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 (snail.vger.email [0.0.0.0]); Thu, 28 Sep 2023 04:05:30 -0700 (PDT) Signed-off-by: Jeff Layton --- drivers/tty/tty_io.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 8a94e5a43c6d..d13d2f2e76c7 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -818,7 +818,7 @@ static void tty_update_time(struct tty_struct *tty, bool mtime) spin_lock(&tty->files_lock); list_for_each_entry(priv, &tty->tty_files, list) { struct inode *inode = file_inode(priv->file); - struct timespec64 *time = mtime ? &inode->i_mtime : &inode->i_atime; + struct timespec64 time = mtime ? inode_get_mtime(inode) : inode_get_atime(inode); /* * We only care if the two values differ in anything other than the @@ -826,8 +826,12 @@ static void tty_update_time(struct tty_struct *tty, bool mtime) * the time of the tty device, otherwise it could be construded as a * security leak to let userspace know the exact timing of the tty. */ - if ((sec ^ time->tv_sec) & ~7) - time->tv_sec = sec; + if ((sec ^ time.tv_sec) & ~7) { + if (mtime) + inode_set_mtime(inode, sec, 0); + else + inode_set_atime(inode, sec, 0); + } } spin_unlock(&tty->files_lock); } -- 2.41.0