linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/15] btrfs: strip out btrfs_fs_info dependencies
@ 2022-09-14 23:04 Josef Bacik
  2022-09-14 23:04 ` [PATCH 01/15] btrfs: move btrfs_caching_type to block-group.h Josef Bacik
                   ` (15 more replies)
  0 siblings, 16 replies; 49+ messages in thread
From: Josef Bacik @ 2022-09-14 23:04 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

Part of the cleaning up of ctree.h is being able to move btrfs_fs_info out of
it.  This is actually pretty difficult because we essentially rely on ctree.h
being included before everything else, so all other header files have fs_info
defined for their helpers.

This series starts this work.  There are a variety of other small moves as well,
but the bulk is trying to pull any helpers that access fs_info members inside of
their header files into their respective c files, or alternatively reworking the
code to drop the dependency.  Thanks,

Josef

Josef Bacik (15):
  btrfs: move btrfs_caching_type to block-group.h
  btrfs: move btrfs_full_stripe_locks_tree into block-group.h
  btrfs: move btrfs_init_async_reclaim_work prototype to space-info.h
  btrfs: move btrfs_pinned_by_swapfile prototype into volumes.h
  btrfs: remove temporary btrfs_map_token declaration in ctree.h
  btrfs: move static_assert() for btrfs_super_block into fs.c
  btrfs: move btrfs_swapfile_pin into volumes.h
  btrfs: move fs_info struct declarations to the top of ctree.h
  btrfs: move btrfs_csum_ptr to inode.c
  btrfs: move the fs_info related helpers closer to fs_info in ctree.h
  btrfs: move btrfs_ordered_sum_size into file-item.c
  btrfs: delete btrfs_inode_sectorsize helper
  btrfs: delete btrfs_insert_inode_hash helper
  btrfs: use a runtime flag to indicate an inode is a free space inode
  btrfs: add struct declarations in dev-replace.h

 fs/btrfs/block-group.c  |   3 +-
 fs/btrfs/block-group.h  |  15 +++
 fs/btrfs/btrfs_inode.h  |  22 +---
 fs/btrfs/ctree.h        | 260 ++++++++++++++++------------------------
 fs/btrfs/dev-replace.h  |   4 +
 fs/btrfs/disk-io.c      |   4 +-
 fs/btrfs/extent_io.c    |   4 +-
 fs/btrfs/file-item.c    |  12 ++
 fs/btrfs/file.c         |  11 +-
 fs/btrfs/fs.c           |   2 +
 fs/btrfs/inode.c        |  13 ++
 fs/btrfs/ordered-data.h |  12 --
 fs/btrfs/space-info.h   |   1 +
 fs/btrfs/volumes.h      |  26 ++++
 14 files changed, 188 insertions(+), 201 deletions(-)

-- 
2.26.3


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

* [PATCH 01/15] btrfs: move btrfs_caching_type to block-group.h
  2022-09-14 23:04 [PATCH 00/15] btrfs: strip out btrfs_fs_info dependencies Josef Bacik
@ 2022-09-14 23:04 ` Josef Bacik
  2022-09-15  6:09   ` Anand Jain
  2022-09-15 14:34   ` Johannes Thumshirn
  2022-09-14 23:04 ` [PATCH 02/15] btrfs: move btrfs_full_stripe_locks_tree into block-group.h Josef Bacik
                   ` (14 subsequent siblings)
  15 siblings, 2 replies; 49+ messages in thread
From: Josef Bacik @ 2022-09-14 23:04 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

This is a block group related definition, move it into block-group.h.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/block-group.h | 7 +++++++
 fs/btrfs/ctree.h       | 7 -------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/fs/btrfs/block-group.h b/fs/btrfs/block-group.h
index e34cb80ffb25..558fa0a21fb4 100644
--- a/fs/btrfs/block-group.h
+++ b/fs/btrfs/block-group.h
@@ -57,6 +57,13 @@ enum btrfs_block_group_flags {
 	BLOCK_GROUP_FLAG_ZONED_DATA_RELOC,
 };
 
+enum btrfs_caching_type {
+	BTRFS_CACHE_NO,
+	BTRFS_CACHE_STARTED,
+	BTRFS_CACHE_FINISHED,
+	BTRFS_CACHE_ERROR,
+};
+
 struct btrfs_caching_control {
 	struct list_head list;
 	struct mutex mutex;
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 8271b3dccf16..725c187d5c4b 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -180,13 +180,6 @@ struct btrfs_free_cluster {
 	struct list_head block_group_list;
 };
 
-enum btrfs_caching_type {
-	BTRFS_CACHE_NO,
-	BTRFS_CACHE_STARTED,
-	BTRFS_CACHE_FINISHED,
-	BTRFS_CACHE_ERROR,
-};
-
 /*
  * Tree to record all locked full stripes of a RAID5/6 block group
  */
-- 
2.26.3


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

* [PATCH 02/15] btrfs: move btrfs_full_stripe_locks_tree into block-group.h
  2022-09-14 23:04 [PATCH 00/15] btrfs: strip out btrfs_fs_info dependencies Josef Bacik
  2022-09-14 23:04 ` [PATCH 01/15] btrfs: move btrfs_caching_type to block-group.h Josef Bacik
@ 2022-09-14 23:04 ` Josef Bacik
  2022-09-15  6:10   ` Anand Jain
  2022-09-15 14:38   ` Johannes Thumshirn
  2022-09-14 23:04 ` [PATCH 03/15] btrfs: move btrfs_init_async_reclaim_work prototype to space-info.h Josef Bacik
                   ` (13 subsequent siblings)
  15 siblings, 2 replies; 49+ messages in thread
From: Josef Bacik @ 2022-09-14 23:04 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

This is actually embedded in struct btrfs_block_group, so move this
definition to block-group.h, and then open-code the init of the tree
where we init the rest of the block group instead of using a helper.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/block-group.c |  3 ++-
 fs/btrfs/block-group.h |  8 ++++++++
 fs/btrfs/ctree.h       | 14 --------------
 3 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
index 20da92ae5c6b..e21382a13fe4 100644
--- a/fs/btrfs/block-group.c
+++ b/fs/btrfs/block-group.c
@@ -1940,7 +1940,8 @@ static struct btrfs_block_group *btrfs_create_block_group_cache(
 	btrfs_init_free_space_ctl(cache, cache->free_space_ctl);
 	atomic_set(&cache->frozen, 0);
 	mutex_init(&cache->free_space_lock);
-	btrfs_init_full_stripe_locks_tree(&cache->full_stripe_locks_root);
+	cache->full_stripe_locks_root.root = RB_ROOT;
+	mutex_init(&cache->full_stripe_locks_root.lock);
 
 	return cache;
 }
diff --git a/fs/btrfs/block-group.h b/fs/btrfs/block-group.h
index 558fa0a21fb4..6c970a486b68 100644
--- a/fs/btrfs/block-group.h
+++ b/fs/btrfs/block-group.h
@@ -76,6 +76,14 @@ struct btrfs_caching_control {
 /* Once caching_thread() finds this much free space, it will wake up waiters. */
 #define CACHING_CTL_WAKE_UP SZ_2M
 
+/*
+ * Tree to record all locked full stripes of a RAID5/6 block group
+ */
+struct btrfs_full_stripe_locks_tree {
+	struct rb_root root;
+	struct mutex lock;
+};
+
 struct btrfs_block_group {
 	struct btrfs_fs_info *fs_info;
 	struct inode *inode;
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 725c187d5c4b..12d626e78182 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -180,14 +180,6 @@ struct btrfs_free_cluster {
 	struct list_head block_group_list;
 };
 
-/*
- * Tree to record all locked full stripes of a RAID5/6 block group
- */
-struct btrfs_full_stripe_locks_tree {
-	struct rb_root root;
-	struct mutex lock;
-};
-
 /* Discard control. */
 /*
  * Async discard uses multiple lists to differentiate the discard filter
@@ -1944,12 +1936,6 @@ int btrfs_scrub_cancel(struct btrfs_fs_info *info);
 int btrfs_scrub_cancel_dev(struct btrfs_device *dev);
 int btrfs_scrub_progress(struct btrfs_fs_info *fs_info, u64 devid,
 			 struct btrfs_scrub_progress *progress);
-static inline void btrfs_init_full_stripe_locks_tree(
-			struct btrfs_full_stripe_locks_tree *locks_root)
-{
-	locks_root->root = RB_ROOT;
-	mutex_init(&locks_root->lock);
-}
 
 /* dev-replace.c */
 void btrfs_bio_counter_inc_blocked(struct btrfs_fs_info *fs_info);
-- 
2.26.3


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

* [PATCH 03/15] btrfs: move btrfs_init_async_reclaim_work prototype to space-info.h
  2022-09-14 23:04 [PATCH 00/15] btrfs: strip out btrfs_fs_info dependencies Josef Bacik
  2022-09-14 23:04 ` [PATCH 01/15] btrfs: move btrfs_caching_type to block-group.h Josef Bacik
  2022-09-14 23:04 ` [PATCH 02/15] btrfs: move btrfs_full_stripe_locks_tree into block-group.h Josef Bacik
@ 2022-09-14 23:04 ` Josef Bacik
  2022-09-15  6:11   ` Anand Jain
  2022-09-15 14:42   ` Johannes Thumshirn
  2022-09-14 23:04 ` [PATCH 04/15] btrfs: move btrfs_pinned_by_swapfile prototype into volumes.h Josef Bacik
                   ` (12 subsequent siblings)
  15 siblings, 2 replies; 49+ messages in thread
From: Josef Bacik @ 2022-09-14 23:04 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

The code for this helper is in space-info.c, move the prototype to
space-info.h.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/ctree.h      | 2 --
 fs/btrfs/space-info.h | 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 12d626e78182..0c5a6ea2eeb3 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -211,8 +211,6 @@ struct btrfs_discard_ctl {
 	atomic64_t discard_bytes_saved;
 };
 
-void btrfs_init_async_reclaim_work(struct btrfs_fs_info *fs_info);
-
 /* fs_info */
 struct reloc_control;
 struct btrfs_device;
diff --git a/fs/btrfs/space-info.h b/fs/btrfs/space-info.h
index 729820582fa7..6e2947688c53 100644
--- a/fs/btrfs/space-info.h
+++ b/fs/btrfs/space-info.h
@@ -217,5 +217,6 @@ static inline void btrfs_space_info_free_bytes_may_use(
 int btrfs_reserve_data_bytes(struct btrfs_fs_info *fs_info, u64 bytes,
 			     enum btrfs_reserve_flush_enum flush);
 void btrfs_dump_space_info_for_trans_abort(struct btrfs_fs_info *fs_info);
+void btrfs_init_async_reclaim_work(struct btrfs_fs_info *fs_info);
 
 #endif /* BTRFS_SPACE_INFO_H */
-- 
2.26.3


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

* [PATCH 04/15] btrfs: move btrfs_pinned_by_swapfile prototype into volumes.h
  2022-09-14 23:04 [PATCH 00/15] btrfs: strip out btrfs_fs_info dependencies Josef Bacik
                   ` (2 preceding siblings ...)
  2022-09-14 23:04 ` [PATCH 03/15] btrfs: move btrfs_init_async_reclaim_work prototype to space-info.h Josef Bacik
@ 2022-09-14 23:04 ` Josef Bacik
  2022-09-15 10:37   ` Anand Jain
  2022-09-15 14:43   ` Johannes Thumshirn
  2022-09-14 23:04 ` [PATCH 05/15] btrfs: remove temporary btrfs_map_token declaration in ctree.h Josef Bacik
                   ` (11 subsequent siblings)
  15 siblings, 2 replies; 49+ messages in thread
From: Josef Bacik @ 2022-09-14 23:04 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

This is defined in volumes.c, move the prototype into volumes.h.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/ctree.h   | 2 --
 fs/btrfs/volumes.h | 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 0c5a6ea2eeb3..36a473f05831 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -243,8 +243,6 @@ struct btrfs_swapfile_pin {
 	int bg_extent_count;
 };
 
-bool btrfs_pinned_by_swapfile(struct btrfs_fs_info *fs_info, void *ptr);
-
 /*
  * Exclusive operations (device replace, resize, device add/remove, balance)
  */
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
index 96a7b437ff20..db4cf51134fd 100644
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@ -731,4 +731,5 @@ const char *btrfs_bg_type_to_raid_name(u64 flags);
 int btrfs_verify_dev_extents(struct btrfs_fs_info *fs_info);
 bool btrfs_repair_one_zone(struct btrfs_fs_info *fs_info, u64 logical);
 unsigned long btrfs_chunk_item_size(int num_stripes);
+bool btrfs_pinned_by_swapfile(struct btrfs_fs_info *fs_info, void *ptr);
 #endif
-- 
2.26.3


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

* [PATCH 05/15] btrfs: remove temporary btrfs_map_token declaration in ctree.h
  2022-09-14 23:04 [PATCH 00/15] btrfs: strip out btrfs_fs_info dependencies Josef Bacik
                   ` (3 preceding siblings ...)
  2022-09-14 23:04 ` [PATCH 04/15] btrfs: move btrfs_pinned_by_swapfile prototype into volumes.h Josef Bacik
@ 2022-09-14 23:04 ` Josef Bacik
  2022-09-15 10:38   ` Anand Jain
                     ` (2 more replies)
  2022-09-14 23:04 ` [PATCH 06/15] btrfs: move static_assert() for btrfs_super_block into fs.c Josef Bacik
                   ` (10 subsequent siblings)
  15 siblings, 3 replies; 49+ messages in thread
From: Josef Bacik @ 2022-09-14 23:04 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

This was added while I was moving this code to its new home, it can be
removed now.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/ctree.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 36a473f05831..a790c58b4c73 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -46,8 +46,6 @@ struct btrfs_ref;
 struct btrfs_bio;
 struct btrfs_ioctl_encoded_io_args;
 
-struct btrfs_map_token;
-
 #define BTRFS_OLDEST_GENERATION	0ULL
 
 #define BTRFS_EMPTY_DIR_SIZE 0
-- 
2.26.3


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

* [PATCH 06/15] btrfs: move static_assert() for btrfs_super_block into fs.c
  2022-09-14 23:04 [PATCH 00/15] btrfs: strip out btrfs_fs_info dependencies Josef Bacik
                   ` (4 preceding siblings ...)
  2022-09-14 23:04 ` [PATCH 05/15] btrfs: remove temporary btrfs_map_token declaration in ctree.h Josef Bacik
@ 2022-09-14 23:04 ` Josef Bacik
  2022-09-15 10:42   ` Anand Jain
                     ` (2 more replies)
  2022-09-14 23:04 ` [PATCH 07/15] btrfs: move btrfs_swapfile_pin into volumes.h Josef Bacik
                   ` (9 subsequent siblings)
  15 siblings, 3 replies; 49+ messages in thread
From: Josef Bacik @ 2022-09-14 23:04 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

We shouldn't have static_assert()'s in header files in general, but
especially since btrfs_super_block isn't defined in ctree.h.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/ctree.h | 1 -
 fs/btrfs/fs.c    | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index a790c58b4c73..3cb4e0aca058 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -56,7 +56,6 @@ struct btrfs_ioctl_encoded_io_args;
 
 #define BTRFS_SUPER_INFO_OFFSET			SZ_64K
 #define BTRFS_SUPER_INFO_SIZE			4096
-static_assert(sizeof(struct btrfs_super_block) == BTRFS_SUPER_INFO_SIZE);
 
 /*
  * The reserved space at the beginning of each device.
diff --git a/fs/btrfs/fs.c b/fs/btrfs/fs.c
index a95d86679d14..c54ee0f943ce 100644
--- a/fs/btrfs/fs.c
+++ b/fs/btrfs/fs.c
@@ -106,3 +106,5 @@ int __btrfs_fs_compat_ro(struct btrfs_fs_info *fs_info, u64 flag)
 	disk_super = fs_info->super_copy;
 	return !!(btrfs_super_compat_ro_flags(disk_super) & flag);
 }
+
+static_assert(sizeof(struct btrfs_super_block) == BTRFS_SUPER_INFO_SIZE);
-- 
2.26.3


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

* [PATCH 07/15] btrfs: move btrfs_swapfile_pin into volumes.h
  2022-09-14 23:04 [PATCH 00/15] btrfs: strip out btrfs_fs_info dependencies Josef Bacik
                   ` (5 preceding siblings ...)
  2022-09-14 23:04 ` [PATCH 06/15] btrfs: move static_assert() for btrfs_super_block into fs.c Josef Bacik
@ 2022-09-14 23:04 ` Josef Bacik
  2022-09-15 10:44   ` Anand Jain
  2022-09-19 21:22   ` David Sterba
  2022-09-14 23:04 ` [PATCH 08/15] btrfs: move fs_info struct declarations to the top of ctree.h Josef Bacik
                   ` (8 subsequent siblings)
  15 siblings, 2 replies; 49+ messages in thread
From: Josef Bacik @ 2022-09-14 23:04 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

This isn't a great spot for this, but one of the swapfile helper
functions is in volumes.c, so move the struct to volumes.h.  In the
future when we have better separation of code there will be a more
natural spot for this.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/ctree.h   | 25 -------------------------
 fs/btrfs/volumes.h | 25 +++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 3cb4e0aca058..b9e848a22290 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -215,31 +215,6 @@ struct btrfs_fs_devices;
 struct btrfs_balance_control;
 struct btrfs_delayed_root;
 
-/*
- * Block group or device which contains an active swapfile. Used for preventing
- * unsafe operations while a swapfile is active.
- *
- * These are sorted on (ptr, inode) (note that a block group or device can
- * contain more than one swapfile). We compare the pointer values because we
- * don't actually care what the object is, we just need a quick check whether
- * the object exists in the rbtree.
- */
-struct btrfs_swapfile_pin {
-	struct rb_node node;
-	void *ptr;
-	struct inode *inode;
-	/*
-	 * If true, ptr points to a struct btrfs_block_group. Otherwise, ptr
-	 * points to a struct btrfs_device.
-	 */
-	bool is_block_group;
-	/*
-	 * Only used when 'is_block_group' is true and it is the number of
-	 * extents used by a swapfile for this block group ('ptr' field).
-	 */
-	int bg_extent_count;
-};
-
 /*
  * Exclusive operations (device replace, resize, device add/remove, balance)
  */
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
index db4cf51134fd..2bf7dbe739fd 100644
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@ -180,6 +180,31 @@ struct btrfs_device {
 	u64 scrub_speed_max;
 };
 
+/*
+ * Block group or device which contains an active swapfile. Used for preventing
+ * unsafe operations while a swapfile is active.
+ *
+ * These are sorted on (ptr, inode) (note that a block group or device can
+ * contain more than one swapfile). We compare the pointer values because we
+ * don't actually care what the object is, we just need a quick check whether
+ * the object exists in the rbtree.
+ */
+struct btrfs_swapfile_pin {
+	struct rb_node node;
+	void *ptr;
+	struct inode *inode;
+	/*
+	 * If true, ptr points to a struct btrfs_block_group. Otherwise, ptr
+	 * points to a struct btrfs_device.
+	 */
+	bool is_block_group;
+	/*
+	 * Only used when 'is_block_group' is true and it is the number of
+	 * extents used by a swapfile for this block group ('ptr' field).
+	 */
+	int bg_extent_count;
+};
+
 /*
  * If we read those variants at the context of their own lock, we needn't
  * use the following helpers, reading them directly is safe.
-- 
2.26.3


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

* [PATCH 08/15] btrfs: move fs_info struct declarations to the top of ctree.h
  2022-09-14 23:04 [PATCH 00/15] btrfs: strip out btrfs_fs_info dependencies Josef Bacik
                   ` (6 preceding siblings ...)
  2022-09-14 23:04 ` [PATCH 07/15] btrfs: move btrfs_swapfile_pin into volumes.h Josef Bacik
@ 2022-09-14 23:04 ` Josef Bacik
  2022-09-15 10:45   ` Anand Jain
  2022-09-15 14:47   ` Johannes Thumshirn
  2022-09-14 23:04 ` [PATCH 09/15] btrfs: move btrfs_csum_ptr to inode.c Josef Bacik
                   ` (7 subsequent siblings)
  15 siblings, 2 replies; 49+ messages in thread
From: Josef Bacik @ 2022-09-14 23:04 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

In order to make it more straightforward to move the fs_info struct and
it's related structures, move the struct declarations to the top of
ctree.h.  This will make it easier to clean up after the fact.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/ctree.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index b9e848a22290..05eb0e994e68 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -46,6 +46,13 @@ struct btrfs_ref;
 struct btrfs_bio;
 struct btrfs_ioctl_encoded_io_args;
 
+/* fs_info */
+struct reloc_control;
+struct btrfs_device;
+struct btrfs_fs_devices;
+struct btrfs_balance_control;
+struct btrfs_delayed_root;
+
 #define BTRFS_OLDEST_GENERATION	0ULL
 
 #define BTRFS_EMPTY_DIR_SIZE 0
@@ -208,13 +215,6 @@ struct btrfs_discard_ctl {
 	atomic64_t discard_bytes_saved;
 };
 
-/* fs_info */
-struct reloc_control;
-struct btrfs_device;
-struct btrfs_fs_devices;
-struct btrfs_balance_control;
-struct btrfs_delayed_root;
-
 /*
  * Exclusive operations (device replace, resize, device add/remove, balance)
  */
-- 
2.26.3


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

* [PATCH 09/15] btrfs: move btrfs_csum_ptr to inode.c
  2022-09-14 23:04 [PATCH 00/15] btrfs: strip out btrfs_fs_info dependencies Josef Bacik
                   ` (7 preceding siblings ...)
  2022-09-14 23:04 ` [PATCH 08/15] btrfs: move fs_info struct declarations to the top of ctree.h Josef Bacik
@ 2022-09-14 23:04 ` Josef Bacik
  2022-09-15 10:47   ` Anand Jain
  2022-09-15 14:47   ` Johannes Thumshirn
  2022-09-14 23:04 ` [PATCH 10/15] btrfs: move the fs_info related helpers closer to fs_info in ctree.h Josef Bacik
                   ` (6 subsequent siblings)
  15 siblings, 2 replies; 49+ messages in thread
From: Josef Bacik @ 2022-09-14 23:04 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

This helper is only used in inode.c, move it locally to that file
instead of defining it in ctree.h.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/ctree.h | 8 --------
 fs/btrfs/inode.c | 8 ++++++++
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 05eb0e994e68..0da52e8b78e9 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -1173,14 +1173,6 @@ int btrfs_get_extent_inline_ref_type(const struct extent_buffer *eb,
 				     enum btrfs_inline_ref_type is_data);
 u64 hash_extent_data_ref(u64 root_objectid, u64 owner, u64 offset);
 
-static inline u8 *btrfs_csum_ptr(const struct btrfs_fs_info *fs_info, u8 *csums,
-				 u64 offset)
-{
-	u64 offset_in_sectors = offset >> fs_info->sectorsize_bits;
-
-	return csums + offset_in_sectors * fs_info->csum_size;
-}
-
 /*
  * Take the number of bytes to be checksummed and figure out how many leaves
  * it would require to store the csums for that many bytes.
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index ca6fa9b01785..62dc3dcf835b 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -3459,6 +3459,14 @@ int btrfs_check_sector_csum(struct btrfs_fs_info *fs_info, struct page *page,
 	return 0;
 }
 
+static inline u8 *btrfs_csum_ptr(const struct btrfs_fs_info *fs_info, u8 *csums,
+				 u64 offset)
+{
+	u64 offset_in_sectors = offset >> fs_info->sectorsize_bits;
+
+	return csums + offset_in_sectors * fs_info->csum_size;
+}
+
 /*
  * check_data_csum - verify checksum of one sector of uncompressed data
  * @inode:	inode
-- 
2.26.3


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

* [PATCH 10/15] btrfs: move the fs_info related helpers closer to fs_info in ctree.h
  2022-09-14 23:04 [PATCH 00/15] btrfs: strip out btrfs_fs_info dependencies Josef Bacik
                   ` (8 preceding siblings ...)
  2022-09-14 23:04 ` [PATCH 09/15] btrfs: move btrfs_csum_ptr to inode.c Josef Bacik
@ 2022-09-14 23:04 ` Josef Bacik
  2022-09-15 11:28   ` Anand Jain
  2022-09-15 14:50   ` Johannes Thumshirn
  2022-09-14 23:04 ` [PATCH 11/15] btrfs: move btrfs_ordered_sum_size into file-item.c Josef Bacik
                   ` (5 subsequent siblings)
  15 siblings, 2 replies; 49+ messages in thread
From: Josef Bacik @ 2022-09-14 23:04 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

This is purely cosmetic, to make it straightforward to copy and paste
the definition and helpers from ctree.h into fs.h.  These are helpers
that act directly on the fs_info, and were scattered throughout ctree.h.
Move them directly below the fs_info definition to make it easier to
move them later.  This includes the exclop prototypes, which shares an
enum that's used in struct btrfs_fs_info as well.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/ctree.h | 187 ++++++++++++++++++++++++-----------------------
 1 file changed, 94 insertions(+), 93 deletions(-)

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 0da52e8b78e9..57d53ec3cdd0 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -126,8 +126,7 @@ struct btrfs_path {
 	 */
 	unsigned int search_for_extension:1;
 };
-#define BTRFS_MAX_EXTENT_ITEM_SIZE(r) ((BTRFS_LEAF_DATA_SIZE(r->fs_info) >> 4) - \
-					sizeof(struct btrfs_item))
+
 struct btrfs_dev_replace {
 	u64 replace_state;	/* see #define above */
 	time64_t time_started;	/* seconds since 1-Jan-1970 */
@@ -705,6 +704,99 @@ static inline struct btrfs_fs_info *btrfs_sb(struct super_block *sb)
 	return sb->s_fs_info;
 }
 
+/*
+ * Take the number of bytes to be checksummed and figure out how many leaves
+ * it would require to store the csums for that many bytes.
+ */
+static inline u64 btrfs_csum_bytes_to_leaves(
+			const struct btrfs_fs_info *fs_info, u64 csum_bytes)
+{
+	const u64 num_csums = csum_bytes >> fs_info->sectorsize_bits;
+
+	return DIV_ROUND_UP_ULL(num_csums, fs_info->csums_per_leaf);
+}
+
+/*
+ * Use this if we would be adding new items, as we could split nodes as we cow
+ * down the tree.
+ */
+static inline u64 btrfs_calc_insert_metadata_size(struct btrfs_fs_info *fs_info,
+						  unsigned num_items)
+{
+	return (u64)fs_info->nodesize * BTRFS_MAX_LEVEL * 2 * num_items;
+}
+
+/*
+ * Doing a truncate or a modification won't result in new nodes or leaves, just
+ * what we need for COW.
+ */
+static inline u64 btrfs_calc_metadata_size(struct btrfs_fs_info *fs_info,
+						 unsigned num_items)
+{
+	return (u64)fs_info->nodesize * BTRFS_MAX_LEVEL * num_items;
+}
+
+static inline u32 BTRFS_LEAF_DATA_SIZE(const struct btrfs_fs_info *info)
+{
+	return info->nodesize - sizeof(struct btrfs_header);
+}
+
+static inline u32 BTRFS_MAX_ITEM_SIZE(const struct btrfs_fs_info *info)
+{
+	return BTRFS_LEAF_DATA_SIZE(info) - sizeof(struct btrfs_item);
+}
+
+static inline u32 BTRFS_NODEPTRS_PER_BLOCK(const struct btrfs_fs_info *info)
+{
+	return BTRFS_LEAF_DATA_SIZE(info) / sizeof(struct btrfs_key_ptr);
+}
+
+#define BTRFS_FILE_EXTENT_INLINE_DATA_START		\
+		(offsetof(struct btrfs_file_extent_item, disk_bytenr))
+static inline u32 BTRFS_MAX_INLINE_DATA_SIZE(const struct btrfs_fs_info *info)
+{
+	return BTRFS_MAX_ITEM_SIZE(info) -
+	       BTRFS_FILE_EXTENT_INLINE_DATA_START;
+}
+
+static inline u32 BTRFS_MAX_XATTR_SIZE(const struct btrfs_fs_info *info)
+{
+	return BTRFS_MAX_ITEM_SIZE(info) - sizeof(struct btrfs_dir_item);
+}
+
+#define BTRFS_BYTES_TO_BLKS(fs_info, bytes) \
+				((bytes) >> (fs_info)->sectorsize_bits)
+
+#define BTRFS_MAX_EXTENT_ITEM_SIZE(r) ((BTRFS_LEAF_DATA_SIZE(r->fs_info) >> 4) - \
+					sizeof(struct btrfs_item))
+
+static inline bool btrfs_is_zoned(const struct btrfs_fs_info *fs_info)
+{
+	return fs_info->zone_size > 0;
+}
+
+/*
+ * Count how many fs_info->max_extent_size cover the @size
+ */
+static inline u32 count_max_extents(struct btrfs_fs_info *fs_info, u64 size)
+{
+#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
+	if (!fs_info)
+		return div_u64(size + BTRFS_MAX_EXTENT_SIZE - 1, BTRFS_MAX_EXTENT_SIZE);
+#endif
+
+	return div_u64(size + fs_info->max_extent_size - 1, fs_info->max_extent_size);
+}
+
+bool btrfs_exclop_start(struct btrfs_fs_info *fs_info,
+			enum btrfs_exclusive_operation type);
+bool btrfs_exclop_start_try_lock(struct btrfs_fs_info *fs_info,
+				 enum btrfs_exclusive_operation type);
+void btrfs_exclop_start_unlock(struct btrfs_fs_info *fs_info);
+void btrfs_exclop_finish(struct btrfs_fs_info *fs_info);
+void btrfs_exclop_balance(struct btrfs_fs_info *fs_info,
+			  enum btrfs_exclusive_operation op);
+
 /*
  * The state of btrfs root
  */
@@ -1097,39 +1189,6 @@ struct btrfs_file_private {
 	void *filldir_buf;
 };
 
-
-static inline u32 BTRFS_LEAF_DATA_SIZE(const struct btrfs_fs_info *info)
-{
-
-	return info->nodesize - sizeof(struct btrfs_header);
-}
-
-static inline u32 BTRFS_MAX_ITEM_SIZE(const struct btrfs_fs_info *info)
-{
-	return BTRFS_LEAF_DATA_SIZE(info) - sizeof(struct btrfs_item);
-}
-
-static inline u32 BTRFS_NODEPTRS_PER_BLOCK(const struct btrfs_fs_info *info)
-{
-	return BTRFS_LEAF_DATA_SIZE(info) / sizeof(struct btrfs_key_ptr);
-}
-
-#define BTRFS_FILE_EXTENT_INLINE_DATA_START		\
-		(offsetof(struct btrfs_file_extent_item, disk_bytenr))
-static inline u32 BTRFS_MAX_INLINE_DATA_SIZE(const struct btrfs_fs_info *info)
-{
-	return BTRFS_MAX_ITEM_SIZE(info) -
-	       BTRFS_FILE_EXTENT_INLINE_DATA_START;
-}
-
-static inline u32 BTRFS_MAX_XATTR_SIZE(const struct btrfs_fs_info *info)
-{
-	return BTRFS_MAX_ITEM_SIZE(info) - sizeof(struct btrfs_dir_item);
-}
-
-#define BTRFS_BYTES_TO_BLKS(fs_info, bytes) \
-				((bytes) >> (fs_info)->sectorsize_bits)
-
 static inline u32 btrfs_crc32c(u32 crc, const void *address, unsigned length)
 {
 	return crc32c(crc, address, length);
@@ -1173,37 +1232,6 @@ int btrfs_get_extent_inline_ref_type(const struct extent_buffer *eb,
 				     enum btrfs_inline_ref_type is_data);
 u64 hash_extent_data_ref(u64 root_objectid, u64 owner, u64 offset);
 
-/*
- * Take the number of bytes to be checksummed and figure out how many leaves
- * it would require to store the csums for that many bytes.
- */
-static inline u64 btrfs_csum_bytes_to_leaves(
-			const struct btrfs_fs_info *fs_info, u64 csum_bytes)
-{
-	const u64 num_csums = csum_bytes >> fs_info->sectorsize_bits;
-
-	return DIV_ROUND_UP_ULL(num_csums, fs_info->csums_per_leaf);
-}
-
-/*
- * Use this if we would be adding new items, as we could split nodes as we cow
- * down the tree.
- */
-static inline u64 btrfs_calc_insert_metadata_size(struct btrfs_fs_info *fs_info,
-						  unsigned num_items)
-{
-	return (u64)fs_info->nodesize * BTRFS_MAX_LEVEL * 2 * num_items;
-}
-
-/*
- * Doing a truncate or a modification won't result in new nodes or leaves, just
- * what we need for COW.
- */
-static inline u64 btrfs_calc_metadata_size(struct btrfs_fs_info *fs_info,
-						 unsigned num_items)
-{
-	return (u64)fs_info->nodesize * BTRFS_MAX_LEVEL * num_items;
-}
 
 int btrfs_add_excluded_extent(struct btrfs_fs_info *fs_info,
 			      u64 start, u64 num_bytes);
@@ -1737,15 +1765,6 @@ void btrfs_get_block_group_info(struct list_head *groups_list,
 				struct btrfs_ioctl_space_info *space);
 void btrfs_update_ioctl_balance_args(struct btrfs_fs_info *fs_info,
 			       struct btrfs_ioctl_balance_args *bargs);
-bool btrfs_exclop_start(struct btrfs_fs_info *fs_info,
-			enum btrfs_exclusive_operation type);
-bool btrfs_exclop_start_try_lock(struct btrfs_fs_info *fs_info,
-				 enum btrfs_exclusive_operation type);
-void btrfs_exclop_start_unlock(struct btrfs_fs_info *fs_info);
-void btrfs_exclop_finish(struct btrfs_fs_info *fs_info);
-void btrfs_exclop_balance(struct btrfs_fs_info *fs_info,
-			  enum btrfs_exclusive_operation op);
-
 
 /* file.c */
 int __init btrfs_auto_defrag_init(void);
@@ -1943,24 +1962,6 @@ static inline int btrfs_get_verity_descriptor(struct inode *inode, void *buf,
 void btrfs_test_destroy_inode(struct inode *inode);
 #endif
 
-static inline bool btrfs_is_zoned(const struct btrfs_fs_info *fs_info)
-{
-	return fs_info->zone_size > 0;
-}
-
-/*
- * Count how many fs_info->max_extent_size cover the @size
- */
-static inline u32 count_max_extents(struct btrfs_fs_info *fs_info, u64 size)
-{
-#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
-	if (!fs_info)
-		return div_u64(size + BTRFS_MAX_EXTENT_SIZE - 1, BTRFS_MAX_EXTENT_SIZE);
-#endif
-
-	return div_u64(size + fs_info->max_extent_size - 1, fs_info->max_extent_size);
-}
-
 static inline bool btrfs_is_data_reloc_root(const struct btrfs_root *root)
 {
 	return root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID;
-- 
2.26.3


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

* [PATCH 11/15] btrfs: move btrfs_ordered_sum_size into file-item.c
  2022-09-14 23:04 [PATCH 00/15] btrfs: strip out btrfs_fs_info dependencies Josef Bacik
                   ` (9 preceding siblings ...)
  2022-09-14 23:04 ` [PATCH 10/15] btrfs: move the fs_info related helpers closer to fs_info in ctree.h Josef Bacik
@ 2022-09-14 23:04 ` Josef Bacik
  2022-09-15 11:29   ` Anand Jain
  2022-09-15 14:50   ` Johannes Thumshirn
  2022-09-14 23:04 ` [PATCH 12/15] btrfs: delete btrfs_inode_sectorsize helper Josef Bacik
                   ` (4 subsequent siblings)
  15 siblings, 2 replies; 49+ messages in thread
From: Josef Bacik @ 2022-09-14 23:04 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

This is defined in ordered-data.h, but is only used in file-item.c.
Move this to file-item.c as it doesn't need to be global.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/file-item.c    | 12 ++++++++++++
 fs/btrfs/ordered-data.h | 12 ------------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
index 7bd6e1b91495..615e65b15463 100644
--- a/fs/btrfs/file-item.c
+++ b/fs/btrfs/file-item.c
@@ -132,6 +132,18 @@ static inline u32 max_ordered_sum_bytes(struct btrfs_fs_info *fs_info,
 	return ncsums * fs_info->sectorsize;
 }
 
+/*
+ * calculates the total size you need to allocate for an ordered sum
+ * structure spanning 'bytes' in the file
+ */
+static inline int btrfs_ordered_sum_size(struct btrfs_fs_info *fs_info,
+					 unsigned long bytes)
+{
+	int num_sectors = (int)DIV_ROUND_UP(bytes, fs_info->sectorsize);
+
+	return sizeof(struct btrfs_ordered_sum) + num_sectors * fs_info->csum_size;
+}
+
 int btrfs_insert_hole_extent(struct btrfs_trans_handle *trans,
 			     struct btrfs_root *root,
 			     u64 objectid, u64 pos, u64 num_bytes)
diff --git a/fs/btrfs/ordered-data.h b/fs/btrfs/ordered-data.h
index 87792f85e2c4..ac6b8ef133aa 100644
--- a/fs/btrfs/ordered-data.h
+++ b/fs/btrfs/ordered-data.h
@@ -160,18 +160,6 @@ struct btrfs_ordered_extent {
 	struct block_device *bdev;
 };
 
-/*
- * calculates the total size you need to allocate for an ordered sum
- * structure spanning 'bytes' in the file
- */
-static inline int btrfs_ordered_sum_size(struct btrfs_fs_info *fs_info,
-					 unsigned long bytes)
-{
-	int num_sectors = (int)DIV_ROUND_UP(bytes, fs_info->sectorsize);
-
-	return sizeof(struct btrfs_ordered_sum) + num_sectors * fs_info->csum_size;
-}
-
 static inline void
 btrfs_ordered_inode_tree_init(struct btrfs_ordered_inode_tree *t)
 {
-- 
2.26.3


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

* [PATCH 12/15] btrfs: delete btrfs_inode_sectorsize helper
  2022-09-14 23:04 [PATCH 00/15] btrfs: strip out btrfs_fs_info dependencies Josef Bacik
                   ` (10 preceding siblings ...)
  2022-09-14 23:04 ` [PATCH 11/15] btrfs: move btrfs_ordered_sum_size into file-item.c Josef Bacik
@ 2022-09-14 23:04 ` Josef Bacik
  2022-09-15 11:39   ` Anand Jain
  2022-09-15 14:51   ` Johannes Thumshirn
  2022-09-14 23:04 ` [PATCH 13/15] btrfs: delete btrfs_insert_inode_hash helper Josef Bacik
                   ` (3 subsequent siblings)
  15 siblings, 2 replies; 49+ messages in thread
From: Josef Bacik @ 2022-09-14 23:04 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

This is defined in btrfs_inode.h, and dereferences btrfs_root and
btrfs_fs_info, both of which aren't defined in btrfs_inode.h.
Additionally, in many places we already have root or fs_info, so this
helper often makes the code harder to read.  So delete the helper and
simply open code it in the few places that we use it.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/btrfs_inode.h |  5 -----
 fs/btrfs/extent_io.c   |  4 ++--
 fs/btrfs/file.c        | 11 +++++------
 3 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h
index 890c9f979a3d..b24f78145fa6 100644
--- a/fs/btrfs/btrfs_inode.h
+++ b/fs/btrfs/btrfs_inode.h
@@ -251,11 +251,6 @@ struct btrfs_inode {
 	struct inode vfs_inode;
 };
 
-static inline u32 btrfs_inode_sectorsize(const struct btrfs_inode *inode)
-{
-	return inode->root->fs_info->sectorsize;
-}
-
 static inline struct btrfs_inode *BTRFS_I(const struct inode *inode)
 {
 	return container_of(inode, struct btrfs_inode, vfs_inode);
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index b1d57727be02..f5eb6c66911c 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -3925,8 +3925,8 @@ int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo,
 		goto out;
 	}
 
-	lockstart = round_down(start, btrfs_inode_sectorsize(inode));
-	lockend = round_up(start + len, btrfs_inode_sectorsize(inode));
+	lockstart = round_down(start, root->fs_info->sectorsize);
+	lockend = round_up(start + len, root->fs_info->sectorsize);
 	prev_extent_end = lockstart;
 
 	lock_extent(&inode->io_tree, lockstart, lockend, &cached_state);
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index c395bf8e7522..c418468428ad 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -3010,9 +3010,8 @@ static int btrfs_punch_hole(struct file *file, loff_t offset, loff_t len)
 	if (ret)
 		goto out_only_mutex;
 
-	lockstart = round_up(offset, btrfs_inode_sectorsize(BTRFS_I(inode)));
-	lockend = round_down(offset + len,
-			     btrfs_inode_sectorsize(BTRFS_I(inode))) - 1;
+	lockstart = round_up(offset, fs_info->sectorsize);
+	lockend = round_down(offset + len, fs_info->sectorsize) - 1;
 	same_block = (BTRFS_BYTES_TO_BLKS(fs_info, offset))
 		== (BTRFS_BYTES_TO_BLKS(fs_info, offset + len - 1));
 	/*
@@ -3214,7 +3213,7 @@ enum {
 static int btrfs_zero_range_check_range_boundary(struct btrfs_inode *inode,
 						 u64 offset)
 {
-	const u64 sectorsize = btrfs_inode_sectorsize(inode);
+	const u64 sectorsize = inode->root->fs_info->sectorsize;
 	struct extent_map *em;
 	int ret;
 
@@ -3244,7 +3243,7 @@ static int btrfs_zero_range(struct inode *inode,
 	struct extent_changeset *data_reserved = NULL;
 	int ret;
 	u64 alloc_hint = 0;
-	const u64 sectorsize = btrfs_inode_sectorsize(BTRFS_I(inode));
+	const u64 sectorsize = fs_info->sectorsize;
 	u64 alloc_start = round_down(offset, sectorsize);
 	u64 alloc_end = round_up(offset + len, sectorsize);
 	u64 bytes_to_reserve = 0;
@@ -3430,7 +3429,7 @@ static long btrfs_fallocate(struct file *file, int mode,
 	u64 data_space_reserved = 0;
 	u64 qgroup_reserved = 0;
 	struct extent_map *em;
-	int blocksize = btrfs_inode_sectorsize(BTRFS_I(inode));
+	int blocksize = BTRFS_I(inode)->root->fs_info->sectorsize;
 	int ret;
 
 	/* Do not allow fallocate in ZONED mode */
-- 
2.26.3


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

* [PATCH 13/15] btrfs: delete btrfs_insert_inode_hash helper
  2022-09-14 23:04 [PATCH 00/15] btrfs: strip out btrfs_fs_info dependencies Josef Bacik
                   ` (11 preceding siblings ...)
  2022-09-14 23:04 ` [PATCH 12/15] btrfs: delete btrfs_inode_sectorsize helper Josef Bacik
@ 2022-09-14 23:04 ` Josef Bacik
  2022-09-15 12:43   ` Anand Jain
  2022-09-15 14:52   ` Johannes Thumshirn
  2022-09-14 23:04 ` [PATCH 14/15] btrfs: use a runtime flag to indicate an inode is a free space inode Josef Bacik
                   ` (2 subsequent siblings)
  15 siblings, 2 replies; 49+ messages in thread
From: Josef Bacik @ 2022-09-14 23:04 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

This exists to insert the btree_inode in the super blocks inode hash
table.  Since it's only used for the btree inode move the code to where
we use it in disk-io.c and remove the helper.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/btrfs_inode.h | 7 -------
 fs/btrfs/disk-io.c     | 4 +++-
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h
index b24f78145fa6..44edc6a3db6b 100644
--- a/fs/btrfs/btrfs_inode.h
+++ b/fs/btrfs/btrfs_inode.h
@@ -268,13 +268,6 @@ static inline unsigned long btrfs_inode_hash(u64 objectid,
 	return (unsigned long)h;
 }
 
-static inline void btrfs_insert_inode_hash(struct inode *inode)
-{
-	unsigned long h = btrfs_inode_hash(inode->i_ino, BTRFS_I(inode)->root);
-
-	__insert_inode_hash(inode, h);
-}
-
 #if BITS_PER_LONG == 32
 
 /*
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 124c210c4e02..0f925b896fca 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -2227,6 +2227,8 @@ static void btrfs_init_balance(struct btrfs_fs_info *fs_info)
 static void btrfs_init_btree_inode(struct btrfs_fs_info *fs_info)
 {
 	struct inode *inode = fs_info->btree_inode;
+	unsigned long hash = btrfs_inode_hash(BTRFS_BTREE_INODE_OBJECTID,
+					      fs_info->tree_root);
 
 	inode->i_ino = BTRFS_BTREE_INODE_OBJECTID;
 	set_nlink(inode, 1);
@@ -2248,7 +2250,7 @@ static void btrfs_init_btree_inode(struct btrfs_fs_info *fs_info)
 	BTRFS_I(inode)->location.type = 0;
 	BTRFS_I(inode)->location.offset = 0;
 	set_bit(BTRFS_INODE_DUMMY, &BTRFS_I(inode)->runtime_flags);
-	btrfs_insert_inode_hash(inode);
+	__insert_inode_hash(inode, hash);
 }
 
 static void btrfs_init_dev_replace_locks(struct btrfs_fs_info *fs_info)
-- 
2.26.3


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

* [PATCH 14/15] btrfs: use a runtime flag to indicate an inode is a free space inode
  2022-09-14 23:04 [PATCH 00/15] btrfs: strip out btrfs_fs_info dependencies Josef Bacik
                   ` (12 preceding siblings ...)
  2022-09-14 23:04 ` [PATCH 13/15] btrfs: delete btrfs_insert_inode_hash helper Josef Bacik
@ 2022-09-14 23:04 ` Josef Bacik
  2022-09-15 13:01   ` Anand Jain
  2022-09-15 14:53   ` Johannes Thumshirn
  2022-09-14 23:04 ` [PATCH 15/15] btrfs: add struct declarations in dev-replace.h Josef Bacik
  2022-09-20 11:44 ` [PATCH 00/15] btrfs: strip out btrfs_fs_info dependencies David Sterba
  15 siblings, 2 replies; 49+ messages in thread
From: Josef Bacik @ 2022-09-14 23:04 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

We always check the root of an inode as well as it's inode number to
determine if it's a free space inode.  This is problematic as the helper
is in a header file where it doesn't have the fs_info definition.  To
avoid this and make the check a little cleaner simply add a flag to the
runtime_flags to indicate that the inode is a free space inode, set that
when we create the inode, and then change the helper to check for this
flag.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/btrfs_inode.h | 10 +++-------
 fs/btrfs/inode.c       |  5 +++++
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h
index 44edc6a3db6b..530a0ebfab3f 100644
--- a/fs/btrfs/btrfs_inode.h
+++ b/fs/btrfs/btrfs_inode.h
@@ -65,6 +65,8 @@ enum {
 	 * on the same file.
 	 */
 	BTRFS_INODE_VERITY_IN_PROGRESS,
+	/* Set when this inode is a free space inode. */
+	BTRFS_INODE_FREE_SPACE_INODE,
 };
 
 /* in memory btrfs inode */
@@ -301,13 +303,7 @@ static inline void btrfs_i_size_write(struct btrfs_inode *inode, u64 size)
 
 static inline bool btrfs_is_free_space_inode(struct btrfs_inode *inode)
 {
-	struct btrfs_root *root = inode->root;
-
-	if (root == root->fs_info->tree_root &&
-	    btrfs_ino(inode) != BTRFS_BTREE_INODE_OBJECTID)
-		return true;
-
-	return false;
+	return test_bit(BTRFS_INODE_FREE_SPACE_INODE, &inode->runtime_flags);
 }
 
 static inline bool is_data_inode(struct inode *inode)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 62dc3dcf835b..1f38d9b98132 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -5731,6 +5731,11 @@ static int btrfs_init_locked_inode(struct inode *inode, void *p)
 	BTRFS_I(inode)->location.offset = 0;
 	BTRFS_I(inode)->root = btrfs_grab_root(args->root);
 	BUG_ON(args->root && !BTRFS_I(inode)->root);
+
+	if (args->root && args->root == args->root->fs_info->tree_root &&
+	    args->ino != BTRFS_BTREE_INODE_OBJECTID)
+		set_bit(BTRFS_INODE_FREE_SPACE_INODE,
+			&BTRFS_I(inode)->runtime_flags);
 	return 0;
 }
 
-- 
2.26.3


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

* [PATCH 15/15] btrfs: add struct declarations in dev-replace.h
  2022-09-14 23:04 [PATCH 00/15] btrfs: strip out btrfs_fs_info dependencies Josef Bacik
                   ` (13 preceding siblings ...)
  2022-09-14 23:04 ` [PATCH 14/15] btrfs: use a runtime flag to indicate an inode is a free space inode Josef Bacik
@ 2022-09-14 23:04 ` Josef Bacik
  2022-09-15 13:06   ` Anand Jain
  2022-09-15 14:54   ` Johannes Thumshirn
  2022-09-20 11:44 ` [PATCH 00/15] btrfs: strip out btrfs_fs_info dependencies David Sterba
  15 siblings, 2 replies; 49+ messages in thread
From: Josef Bacik @ 2022-09-14 23:04 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

dev-replace.h just has function prototypes for device replace, however
if you happen to include it in the wrong order you'll get compile errors
because of different structures not being defined.  Since these are just
pointer args to functions we can declare them at the top in order to
reduce the pain of using the header.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/dev-replace.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/btrfs/dev-replace.h b/fs/btrfs/dev-replace.h
index 3911049a5f23..6084b313056a 100644
--- a/fs/btrfs/dev-replace.h
+++ b/fs/btrfs/dev-replace.h
@@ -7,6 +7,10 @@
 #define BTRFS_DEV_REPLACE_H
 
 struct btrfs_ioctl_dev_replace_args;
+struct btrfs_fs_info;
+struct btrfs_trans_handle;
+struct btrfs_dev_replace;
+struct btrfs_block_group;
 
 int btrfs_init_dev_replace(struct btrfs_fs_info *fs_info);
 int btrfs_run_dev_replace(struct btrfs_trans_handle *trans);
-- 
2.26.3


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

* Re: [PATCH 01/15] btrfs: move btrfs_caching_type to block-group.h
  2022-09-14 23:04 ` [PATCH 01/15] btrfs: move btrfs_caching_type to block-group.h Josef Bacik
@ 2022-09-15  6:09   ` Anand Jain
  2022-09-15 14:34   ` Johannes Thumshirn
  1 sibling, 0 replies; 49+ messages in thread
From: Anand Jain @ 2022-09-15  6:09 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

On 15/09/2022 07:04, Josef Bacik wrote:
> This is a block group related definition, move it into block-group.h.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Reviewed-by: Anand Jain <anand.jain@oracle.com>


> ---
>   fs/btrfs/block-group.h | 7 +++++++
>   fs/btrfs/ctree.h       | 7 -------
>   2 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/fs/btrfs/block-group.h b/fs/btrfs/block-group.h
> index e34cb80ffb25..558fa0a21fb4 100644
> --- a/fs/btrfs/block-group.h
> +++ b/fs/btrfs/block-group.h
> @@ -57,6 +57,13 @@ enum btrfs_block_group_flags {
>   	BLOCK_GROUP_FLAG_ZONED_DATA_RELOC,
>   };
>   
> +enum btrfs_caching_type {
> +	BTRFS_CACHE_NO,
> +	BTRFS_CACHE_STARTED,
> +	BTRFS_CACHE_FINISHED,
> +	BTRFS_CACHE_ERROR,
> +};
> +
>   struct btrfs_caching_control {
>   	struct list_head list;
>   	struct mutex mutex;
> diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
> index 8271b3dccf16..725c187d5c4b 100644
> --- a/fs/btrfs/ctree.h
> +++ b/fs/btrfs/ctree.h
> @@ -180,13 +180,6 @@ struct btrfs_free_cluster {
>   	struct list_head block_group_list;
>   };
>   
> -enum btrfs_caching_type {
> -	BTRFS_CACHE_NO,
> -	BTRFS_CACHE_STARTED,
> -	BTRFS_CACHE_FINISHED,
> -	BTRFS_CACHE_ERROR,
> -};
> -
>   /*
>    * Tree to record all locked full stripes of a RAID5/6 block group
>    */


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

* Re: [PATCH 02/15] btrfs: move btrfs_full_stripe_locks_tree into block-group.h
  2022-09-14 23:04 ` [PATCH 02/15] btrfs: move btrfs_full_stripe_locks_tree into block-group.h Josef Bacik
@ 2022-09-15  6:10   ` Anand Jain
  2022-09-15 14:38   ` Johannes Thumshirn
  1 sibling, 0 replies; 49+ messages in thread
From: Anand Jain @ 2022-09-15  6:10 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

On 15/09/2022 07:04, Josef Bacik wrote:
> This is actually embedded in struct btrfs_block_group, so move this
> definition to block-group.h, and then open-code the init of the tree
> where we init the rest of the block group instead of using a helper.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Reviewed-by: Anand Jain <anand.jain@oracle.com>

> ---
>   fs/btrfs/block-group.c |  3 ++-
>   fs/btrfs/block-group.h |  8 ++++++++
>   fs/btrfs/ctree.h       | 14 --------------
>   3 files changed, 10 insertions(+), 15 deletions(-)
> 
> diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
> index 20da92ae5c6b..e21382a13fe4 100644
> --- a/fs/btrfs/block-group.c
> +++ b/fs/btrfs/block-group.c
> @@ -1940,7 +1940,8 @@ static struct btrfs_block_group *btrfs_create_block_group_cache(
>   	btrfs_init_free_space_ctl(cache, cache->free_space_ctl);
>   	atomic_set(&cache->frozen, 0);
>   	mutex_init(&cache->free_space_lock);
> -	btrfs_init_full_stripe_locks_tree(&cache->full_stripe_locks_root);
> +	cache->full_stripe_locks_root.root = RB_ROOT;
> +	mutex_init(&cache->full_stripe_locks_root.lock);
>   
>   	return cache;
>   }
> diff --git a/fs/btrfs/block-group.h b/fs/btrfs/block-group.h
> index 558fa0a21fb4..6c970a486b68 100644
> --- a/fs/btrfs/block-group.h
> +++ b/fs/btrfs/block-group.h
> @@ -76,6 +76,14 @@ struct btrfs_caching_control {
>   /* Once caching_thread() finds this much free space, it will wake up waiters. */
>   #define CACHING_CTL_WAKE_UP SZ_2M
>   
> +/*
> + * Tree to record all locked full stripes of a RAID5/6 block group
> + */
> +struct btrfs_full_stripe_locks_tree {
> +	struct rb_root root;
> +	struct mutex lock;
> +};
> +
>   struct btrfs_block_group {
>   	struct btrfs_fs_info *fs_info;
>   	struct inode *inode;
> diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
> index 725c187d5c4b..12d626e78182 100644
> --- a/fs/btrfs/ctree.h
> +++ b/fs/btrfs/ctree.h
> @@ -180,14 +180,6 @@ struct btrfs_free_cluster {
>   	struct list_head block_group_list;
>   };
>   
> -/*
> - * Tree to record all locked full stripes of a RAID5/6 block group
> - */
> -struct btrfs_full_stripe_locks_tree {
> -	struct rb_root root;
> -	struct mutex lock;
> -};
> -
>   /* Discard control. */
>   /*
>    * Async discard uses multiple lists to differentiate the discard filter
> @@ -1944,12 +1936,6 @@ int btrfs_scrub_cancel(struct btrfs_fs_info *info);
>   int btrfs_scrub_cancel_dev(struct btrfs_device *dev);
>   int btrfs_scrub_progress(struct btrfs_fs_info *fs_info, u64 devid,
>   			 struct btrfs_scrub_progress *progress);
> -static inline void btrfs_init_full_stripe_locks_tree(
> -			struct btrfs_full_stripe_locks_tree *locks_root)
> -{
> -	locks_root->root = RB_ROOT;
> -	mutex_init(&locks_root->lock);
> -}
>   
>   /* dev-replace.c */
>   void btrfs_bio_counter_inc_blocked(struct btrfs_fs_info *fs_info);


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

* Re: [PATCH 03/15] btrfs: move btrfs_init_async_reclaim_work prototype to space-info.h
  2022-09-14 23:04 ` [PATCH 03/15] btrfs: move btrfs_init_async_reclaim_work prototype to space-info.h Josef Bacik
@ 2022-09-15  6:11   ` Anand Jain
  2022-09-15 14:42   ` Johannes Thumshirn
  1 sibling, 0 replies; 49+ messages in thread
From: Anand Jain @ 2022-09-15  6:11 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

On 15/09/2022 07:04, Josef Bacik wrote:
> The code for this helper is in space-info.c, move the prototype to
> space-info.h.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Reviewed-by: Anand Jain <anand.jain@oracle.com>

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

* Re: [PATCH 04/15] btrfs: move btrfs_pinned_by_swapfile prototype into volumes.h
  2022-09-14 23:04 ` [PATCH 04/15] btrfs: move btrfs_pinned_by_swapfile prototype into volumes.h Josef Bacik
@ 2022-09-15 10:37   ` Anand Jain
  2022-09-15 14:43   ` Johannes Thumshirn
  1 sibling, 0 replies; 49+ messages in thread
From: Anand Jain @ 2022-09-15 10:37 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

On 15/09/2022 07:04, Josef Bacik wrote:
> This is defined in volumes.c, move the prototype into volumes.h.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Reviewed-by: Anand Jain <anand.jain@oracle.com>

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

* Re: [PATCH 05/15] btrfs: remove temporary btrfs_map_token declaration in ctree.h
  2022-09-14 23:04 ` [PATCH 05/15] btrfs: remove temporary btrfs_map_token declaration in ctree.h Josef Bacik
@ 2022-09-15 10:38   ` Anand Jain
  2022-09-15 14:44   ` Johannes Thumshirn
  2022-09-20 12:21   ` David Sterba
  2 siblings, 0 replies; 49+ messages in thread
From: Anand Jain @ 2022-09-15 10:38 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

On 15/09/2022 07:04, Josef Bacik wrote:
> This was added while I was moving this code to its new home, it can be
> removed now.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Reviewed-by: Anand Jain <anand.jain@oracle.com>

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

* Re: [PATCH 06/15] btrfs: move static_assert() for btrfs_super_block into fs.c
  2022-09-14 23:04 ` [PATCH 06/15] btrfs: move static_assert() for btrfs_super_block into fs.c Josef Bacik
@ 2022-09-15 10:42   ` Anand Jain
  2022-09-15 14:45   ` Johannes Thumshirn
  2022-09-19 20:54   ` David Sterba
  2 siblings, 0 replies; 49+ messages in thread
From: Anand Jain @ 2022-09-15 10:42 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

On 15/09/2022 07:04, Josef Bacik wrote:
> We shouldn't have static_assert()'s in header files in general, but
> especially since btrfs_super_block isn't defined in ctree.h.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Reviewed-by: Anand Jain <anand.jain@oracle.com>

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

* Re: [PATCH 07/15] btrfs: move btrfs_swapfile_pin into volumes.h
  2022-09-14 23:04 ` [PATCH 07/15] btrfs: move btrfs_swapfile_pin into volumes.h Josef Bacik
@ 2022-09-15 10:44   ` Anand Jain
  2022-09-19 21:22   ` David Sterba
  1 sibling, 0 replies; 49+ messages in thread
From: Anand Jain @ 2022-09-15 10:44 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

On 15/09/2022 07:04, Josef Bacik wrote:
> This isn't a great spot for this, but one of the swapfile helper
> functions is in volumes.c, so move the struct to volumes.h.  In the
> future when we have better separation of code there will be a more
> natural spot for this.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Reviewed-by: Anand Jain <anand.jain@oracle.com>

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

* Re: [PATCH 08/15] btrfs: move fs_info struct declarations to the top of ctree.h
  2022-09-14 23:04 ` [PATCH 08/15] btrfs: move fs_info struct declarations to the top of ctree.h Josef Bacik
@ 2022-09-15 10:45   ` Anand Jain
  2022-09-15 14:47   ` Johannes Thumshirn
  1 sibling, 0 replies; 49+ messages in thread
From: Anand Jain @ 2022-09-15 10:45 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

On 15/09/2022 07:04, Josef Bacik wrote:
> In order to make it more straightforward to move the fs_info struct and
> it's related structures, move the struct declarations to the top of
> ctree.h.  This will make it easier to clean up after the fact.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Reviewed-by: Anand Jain <anand.jain@oracle.com>

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

* Re: [PATCH 09/15] btrfs: move btrfs_csum_ptr to inode.c
  2022-09-14 23:04 ` [PATCH 09/15] btrfs: move btrfs_csum_ptr to inode.c Josef Bacik
@ 2022-09-15 10:47   ` Anand Jain
  2022-09-15 14:47   ` Johannes Thumshirn
  1 sibling, 0 replies; 49+ messages in thread
From: Anand Jain @ 2022-09-15 10:47 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

On 15/09/2022 07:04, Josef Bacik wrote:
> This helper is only used in inode.c, move it locally to that file
> instead of defining it in ctree.h.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Reviewed-by: Anand Jain <anand.jain@oracle.com>

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

* Re: [PATCH 10/15] btrfs: move the fs_info related helpers closer to fs_info in ctree.h
  2022-09-14 23:04 ` [PATCH 10/15] btrfs: move the fs_info related helpers closer to fs_info in ctree.h Josef Bacik
@ 2022-09-15 11:28   ` Anand Jain
  2022-09-15 14:50   ` Johannes Thumshirn
  1 sibling, 0 replies; 49+ messages in thread
From: Anand Jain @ 2022-09-15 11:28 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

On 15/09/2022 07:04, Josef Bacik wrote:
> This is purely cosmetic, to make it straightforward to copy and paste
> the definition and helpers from ctree.h into fs.h.  These are helpers
> that act directly on the fs_info, and were scattered throughout ctree.h.
> Move them directly below the fs_info definition to make it easier to
> move them later.  This includes the exclop prototypes, which shares an
> enum that's used in struct btrfs_fs_info as well.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Reviewed-by: Anand Jain <anand.jain@oracle.com>

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

* Re: [PATCH 11/15] btrfs: move btrfs_ordered_sum_size into file-item.c
  2022-09-14 23:04 ` [PATCH 11/15] btrfs: move btrfs_ordered_sum_size into file-item.c Josef Bacik
@ 2022-09-15 11:29   ` Anand Jain
  2022-09-15 14:50   ` Johannes Thumshirn
  1 sibling, 0 replies; 49+ messages in thread
From: Anand Jain @ 2022-09-15 11:29 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

On 15/09/2022 07:04, Josef Bacik wrote:
> This is defined in ordered-data.h, but is only used in file-item.c.
> Move this to file-item.c as it doesn't need to be global.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Reviewed-by: Anand Jain <anand.jain@oracle.com>

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

* Re: [PATCH 12/15] btrfs: delete btrfs_inode_sectorsize helper
  2022-09-14 23:04 ` [PATCH 12/15] btrfs: delete btrfs_inode_sectorsize helper Josef Bacik
@ 2022-09-15 11:39   ` Anand Jain
  2022-09-15 14:51   ` Johannes Thumshirn
  1 sibling, 0 replies; 49+ messages in thread
From: Anand Jain @ 2022-09-15 11:39 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

On 15/09/2022 07:04, Josef Bacik wrote:
> This is defined in btrfs_inode.h, and dereferences btrfs_root and
> btrfs_fs_info, both of which aren't defined in btrfs_inode.h.
> Additionally, in many places we already have root or fs_info, so this
> helper often makes the code harder to read.  So delete the helper and
> simply open code it in the few places that we use it.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>


Reviewed-by: Anand Jain <anand.jain@oracle.com>

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

* Re: [PATCH 13/15] btrfs: delete btrfs_insert_inode_hash helper
  2022-09-14 23:04 ` [PATCH 13/15] btrfs: delete btrfs_insert_inode_hash helper Josef Bacik
@ 2022-09-15 12:43   ` Anand Jain
  2022-09-15 14:52   ` Johannes Thumshirn
  1 sibling, 0 replies; 49+ messages in thread
From: Anand Jain @ 2022-09-15 12:43 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

On 15/09/2022 07:04, Josef Bacik wrote:
> This exists to insert the btree_inode in the super blocks inode hash
> table.  Since it's only used for the btree inode move the code to where
> we use it in disk-io.c and remove the helper.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Reviewed-by: Anand Jain <anand.jain@oracle.com>


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

* Re: [PATCH 14/15] btrfs: use a runtime flag to indicate an inode is a free space inode
  2022-09-14 23:04 ` [PATCH 14/15] btrfs: use a runtime flag to indicate an inode is a free space inode Josef Bacik
@ 2022-09-15 13:01   ` Anand Jain
  2022-09-15 14:53   ` Johannes Thumshirn
  1 sibling, 0 replies; 49+ messages in thread
From: Anand Jain @ 2022-09-15 13:01 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

On 15/09/2022 07:04, Josef Bacik wrote:
> We always check the root of an inode as well as it's inode number to
> determine if it's a free space inode.  This is problematic as the helper
> is in a header file where it doesn't have the fs_info definition.  To
> avoid this and make the check a little cleaner simply add a flag to the
> runtime_flags to indicate that the inode is a free space inode, set that
> when we create the inode, and then change the helper to check for this
> flag.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>


Reviewed-by: Anand Jain <anand.jain@oracle.com>

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

* Re: [PATCH 15/15] btrfs: add struct declarations in dev-replace.h
  2022-09-14 23:04 ` [PATCH 15/15] btrfs: add struct declarations in dev-replace.h Josef Bacik
@ 2022-09-15 13:06   ` Anand Jain
  2022-09-15 14:54   ` Johannes Thumshirn
  1 sibling, 0 replies; 49+ messages in thread
From: Anand Jain @ 2022-09-15 13:06 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

On 15/09/2022 07:04, Josef Bacik wrote:
> dev-replace.h just has function prototypes for device replace, however
> if you happen to include it in the wrong order you'll get compile errors
> because of different structures not being defined.  Since these are just
> pointer args to functions we can declare them at the top in order to
> reduce the pain of using the header.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>


Reviewed-by: Anand Jain <anand.jain@oracle.com>

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

* Re: [PATCH 01/15] btrfs: move btrfs_caching_type to block-group.h
  2022-09-14 23:04 ` [PATCH 01/15] btrfs: move btrfs_caching_type to block-group.h Josef Bacik
  2022-09-15  6:09   ` Anand Jain
@ 2022-09-15 14:34   ` Johannes Thumshirn
  1 sibling, 0 replies; 49+ messages in thread
From: Johannes Thumshirn @ 2022-09-15 14:34 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

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

* Re: [PATCH 02/15] btrfs: move btrfs_full_stripe_locks_tree into block-group.h
  2022-09-14 23:04 ` [PATCH 02/15] btrfs: move btrfs_full_stripe_locks_tree into block-group.h Josef Bacik
  2022-09-15  6:10   ` Anand Jain
@ 2022-09-15 14:38   ` Johannes Thumshirn
  1 sibling, 0 replies; 49+ messages in thread
From: Johannes Thumshirn @ 2022-09-15 14:38 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

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

* Re: [PATCH 03/15] btrfs: move btrfs_init_async_reclaim_work prototype to space-info.h
  2022-09-14 23:04 ` [PATCH 03/15] btrfs: move btrfs_init_async_reclaim_work prototype to space-info.h Josef Bacik
  2022-09-15  6:11   ` Anand Jain
@ 2022-09-15 14:42   ` Johannes Thumshirn
  1 sibling, 0 replies; 49+ messages in thread
From: Johannes Thumshirn @ 2022-09-15 14:42 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

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

* Re: [PATCH 04/15] btrfs: move btrfs_pinned_by_swapfile prototype into volumes.h
  2022-09-14 23:04 ` [PATCH 04/15] btrfs: move btrfs_pinned_by_swapfile prototype into volumes.h Josef Bacik
  2022-09-15 10:37   ` Anand Jain
@ 2022-09-15 14:43   ` Johannes Thumshirn
  1 sibling, 0 replies; 49+ messages in thread
From: Johannes Thumshirn @ 2022-09-15 14:43 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

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

* Re: [PATCH 05/15] btrfs: remove temporary btrfs_map_token declaration in ctree.h
  2022-09-14 23:04 ` [PATCH 05/15] btrfs: remove temporary btrfs_map_token declaration in ctree.h Josef Bacik
  2022-09-15 10:38   ` Anand Jain
@ 2022-09-15 14:44   ` Johannes Thumshirn
  2022-09-20 12:21   ` David Sterba
  2 siblings, 0 replies; 49+ messages in thread
From: Johannes Thumshirn @ 2022-09-15 14:44 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

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

* Re: [PATCH 06/15] btrfs: move static_assert() for btrfs_super_block into fs.c
  2022-09-14 23:04 ` [PATCH 06/15] btrfs: move static_assert() for btrfs_super_block into fs.c Josef Bacik
  2022-09-15 10:42   ` Anand Jain
@ 2022-09-15 14:45   ` Johannes Thumshirn
  2022-09-19 20:54   ` David Sterba
  2 siblings, 0 replies; 49+ messages in thread
From: Johannes Thumshirn @ 2022-09-15 14:45 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

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

* Re: [PATCH 08/15] btrfs: move fs_info struct declarations to the top of ctree.h
  2022-09-14 23:04 ` [PATCH 08/15] btrfs: move fs_info struct declarations to the top of ctree.h Josef Bacik
  2022-09-15 10:45   ` Anand Jain
@ 2022-09-15 14:47   ` Johannes Thumshirn
  1 sibling, 0 replies; 49+ messages in thread
From: Johannes Thumshirn @ 2022-09-15 14:47 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

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

* Re: [PATCH 09/15] btrfs: move btrfs_csum_ptr to inode.c
  2022-09-14 23:04 ` [PATCH 09/15] btrfs: move btrfs_csum_ptr to inode.c Josef Bacik
  2022-09-15 10:47   ` Anand Jain
@ 2022-09-15 14:47   ` Johannes Thumshirn
  1 sibling, 0 replies; 49+ messages in thread
From: Johannes Thumshirn @ 2022-09-15 14:47 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

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

* Re: [PATCH 10/15] btrfs: move the fs_info related helpers closer to fs_info in ctree.h
  2022-09-14 23:04 ` [PATCH 10/15] btrfs: move the fs_info related helpers closer to fs_info in ctree.h Josef Bacik
  2022-09-15 11:28   ` Anand Jain
@ 2022-09-15 14:50   ` Johannes Thumshirn
  1 sibling, 0 replies; 49+ messages in thread
From: Johannes Thumshirn @ 2022-09-15 14:50 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

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

* Re: [PATCH 11/15] btrfs: move btrfs_ordered_sum_size into file-item.c
  2022-09-14 23:04 ` [PATCH 11/15] btrfs: move btrfs_ordered_sum_size into file-item.c Josef Bacik
  2022-09-15 11:29   ` Anand Jain
@ 2022-09-15 14:50   ` Johannes Thumshirn
  1 sibling, 0 replies; 49+ messages in thread
From: Johannes Thumshirn @ 2022-09-15 14:50 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

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

* Re: [PATCH 12/15] btrfs: delete btrfs_inode_sectorsize helper
  2022-09-14 23:04 ` [PATCH 12/15] btrfs: delete btrfs_inode_sectorsize helper Josef Bacik
  2022-09-15 11:39   ` Anand Jain
@ 2022-09-15 14:51   ` Johannes Thumshirn
  1 sibling, 0 replies; 49+ messages in thread
From: Johannes Thumshirn @ 2022-09-15 14:51 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

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

* Re: [PATCH 13/15] btrfs: delete btrfs_insert_inode_hash helper
  2022-09-14 23:04 ` [PATCH 13/15] btrfs: delete btrfs_insert_inode_hash helper Josef Bacik
  2022-09-15 12:43   ` Anand Jain
@ 2022-09-15 14:52   ` Johannes Thumshirn
  1 sibling, 0 replies; 49+ messages in thread
From: Johannes Thumshirn @ 2022-09-15 14:52 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

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

* Re: [PATCH 14/15] btrfs: use a runtime flag to indicate an inode is a free space inode
  2022-09-14 23:04 ` [PATCH 14/15] btrfs: use a runtime flag to indicate an inode is a free space inode Josef Bacik
  2022-09-15 13:01   ` Anand Jain
@ 2022-09-15 14:53   ` Johannes Thumshirn
  1 sibling, 0 replies; 49+ messages in thread
From: Johannes Thumshirn @ 2022-09-15 14:53 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

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

* Re: [PATCH 15/15] btrfs: add struct declarations in dev-replace.h
  2022-09-14 23:04 ` [PATCH 15/15] btrfs: add struct declarations in dev-replace.h Josef Bacik
  2022-09-15 13:06   ` Anand Jain
@ 2022-09-15 14:54   ` Johannes Thumshirn
  1 sibling, 0 replies; 49+ messages in thread
From: Johannes Thumshirn @ 2022-09-15 14:54 UTC (permalink / raw)
  To: Josef Bacik, linux-btrfs, kernel-team

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

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

* Re: [PATCH 06/15] btrfs: move static_assert() for btrfs_super_block into fs.c
  2022-09-14 23:04 ` [PATCH 06/15] btrfs: move static_assert() for btrfs_super_block into fs.c Josef Bacik
  2022-09-15 10:42   ` Anand Jain
  2022-09-15 14:45   ` Johannes Thumshirn
@ 2022-09-19 20:54   ` David Sterba
  2 siblings, 0 replies; 49+ messages in thread
From: David Sterba @ 2022-09-19 20:54 UTC (permalink / raw)
  To: Josef Bacik; +Cc: linux-btrfs, kernel-team

On Wed, Sep 14, 2022 at 07:04:42PM -0400, Josef Bacik wrote:
> We shouldn't have static_assert()'s in header files in general,

Why? Since we have the _Static_assert support in all compilers we can do
the header compile-time checks.

> but
> especially since btrfs_super_block isn't defined in ctree.h.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
> ---
>  fs/btrfs/ctree.h | 1 -
>  fs/btrfs/fs.c    | 2 ++
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
> index a790c58b4c73..3cb4e0aca058 100644
> --- a/fs/btrfs/ctree.h
> +++ b/fs/btrfs/ctree.h
> @@ -56,7 +56,6 @@ struct btrfs_ioctl_encoded_io_args;
>  
>  #define BTRFS_SUPER_INFO_OFFSET			SZ_64K
>  #define BTRFS_SUPER_INFO_SIZE			4096
> -static_assert(sizeof(struct btrfs_super_block) == BTRFS_SUPER_INFO_SIZE);
>  
> +
> +static_assert(sizeof(struct btrfs_super_block) == BTRFS_SUPER_INFO_SIZE);

This can be dropped as the same assert is right after the super block
definition and this is IMO the intended usage pattern. This catches any
accidental changes to the structure.

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

* Re: [PATCH 07/15] btrfs: move btrfs_swapfile_pin into volumes.h
  2022-09-14 23:04 ` [PATCH 07/15] btrfs: move btrfs_swapfile_pin into volumes.h Josef Bacik
  2022-09-15 10:44   ` Anand Jain
@ 2022-09-19 21:22   ` David Sterba
  1 sibling, 0 replies; 49+ messages in thread
From: David Sterba @ 2022-09-19 21:22 UTC (permalink / raw)
  To: Josef Bacik; +Cc: linux-btrfs, kernel-team

On Wed, Sep 14, 2022 at 07:04:43PM -0400, Josef Bacik wrote:
> This isn't a great spot for this, but one of the swapfile helper
> functions is in volumes.c, so move the struct to volumes.h.  In the
> future when we have better separation of code there will be a more
> natural spot for this.

Some if the swapfile is in inode and it shares several callbacks for the
inode ops so that's probably the right place but to move things out of
ctree.h it can be in volumes.h as we don't have inode.h yet.

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

* Re: [PATCH 00/15] btrfs: strip out btrfs_fs_info dependencies
  2022-09-14 23:04 [PATCH 00/15] btrfs: strip out btrfs_fs_info dependencies Josef Bacik
                   ` (14 preceding siblings ...)
  2022-09-14 23:04 ` [PATCH 15/15] btrfs: add struct declarations in dev-replace.h Josef Bacik
@ 2022-09-20 11:44 ` David Sterba
  15 siblings, 0 replies; 49+ messages in thread
From: David Sterba @ 2022-09-20 11:44 UTC (permalink / raw)
  To: Josef Bacik; +Cc: linux-btrfs, kernel-team

On Wed, Sep 14, 2022 at 07:04:36PM -0400, Josef Bacik wrote:
> Part of the cleaning up of ctree.h is being able to move btrfs_fs_info out of
> it.  This is actually pretty difficult because we essentially rely on ctree.h
> being included before everything else, so all other header files have fs_info
> defined for their helpers.
> 
> This series starts this work.  There are a variety of other small moves as well,
> but the bulk is trying to pull any helpers that access fs_info members inside of
> their header files into their respective c files, or alternatively reworking the
> code to drop the dependency.  Thanks,
> 
> Josef
> 
> Josef Bacik (15):
>   btrfs: move btrfs_caching_type to block-group.h
>   btrfs: move btrfs_full_stripe_locks_tree into block-group.h
>   btrfs: move btrfs_init_async_reclaim_work prototype to space-info.h
>   btrfs: move btrfs_pinned_by_swapfile prototype into volumes.h
>   btrfs: remove temporary btrfs_map_token declaration in ctree.h
>   btrfs: move static_assert() for btrfs_super_block into fs.c
>   btrfs: move btrfs_swapfile_pin into volumes.h
>   btrfs: move fs_info struct declarations to the top of ctree.h
>   btrfs: move btrfs_csum_ptr to inode.c
>   btrfs: move the fs_info related helpers closer to fs_info in ctree.h
>   btrfs: move btrfs_ordered_sum_size into file-item.c
>   btrfs: delete btrfs_inode_sectorsize helper
>   btrfs: delete btrfs_insert_inode_hash helper
>   btrfs: use a runtime flag to indicate an inode is a free space inode
>   btrfs: add struct declarations in dev-replace.h

All are safe changes, I've added it to misc-next, except the
static_assert patch (6/15) that would need to be slightly changed.

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

* Re: [PATCH 05/15] btrfs: remove temporary btrfs_map_token declaration in ctree.h
  2022-09-14 23:04 ` [PATCH 05/15] btrfs: remove temporary btrfs_map_token declaration in ctree.h Josef Bacik
  2022-09-15 10:38   ` Anand Jain
  2022-09-15 14:44   ` Johannes Thumshirn
@ 2022-09-20 12:21   ` David Sterba
  2 siblings, 0 replies; 49+ messages in thread
From: David Sterba @ 2022-09-20 12:21 UTC (permalink / raw)
  To: Josef Bacik; +Cc: linux-btrfs, kernel-team

On Wed, Sep 14, 2022 at 07:04:41PM -0400, Josef Bacik wrote:
> This was added while I was moving this code to its new home, it can be
> removed now.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
> ---
>  fs/btrfs/ctree.h | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
> index 36a473f05831..a790c58b4c73 100644
> --- a/fs/btrfs/ctree.h
> +++ b/fs/btrfs/ctree.h
> @@ -46,8 +46,6 @@ struct btrfs_ref;
>  struct btrfs_bio;
>  struct btrfs_ioctl_encoded_io_args;
>  
> -struct btrfs_map_token;

This patch was not applied as this line is not in current misc-next and
it probably depends on some other patchset.

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

end of thread, other threads:[~2022-09-20 12:27 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-14 23:04 [PATCH 00/15] btrfs: strip out btrfs_fs_info dependencies Josef Bacik
2022-09-14 23:04 ` [PATCH 01/15] btrfs: move btrfs_caching_type to block-group.h Josef Bacik
2022-09-15  6:09   ` Anand Jain
2022-09-15 14:34   ` Johannes Thumshirn
2022-09-14 23:04 ` [PATCH 02/15] btrfs: move btrfs_full_stripe_locks_tree into block-group.h Josef Bacik
2022-09-15  6:10   ` Anand Jain
2022-09-15 14:38   ` Johannes Thumshirn
2022-09-14 23:04 ` [PATCH 03/15] btrfs: move btrfs_init_async_reclaim_work prototype to space-info.h Josef Bacik
2022-09-15  6:11   ` Anand Jain
2022-09-15 14:42   ` Johannes Thumshirn
2022-09-14 23:04 ` [PATCH 04/15] btrfs: move btrfs_pinned_by_swapfile prototype into volumes.h Josef Bacik
2022-09-15 10:37   ` Anand Jain
2022-09-15 14:43   ` Johannes Thumshirn
2022-09-14 23:04 ` [PATCH 05/15] btrfs: remove temporary btrfs_map_token declaration in ctree.h Josef Bacik
2022-09-15 10:38   ` Anand Jain
2022-09-15 14:44   ` Johannes Thumshirn
2022-09-20 12:21   ` David Sterba
2022-09-14 23:04 ` [PATCH 06/15] btrfs: move static_assert() for btrfs_super_block into fs.c Josef Bacik
2022-09-15 10:42   ` Anand Jain
2022-09-15 14:45   ` Johannes Thumshirn
2022-09-19 20:54   ` David Sterba
2022-09-14 23:04 ` [PATCH 07/15] btrfs: move btrfs_swapfile_pin into volumes.h Josef Bacik
2022-09-15 10:44   ` Anand Jain
2022-09-19 21:22   ` David Sterba
2022-09-14 23:04 ` [PATCH 08/15] btrfs: move fs_info struct declarations to the top of ctree.h Josef Bacik
2022-09-15 10:45   ` Anand Jain
2022-09-15 14:47   ` Johannes Thumshirn
2022-09-14 23:04 ` [PATCH 09/15] btrfs: move btrfs_csum_ptr to inode.c Josef Bacik
2022-09-15 10:47   ` Anand Jain
2022-09-15 14:47   ` Johannes Thumshirn
2022-09-14 23:04 ` [PATCH 10/15] btrfs: move the fs_info related helpers closer to fs_info in ctree.h Josef Bacik
2022-09-15 11:28   ` Anand Jain
2022-09-15 14:50   ` Johannes Thumshirn
2022-09-14 23:04 ` [PATCH 11/15] btrfs: move btrfs_ordered_sum_size into file-item.c Josef Bacik
2022-09-15 11:29   ` Anand Jain
2022-09-15 14:50   ` Johannes Thumshirn
2022-09-14 23:04 ` [PATCH 12/15] btrfs: delete btrfs_inode_sectorsize helper Josef Bacik
2022-09-15 11:39   ` Anand Jain
2022-09-15 14:51   ` Johannes Thumshirn
2022-09-14 23:04 ` [PATCH 13/15] btrfs: delete btrfs_insert_inode_hash helper Josef Bacik
2022-09-15 12:43   ` Anand Jain
2022-09-15 14:52   ` Johannes Thumshirn
2022-09-14 23:04 ` [PATCH 14/15] btrfs: use a runtime flag to indicate an inode is a free space inode Josef Bacik
2022-09-15 13:01   ` Anand Jain
2022-09-15 14:53   ` Johannes Thumshirn
2022-09-14 23:04 ` [PATCH 15/15] btrfs: add struct declarations in dev-replace.h Josef Bacik
2022-09-15 13:06   ` Anand Jain
2022-09-15 14:54   ` Johannes Thumshirn
2022-09-20 11:44 ` [PATCH 00/15] btrfs: strip out btrfs_fs_info dependencies David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).