All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: use BTRFS_DIR_START_INDEX at btrfs_create_new_inode()
@ 2022-04-13 15:20 fdmanana
  2022-04-13 15:22 ` Nikolay Borisov
  2022-04-13 16:11 ` David Sterba
  0 siblings, 2 replies; 3+ messages in thread
From: fdmanana @ 2022-04-13 15:20 UTC (permalink / raw)
  To: linux-btrfs

From: Filipe Manana <fdmanana@suse.com>

We are still using the magic value of 2 at btrfs_create_new_inode(), but
there's now a constant for that, named BTRFS_DIR_START_INDEX, which was
introduced in commit 528ee697126fd ("btrfs: put initial index value of a
directory in a constant"). So change that to use the constant.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 fs/btrfs/inode.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 1911116974b1..620baf24c6bd 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -6238,12 +6238,8 @@ int btrfs_create_new_inode(struct btrfs_trans_handle *trans,
 		if (ret)
 			goto out;
 	}
-	/*
-	 * index_cnt is ignored for everything but a dir,
-	 * btrfs_set_inode_index_count has an explanation for the magic
-	 * number
-	 */
-	BTRFS_I(inode)->index_cnt = 2;
+	/* index_cnt is ignored for everything but a dir. */
+	BTRFS_I(inode)->index_cnt = BTRFS_DIR_START_INDEX;
 	BTRFS_I(inode)->generation = trans->transid;
 	inode->i_generation = BTRFS_I(inode)->generation;
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: use BTRFS_DIR_START_INDEX at btrfs_create_new_inode()
  2022-04-13 15:20 [PATCH] btrfs: use BTRFS_DIR_START_INDEX at btrfs_create_new_inode() fdmanana
@ 2022-04-13 15:22 ` Nikolay Borisov
  2022-04-13 16:11 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: Nikolay Borisov @ 2022-04-13 15:22 UTC (permalink / raw)
  To: fdmanana, linux-btrfs



On 13.04.22 г. 18:20 ч., fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> We are still using the magic value of 2 at btrfs_create_new_inode(), but
> there's now a constant for that, named BTRFS_DIR_START_INDEX, which was
> introduced in commit 528ee697126fd ("btrfs: put initial index value of a
> directory in a constant"). So change that to use the constant.
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

Reviewed-by: Nikolay Borisov <nborisov@suse.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: use BTRFS_DIR_START_INDEX at btrfs_create_new_inode()
  2022-04-13 15:20 [PATCH] btrfs: use BTRFS_DIR_START_INDEX at btrfs_create_new_inode() fdmanana
  2022-04-13 15:22 ` Nikolay Borisov
@ 2022-04-13 16:11 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2022-04-13 16:11 UTC (permalink / raw)
  To: fdmanana; +Cc: linux-btrfs

On Wed, Apr 13, 2022 at 04:20:21PM +0100, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> We are still using the magic value of 2 at btrfs_create_new_inode(), but
> there's now a constant for that, named BTRFS_DIR_START_INDEX, which was
> introduced in commit 528ee697126fd ("btrfs: put initial index value of a
> directory in a constant"). So change that to use the constant.
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

Added to misc-next, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-13 16:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-13 15:20 [PATCH] btrfs: use BTRFS_DIR_START_INDEX at btrfs_create_new_inode() fdmanana
2022-04-13 15:22 ` Nikolay Borisov
2022-04-13 16:11 ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.