From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A74DEEB64DC for ; Thu, 6 Jul 2023 14:56:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3EA7A6B0072; Thu, 6 Jul 2023 10:56:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 39B168D0002; Thu, 6 Jul 2023 10:56:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 23D3B8D0001; Thu, 6 Jul 2023 10:56:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 1325B6B0072 for ; Thu, 6 Jul 2023 10:56:29 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id B6C8AA0639 for ; Thu, 6 Jul 2023 14:56:28 +0000 (UTC) X-FDA: 80981488056.28.5DDA6FE Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf02.hostedemail.com (Postfix) with ESMTP id F234680023 for ; Thu, 6 Jul 2023 14:56:25 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=ZBMuSMTP; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="lgq/dkwy"; spf=pass (imf02.hostedemail.com: domain of jack@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=jack@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688655386; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=4FDv8PFxGVHoEmGa8pg7R3F8HxY9lLeyFj125JbMca8=; b=grArg9abYJ8PMSJ27fYJ03xvhZurnIJkVMme4Rt329oPKkBWfOHJh0jr706WL9IL2N8o2d eV/F67geni4Ykx8UHgwlWkDJI32uhxq1o7NBittemfrouRs+gAZcwYtewpHeKRj3IT11jx 32rc8TiAytAf6iQHlgVBPBZMZ/9yDvU= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=ZBMuSMTP; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="lgq/dkwy"; spf=pass (imf02.hostedemail.com: domain of jack@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=jack@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688655386; a=rsa-sha256; cv=none; b=jrtBBBp3jePsACCTErGmo5lFryvhq8cNGAQUlHYbNdcXivC8CUJRc+FMucyxhEwUUTxd8Z NPs6RnrOzeumTgDwCduP7l/OI43Oz/CursAuytcBmO8AuTkZt0Vs3S2bM45HyBI/yuwwaA +2y4SnKgcrZ/43jtd+241M4OHejJquk= 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-out2.suse.de (Postfix) with ESMTPS id 47D941F747; Thu, 6 Jul 2023 14:56:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1688655384; 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=4FDv8PFxGVHoEmGa8pg7R3F8HxY9lLeyFj125JbMca8=; b=ZBMuSMTPwXhf4fLC7+Z1bgABXpQG3fS5ksNt68iJ8mCHMA7n99mpeSoH/Dq2Q8gm6R2NnQ 3ks7fdyw/cLbXmii60OzFFuWNLZ0scDYmp7sdNs2TYa71aBJErbjzb1UEwsfuo9icIifNH 5+u9OnEuFaSfe6KAhZ9L/vTIB6ZoI0E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1688655384; 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=4FDv8PFxGVHoEmGa8pg7R3F8HxY9lLeyFj125JbMca8=; b=lgq/dkwyAmpv1OM8X/CD2btj9FXw+PgBJNCka1ETBmz91ZAlk7NSzKtCR9dfjYi+yOldu2 DElbpUfuiK5OBqCw== 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 39E22138FC; Thu, 6 Jul 2023 14:56:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id TnkvDhjWpmRaBQAAMHmgww (envelope-from ); Thu, 06 Jul 2023 14:56:24 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id BC007A0707; Thu, 6 Jul 2023 16:56:23 +0200 (CEST) Date: Thu, 6 Jul 2023 16:56:23 +0200 From: Jan Kara To: Jeff Layton Cc: Christian Brauner , Hugh Dickins , Andrew Morton , Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2 87/92] shmem: convert to ctime accessor functions Message-ID: <20230706145623.jkgc7awfs4xhioqy@quack3> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> <20230705190309.579783-85-jlayton@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230705190309.579783-85-jlayton@kernel.org> X-Rspamd-Queue-Id: F234680023 X-Rspam-User: X-Stat-Signature: taxcbuoicizygaxze4woanqj3qyho7fb X-Rspamd-Server: rspam01 X-HE-Tag: 1688655385-573938 X-HE-Meta: U2FsdGVkX1/jbxf8QopUPO2pJThCBnRi7VmzE0uJPv/LYkr12wRe0QuF+VNcP19bsqouXoXQq+DM6svBsOq+C1Qh2P84v/7lioZuGCX+4kmXBvJRcNBFhXJJfBHf8+2sgakLeengHFVO0OUfrLIgQAOR2xLMUmbsrNsNQUV9cXabbpImOqQch6qWHbILBMSeqeGui+Tb/7fmxsXuF4BQSgGo3NNc6a/Go6TWGko6pOy9icGuBGSe6ZHL6zXIzIXlab1TfjuWgoQxp2xhiQ2x4HPo5Hm97CQy1tH6jiuEmqpVDYpODFmT+GXA3/uO/NQbBZRezPCdTT0w4q5Gw877XgbouIsGziYyL3As0PB/Lje8BM0LzbPewqbpq60inGsWzPiYuZhyTyFZyfCpJZtrQ8efjpRbBYgeqVRDIHnEshkmec6zqFM3LjYhmTYX6H3Z6k0wr9lrKymSFlVhtUrtOWnFS3boakN1pPiYv1p/ii66yYNxWCNhCFWwZ/eUqzy5SllTAcxFsttXAtAUbeXECyLK8Fwu9GgwNewf7nl42VNzUomtdxInDwoedLmO6NkiA6NzZh6evWcPJqcrLo6t4iTJhsQ3BNCshO6J4c2zItSmEmOeh+PBF2wos0LnUElMVzzt8CaGG+7hgPoxNsOtPUsSBQ2xVx1mPsNLmmTveVuo6ZFL/2RPg6gtSioem4/GCJg/sPi/8oiqf5w9L5PyL/nLlr917+dy2mzsolMjht0OyOKoozM5cRASHMXkn/+dXHHooFm2JshrrJHMX+bIUg/nDiRGtJ5SBleCRjkWUd/oJQL7JwMGcKD+oabPrywWoR6NMDUy+A95IJ/tPUlw9z1rAUt//Yw/1kyV29tfSXP0T6W/Xdjugf0Fc3eUQy3Ktr2VJU7BWLWIGpKYywpo5799NqWdVoM2Ie5YyEC5tFTK049AHk62+a0D4RN3OPU8EXKlJSBf0MLk6mpzTeK jH9Nr840 g/zd5qeW8vhfc83Vyp6vpv2ccYSQwcbVq/o8Diy88B9EgdWbTuZik3pyIhcvSwtiPU2LclYuCeuKORWA2IpQmTQQ2Uz4s3egA767qXuJoGxbtLXAGL6ORZsoqBW/0ntjTMiK6mmoeoVP4XAwuO/lI1nsdZokb6OdrvhElsSH8RvdqBa3mVIpFxuKtxdPN1v6sWDQ99D+Ymxo8kJID/Ad6cBhybR4K8RXotDXurzs07WHkqt5+u2o/vqe+VgpYA10LGpURgde8WkdaihX1Nt9xEsOqgE/O7gxdFsMiWlK3YuHM8huglLOMRJQ1kg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed 05-07-23 15:01:52, 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. Feel free to add: Reviewed-by: Jan Kara Honza > --- > mm/shmem.c | 22 ++++++++++++---------- > 1 file changed, 12 insertions(+), 10 deletions(-) > > diff --git a/mm/shmem.c b/mm/shmem.c > index 1693134959c5..51aaaf479437 100644 > --- a/mm/shmem.c > +++ b/mm/shmem.c > @@ -1064,7 +1064,7 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, loff_t lend, > void shmem_truncate_range(struct inode *inode, loff_t lstart, loff_t lend) > { > shmem_undo_range(inode, lstart, lend, false); > - inode->i_ctime = inode->i_mtime = current_time(inode); > + inode->i_mtime = inode_set_ctime_current(inode); > inode_inc_iversion(inode); > } > EXPORT_SYMBOL_GPL(shmem_truncate_range); > @@ -1161,9 +1161,9 @@ static int shmem_setattr(struct mnt_idmap *idmap, > if (attr->ia_valid & ATTR_MODE) > error = posix_acl_chmod(idmap, dentry, inode->i_mode); > if (!error && update_ctime) { > - inode->i_ctime = current_time(inode); > + inode_set_ctime_current(inode); > if (update_mtime) > - inode->i_mtime = inode->i_ctime; > + inode->i_mtime = inode_get_ctime(inode); > inode_inc_iversion(inode); > } > return error; > @@ -2394,7 +2394,7 @@ static struct inode *shmem_get_inode(struct mnt_idmap *idmap, struct super_block > inode->i_ino = ino; > inode_init_owner(idmap, inode, dir, mode); > inode->i_blocks = 0; > - 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_generation = get_random_u32(); > info = SHMEM_I(inode); > memset(info, 0, (char *)inode - (char *)info); > @@ -3110,7 +3110,7 @@ shmem_mknod(struct mnt_idmap *idmap, struct inode *dir, > goto out_iput; > > dir->i_size += BOGO_DIRENT_SIZE; > - dir->i_ctime = dir->i_mtime = current_time(dir); > + dir->i_mtime = inode_set_ctime_current(dir); > inode_inc_iversion(dir); > d_instantiate(dentry, inode); > dget(dentry); /* Extra count - pin the dentry in core */ > @@ -3193,7 +3193,8 @@ static int shmem_link(struct dentry *old_dentry, struct inode *dir, struct dentr > } > > dir->i_size += BOGO_DIRENT_SIZE; > - inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode); > + dir->i_mtime = inode_set_ctime_to_ts(dir, > + inode_set_ctime_current(inode)); > inode_inc_iversion(dir); > inc_nlink(inode); > ihold(inode); /* New dentry reference */ > @@ -3213,7 +3214,8 @@ static int shmem_unlink(struct inode *dir, struct dentry *dentry) > simple_offset_remove(shmem_get_offset_ctx(dir), dentry); > > dir->i_size -= BOGO_DIRENT_SIZE; > - inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode); > + dir->i_mtime = inode_set_ctime_to_ts(dir, > + inode_set_ctime_current(inode)); > inode_inc_iversion(dir); > drop_nlink(inode); > dput(dentry); /* Undo the count from "create" - this does all the work */ > @@ -3360,7 +3362,7 @@ static int shmem_symlink(struct mnt_idmap *idmap, struct inode *dir, > folio_put(folio); > } > dir->i_size += BOGO_DIRENT_SIZE; > - dir->i_ctime = dir->i_mtime = current_time(dir); > + dir->i_mtime = inode_set_ctime_current(dir); > inode_inc_iversion(dir); > d_instantiate(dentry, inode); > dget(dentry); > @@ -3438,7 +3440,7 @@ static int shmem_fileattr_set(struct mnt_idmap *idmap, > (fa->flags & SHMEM_FL_USER_MODIFIABLE); > > shmem_set_inode_flags(inode, info->fsflags); > - inode->i_ctime = current_time(inode); > + inode_set_ctime_current(inode); > inode_inc_iversion(inode); > return 0; > } > @@ -3508,7 +3510,7 @@ static int shmem_xattr_handler_set(const struct xattr_handler *handler, > name = xattr_full_name(handler, name); > err = simple_xattr_set(&info->xattrs, name, value, size, flags, NULL); > if (!err) { > - inode->i_ctime = current_time(inode); > + inode_set_ctime_current(inode); > inode_inc_iversion(inode); > } > return err; > -- > 2.41.0 > -- Jan Kara SUSE Labs, CR