From patchwork Thu May 18 11:47:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13246637 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 2C3A4C77B7A for ; Thu, 18 May 2023 11:48:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BE6DE280002; Thu, 18 May 2023 07:48:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BBDF6280001; Thu, 18 May 2023 07:48:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A5EDC280002; Thu, 18 May 2023 07:48:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 9932B280001 for ; Thu, 18 May 2023 07:48:13 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 60DA3A07A8 for ; Thu, 18 May 2023 11:48:13 +0000 (UTC) X-FDA: 80803202466.08.C0BCF97 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf21.hostedemail.com (Postfix) with ESMTP id A32B31C0012 for ; Thu, 18 May 2023 11:48:11 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=eVgA9C24; spf=pass (imf21.hostedemail.com: domain of jlayton@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jlayton@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1684410491; a=rsa-sha256; cv=none; b=QzaJiX+MWoN0fB14m3QGiYIJw7aTRRmVneHXAZn1Nj9BQNQIMyjC3jKqSzqsQ/DTulsjQC jwC02aaBdgS5XQFT1fo1coz/BMzh4XD8VHAd+6QR4X5C9eIEzenkAFD48ezSMUB4PlpkD7 G44dvziCHqkw26Q3IoXPLiatl3iObAA= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=eVgA9C24; spf=pass (imf21.hostedemail.com: domain of jlayton@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jlayton@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1684410491; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=K3pra9/7lzeMoeQ6tvF3aYX8KbqIJSGbzzRHgqoko1o=; b=bv1+Ww4wwXhEyXG8m9xR3foSHiKIZtsQ476+Gg1AQrN7rpfBIGElyaMDhj/v3HCGM+SDlU jXvTE2An7hg8XOHnJfrv+jlncLHS5yb6hwNaByhmgWPKds8xfHfHi0hSPSkq3nq4LSJOVQ kEbxIRGpZCAveR5S7Fq0z0ggYqbmrXY= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CB4F764EDD; Thu, 18 May 2023 11:48:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB4D1C433EF; Thu, 18 May 2023 11:48:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684410490; bh=5rxAU8gdxN1ANNzaz9AdhjVNTPRoenRpbGIWMsQfU4w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eVgA9C24n1V/7bjWNt/MFHa2FAnb+8uX24YF0bfaqI+n2uU86gaNNLvnJvTPy2h0u mzmMNL4mC7Iv7AvqfwHIA9G9ibv96tTkXSQCog7/MUUVORddGN6N+tp6QRz7RVGvZa 0c4rrwAy4Bl9Q+gIAGIs75p0tPNaKQvgeHqryuU+BvFHe0voa9dJD3Ox4r79+jXqzp E/3xSXXpUnpdfGbZWx+LUnrw6U9fuTep2qhxnuOpnZ1GCC2xnB4MaVAT5BvNzQA7oH ISArStV4NaqnmwgskcuEltftzmabNRP0wSvpmQ288q/XTm+8QneDSB49jf3ayM81XP z9Kt4JGRJ4IBg== From: Jeff Layton To: Alexander Viro , Christian Brauner , "Darrick J. Wong" , Hugh Dickins , Andrew Morton , Dave Chinner , Chuck Lever Cc: Jan Kara , Amir Goldstein , David Howells , Neil Brown , Matthew Wilcox , Andreas Dilger , Theodore T'so , Chris Mason , Josef Bacik , David Sterba , Namjae Jeon , Steve French , Sergey Senozhatsky , Tom Talpey , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org Subject: [PATCH v4 9/9] btrfs: convert to multigrain timestamps Date: Thu, 18 May 2023 07:47:42 -0400 Message-Id: <20230518114742.128950-10-jlayton@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230518114742.128950-1-jlayton@kernel.org> References: <20230518114742.128950-1-jlayton@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: A32B31C0012 X-Stat-Signature: nw3tgtakejzpmtd6uo566xhzxdejc5jd X-HE-Tag: 1684410491-501901 X-HE-Meta: U2FsdGVkX19mh3wMshgBereYiwtxW1Ebqzg1KKUAdYfQhoXxvese/bUlDURfoZcC0SnUF35htZtMuMiCQoP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gBrIBkR3u/vVPT6uOXPVxR7uldJZafarIVJrjuthXwgq/OPvDN7BX0l8Pg1Zywpg0Gu9miG1lnIOcQdGLpjdJ78yDdXhiMoaM4zM76yp/QycnMcFEEJoPciDwTbEsyKyh9fyvRvjT4HHAJ3Av02ph7Oju5CwYh/rhDW8IHhJ5A== 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: Signed-off-by: Jeff Layton Acked-by: David Sterba --- fs/btrfs/delayed-inode.c | 2 +- fs/btrfs/inode.c | 2 +- fs/btrfs/super.c | 5 +++-- fs/btrfs/tree-log.c | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index 6b457b010cbc..8307fd69da43 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c @@ -1810,7 +1810,7 @@ static void fill_stack_inode_item(struct btrfs_trans_handle *trans, btrfs_set_stack_timespec_sec(&inode_item->ctime, inode->i_ctime.tv_sec); btrfs_set_stack_timespec_nsec(&inode_item->ctime, - inode->i_ctime.tv_nsec); + ctime_nsec_peek(inode)); btrfs_set_stack_timespec_sec(&inode_item->otime, BTRFS_I(inode)->i_otime.tv_sec); diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 2335b5e1cecc..b27d4dda6024 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -3970,7 +3970,7 @@ static void fill_inode_item(struct btrfs_trans_handle *trans, btrfs_set_token_timespec_sec(&token, &item->ctime, inode->i_ctime.tv_sec); btrfs_set_token_timespec_nsec(&token, &item->ctime, - inode->i_ctime.tv_nsec); + ctime_nsec_peek(inode)); btrfs_set_token_timespec_sec(&token, &item->otime, BTRFS_I(inode)->i_otime.tv_sec); diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index ec18e2210602..fc6abf8b1f42 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -2144,7 +2144,7 @@ static struct file_system_type btrfs_fs_type = { .name = "btrfs", .mount = btrfs_mount, .kill_sb = btrfs_kill_super, - .fs_flags = FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA, + .fs_flags = FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA | FS_MULTIGRAIN_TS, }; static struct file_system_type btrfs_root_fs_type = { @@ -2152,7 +2152,8 @@ static struct file_system_type btrfs_root_fs_type = { .name = "btrfs", .mount = btrfs_mount_root, .kill_sb = btrfs_kill_super, - .fs_flags = FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA | FS_ALLOW_IDMAP, + .fs_flags = FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA | + FS_ALLOW_IDMAP | FS_MULTIGRAIN_TS, }; MODULE_ALIAS_FS("btrfs"); diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 9b212e8c70cc..9a4d1b2ab204 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -4150,7 +4150,7 @@ static void fill_inode_item(struct btrfs_trans_handle *trans, btrfs_set_token_timespec_sec(&token, &item->ctime, inode->i_ctime.tv_sec); btrfs_set_token_timespec_nsec(&token, &item->ctime, - inode->i_ctime.tv_nsec); + ctime_nsec_peek(inode)); /* * We do not need to set the nbytes field, in fact during a fast fsync