Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3153075rdh; Thu, 28 Sep 2023 04:28:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFnCEIZAZ/mRYYiWhl4TAIy5wFzHOXEtNZi3iLSiu2Ez1QCINQXKGqNzjCKuL/c29u6XbTw X-Received: by 2002:aca:d03:0:b0:3ab:8b80:9c63 with SMTP id 3-20020aca0d03000000b003ab8b809c63mr794350oin.10.1695900523014; Thu, 28 Sep 2023 04:28:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900522; cv=none; d=google.com; s=arc-20160816; b=K74f+3e44sYt6wnX77sGjT+ubZ38CBuw7ZjNESefV48UoJzmc6RPC2rEA9Yt89R+mW aZY/WVvkrL3ebspJhYq5r2cznFLQYClpconvLeNqRigMNMwjBADyt66rN+OAT9zGRYVx U/Pk0FCT0URAw/EPaVaZwwF58VC54mYFQkDDEN4RGCA5cNi9iCMwkK38HE32xLK7Ic8u 9qW3gS7eCuab2S1/KGFB4TbzYn9mD2TsjnVhT3p5DEwNv5y7lQxpzxXDmcAVkvTTL5Wp uOY4Gun5+0RVh7DqkSaIS1gHQoSrQQQHImjMIvD/HWkn6kFysZ+tyDdhPpuerWR0MaYV aFzA== 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:to:from :dkim-signature; bh=CSd5S1quFMmFUvfKmMNcxFM6gPStlOBJu1o7Hwpqmqg=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=Jc9848b2IMPXNsLgupqjo7n3c0nijMqlNN8of4XwVrD5k9WB0eiG4Wm5wn3W0M9CPS w2ggjwpxQOdXkKk6KHfjCHLJmPTsJukSK74fVSz1eIXwnpNSReoffTWBZBBy/7F4f/r3 tIzDVLd8+dEzKHFDBv4MZ6YGjHJ880NaPCHVcBrTBa3YzBTSDpcAr/pdXl/0cPrpg3WL WWacr+0Wnwv3VRzGS6HCb8xuz1jlQoiCoECKb1mv2ZKrPEfW3juVf7eZipo7sEpmS969 QToYg0FWCgu1R6lHlpIwRKt8P9C4Q8HYPZwB42kiYQHLBDNkBXp5D4obPd+pWI4yM+7U yvIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dd3KOfUe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id l10-20020a65560a000000b00565ecd01399si18546945pgs.783.2023.09.28.04.28.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:28:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dd3KOfUe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 02859825154D; Thu, 28 Sep 2023 04:24:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232141AbjI1LX1 (ORCPT + 99 others); Thu, 28 Sep 2023 07:23:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231922AbjI1LWz (ORCPT ); Thu, 28 Sep 2023 07:22:55 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED2B62D50; Thu, 28 Sep 2023 04:05:46 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21B8CC433B7; Thu, 28 Sep 2023 11:05:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899146; bh=psv5N50RQ81+83BESGrHOV5WciE2V0x7f5SjV0CmxeE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dd3KOfUe0Jj8fLdYUZ8E8NR67Sz2x5IzNfsgDtB65V7PII0B3WxUr3CJ1MzaDieZ0 6Sv7eSDwm0eHzROlHZtFY6fgC24O05Du0wMkK5SU/zFXlOR/n2w8lKxFRluIgSxlXD qeORQhZBysSbrLkQlODOmsFzmkEEAwjeLg3aXqXYnM8L88Wa3hfyB1mbThDN6XxGyb rbUyu3qdljx+ErlYmkR1yXGtij3jlk7TZYQ4yDvfkYvZvg3STVJMy9YodcMYAmh/Hz O+tAIAk3DecBi0ZuwGpbZfn9sEZ6fbaa2hIuqWodtyEdiZeA8tGe3TrHT+EcgqOzg2 ixY4JS5fQKiEw== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 78/87] ipc: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:27 -0400 Message-ID: <20230928110413.33032-77-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=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email 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 (morse.vger.email [0.0.0.0]); Thu, 28 Sep 2023 04:24:20 -0700 (PDT) Signed-off-by: Jeff Layton --- ipc/mqueue.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/ipc/mqueue.c b/ipc/mqueue.c index ba8215ed663a..5eea4dc0509e 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -302,7 +302,7 @@ static struct inode *mqueue_get_inode(struct super_block *sb, inode->i_mode = mode; inode->i_uid = current_fsuid(); inode->i_gid = current_fsgid(); - inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); + simple_inode_init_ts(inode); if (S_ISREG(mode)) { struct mqueue_inode_info *info; @@ -596,7 +596,7 @@ static int mqueue_create_attr(struct dentry *dentry, umode_t mode, void *arg) put_ipc_ns(ipc_ns); dir->i_size += DIRENT_SIZE; - dir->i_mtime = dir->i_atime = inode_set_ctime_current(dir); + simple_inode_init_ts(dir); d_instantiate(dentry, inode); dget(dentry); @@ -618,7 +618,7 @@ static int mqueue_unlink(struct inode *dir, struct dentry *dentry) { struct inode *inode = d_inode(dentry); - dir->i_mtime = dir->i_atime = inode_set_ctime_current(dir); + simple_inode_init_ts(dir); dir->i_size -= DIRENT_SIZE; drop_nlink(inode); dput(dentry); @@ -657,7 +657,7 @@ static ssize_t mqueue_read_file(struct file *filp, char __user *u_data, if (ret <= 0) return ret; - inode->i_atime = inode_set_ctime_current(inode); + inode_set_atime_to_ts(inode, inode_set_ctime_current(inode)); return ret; } @@ -1163,7 +1163,7 @@ static int do_mq_timedsend(mqd_t mqdes, const char __user *u_msg_ptr, goto out_unlock; __do_notify(info); } - inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); + simple_inode_init_ts(inode); } out_unlock: spin_unlock(&info->lock); @@ -1257,7 +1257,7 @@ static int do_mq_timedreceive(mqd_t mqdes, char __user *u_msg_ptr, msg_ptr = msg_get(info); - inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); + simple_inode_init_ts(inode); /* There is now free space in queue. */ pipelined_receive(&wake_q, info); @@ -1395,7 +1395,8 @@ static int do_mq_notify(mqd_t mqdes, const struct sigevent *notification) if (notification == NULL) { if (info->notify_owner == task_tgid(current)) { remove_notification(info); - inode->i_atime = inode_set_ctime_current(inode); + inode_set_atime_to_ts(inode, + inode_set_ctime_current(inode)); } } else if (info->notify_owner != NULL) { ret = -EBUSY; @@ -1421,7 +1422,7 @@ static int do_mq_notify(mqd_t mqdes, const struct sigevent *notification) info->notify_owner = get_pid(task_tgid(current)); info->notify_user_ns = get_user_ns(current_user_ns()); - inode->i_atime = inode_set_ctime_current(inode); + inode_set_atime_to_ts(inode, inode_set_ctime_current(inode)); } spin_unlock(&info->lock); out_fput: @@ -1484,7 +1485,7 @@ static int do_mq_getsetattr(int mqdes, struct mq_attr *new, struct mq_attr *old) f.file->f_flags &= ~O_NONBLOCK; spin_unlock(&f.file->f_lock); - inode->i_atime = inode_set_ctime_current(inode); + inode_set_atime_to_ts(inode, inode_set_ctime_current(inode)); } spin_unlock(&info->lock); -- 2.41.0