Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30448805rwd; Thu, 6 Jul 2023 06:11:08 -0700 (PDT) X-Google-Smtp-Source: APBJJlEDNZ1TEtKzx5zY56a/nj0ZWmgT8gPQ3WRXpS5JxZ9Lm0zY6BU1e6M3PlUJBGX0DUl1JaHV X-Received: by 2002:a17:902:e743:b0:1b4:5699:aac1 with SMTP id p3-20020a170902e74300b001b45699aac1mr2890190plf.12.1688649068078; Thu, 06 Jul 2023 06:11:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688649068; cv=none; d=google.com; s=arc-20160816; b=Y5e68/aAWrxFAmkZfpZbbiQ7mRBmrdU+/XpTtJMrnAJw2GFmyGM9A61Fb3uIbqWXdu u3ngdb4INkj9dM48osoSzi9VKXjiNpYAXjgpFi/uEAKAeAvXgj89hDWtkpPwf3DuDOUp 0WxJEi59aJCHA2AmLQOBQccepodb5zW9mi23PAVvIoZ6nUZWgfJv/Z8E3nVeeYTI5ZcL Tu087YQ85pDDe40bBuFTe7LkrwCoPIbZPhe/Q9OQNRcynHziswMxsB7Gq0YJUPfoeS3e MNsxw3k2GJGn9FYn7kFnioC4c9mD7wWfiKWPr8jNfCXDh5LzNfdEKBTguyz3NbvDbZap LT7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=noOxSZcOq91/VCWktatlvWENq3YdaDTCODkvdrts+c0=; fh=rCR4Zz39gw2uXm/ePcfpRavMqTKKg5r190NG9Mvsc7w=; b=b3dwwAamaUDDSQD1bkaJ4f3AWlQ97zqbQK9atJrr+2+p47r5FhYRqmZkUorj75IjH3 ZNs0HFImz6q7Kyw/YboPYOnVGflo1HaV1OWTXJD6lbLsmRjPTG6gaH8RHHBkhTToQDpl KkxchRlGIoncuT1hTrafv4a/ZQN6br0oUgcH1muVdUD/lDabM8Zb0wlguJtvI3EZ799b BPFZoCkhQxUu7bsdxDuhzb6F/BkKViXzG/HhOZcVNokbbHqDxGWJw+J9rAK+E5poI7ew CqLTIOJIKwYGb6OrddMA3aBFG0byAxHWZVM5EX5Aj27j4mM0WGvhb5QaG4gF++Z0ZzQz sUVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=P20gvxWO; dkim=neutral (no key) header.i=@suse.cz header.b=GHZlQyqy; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t7-20020a1709027fc700b001b8a54a1800si1170578plb.309.2023.07.06.06.10.55; Thu, 06 Jul 2023 06:11:08 -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=@suse.cz header.s=susede2_rsa header.b=P20gvxWO; dkim=neutral (no key) header.i=@suse.cz header.b=GHZlQyqy; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229831AbjGFMkb (ORCPT + 99 others); Thu, 6 Jul 2023 08:40:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229555AbjGFMk3 (ORCPT ); Thu, 6 Jul 2023 08:40:29 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B45CC171A; Thu, 6 Jul 2023 05:40:28 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 5E04321AF4; Thu, 6 Jul 2023 12:40:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1688647227; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=noOxSZcOq91/VCWktatlvWENq3YdaDTCODkvdrts+c0=; b=P20gvxWOIYdGnEH+KCCgyz0WEXFPIeXpaMPN6gtCM9eVpK7V28swkElJlFIrebzarB8gPQ C7Ilq6fI+1rFRH5CvuW4P3oFlJ/kZln435uHHsb+KFq5OMeZWzKeWPH/PPKZdZ9XjoVV/K tc+VHnAq8woGSsI0kjsw+e8OMv5kkcQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1688647227; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=noOxSZcOq91/VCWktatlvWENq3YdaDTCODkvdrts+c0=; b=GHZlQyqyMNi9TXaUCakNTUtVsnhz55K92g5Wt/qRCh8HiG+SXTtEEsIjmwQc7KM7yE79M3 ACQojyrUokwfcQBA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 50A44138FC; Thu, 6 Jul 2023 12:40:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id kkeqEzu2pmT/PQAAMHmgww (envelope-from ); Thu, 06 Jul 2023 12:40:27 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id D60CAA0707; Thu, 6 Jul 2023 14:40:26 +0200 (CEST) Date: Thu, 6 Jul 2023 14:40:26 +0200 From: Jan Kara To: Jeff Layton Cc: Christian Brauner , Mike Kravetz , Muchun Song , Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2 52/92] hugetlbfs: convert to ctime accessor functions Message-ID: <20230706124026.cmartqjvnc3lfhmj@quack3> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> <20230705190309.579783-50-jlayton@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230705190309.579783-50-jlayton@kernel.org> X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_SOFTFAIL,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 On Wed 05-07-23 15:01:17, Jeff Layton wrote: > 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 Looks good to me. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/hugetlbfs/inode.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c > index 7b17ccfa039d..93d3bcfd4fc8 100644 > --- a/fs/hugetlbfs/inode.c > +++ b/fs/hugetlbfs/inode.c > @@ -887,7 +887,7 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset, > > if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + len > inode->i_size) > i_size_write(inode, offset + len); > - inode->i_ctime = current_time(inode); > + inode_set_ctime_current(inode); > out: > inode_unlock(inode); > return error; > @@ -935,7 +935,7 @@ static struct inode *hugetlbfs_get_root(struct super_block *sb, > inode->i_mode = S_IFDIR | ctx->mode; > inode->i_uid = ctx->uid; > inode->i_gid = ctx->gid; > - 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_op = &hugetlbfs_dir_inode_operations; > inode->i_fop = &simple_dir_operations; > /* directory inodes start off with i_nlink == 2 (for "." entry) */ > @@ -979,7 +979,7 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb, > lockdep_set_class(&inode->i_mapping->i_mmap_rwsem, > &hugetlbfs_i_mmap_rwsem_key); > inode->i_mapping->a_ops = &hugetlbfs_aops; > - 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_mapping->private_data = resv_map; > info->seals = F_SEAL_SEAL; > switch (mode & S_IFMT) { > @@ -1022,7 +1022,7 @@ static int hugetlbfs_mknod(struct mnt_idmap *idmap, struct inode *dir, > inode = hugetlbfs_get_inode(dir->i_sb, dir, mode, dev); > if (!inode) > return -ENOSPC; > - dir->i_ctime = dir->i_mtime = current_time(dir); > + dir->i_mtime = inode_set_ctime_current(dir); > d_instantiate(dentry, inode); > dget(dentry);/* Extra count - pin the dentry in core */ > return 0; > @@ -1054,7 +1054,7 @@ static int hugetlbfs_tmpfile(struct mnt_idmap *idmap, > inode = hugetlbfs_get_inode(dir->i_sb, dir, mode | S_IFREG, 0); > if (!inode) > return -ENOSPC; > - dir->i_ctime = dir->i_mtime = current_time(dir); > + dir->i_mtime = inode_set_ctime_current(dir); > d_tmpfile(file, inode); > return finish_open_simple(file, 0); > } > @@ -1076,7 +1076,7 @@ static int hugetlbfs_symlink(struct mnt_idmap *idmap, > } else > iput(inode); > } > - dir->i_ctime = dir->i_mtime = current_time(dir); > + dir->i_mtime = inode_set_ctime_current(dir); > > return error; > } > -- > 2.41.0 > -- Jan Kara SUSE Labs, CR