On 6/24/16 6:14 PM, jeffm@xxxxxxxx wrote:
> From: Jeff Mahoney <jeffm@xxxxxxxx>
>
> This allows the upcoming patchset to push nodesize and sectorsize into
> fs_info.
>
> Signed-off-by: Jeff Mahoney <jeffm@xxxxxxxx>
> ---
> fs/btrfs/ctree.h | 1 +
> fs/btrfs/disk-io.c | 15 +++++++----
> fs/btrfs/disk-io.h | 3 ++-
> fs/btrfs/tests/btrfs-tests.c | 20 ++++++++++++---
> fs/btrfs/tests/btrfs-tests.h | 1 +
> fs/btrfs/tests/extent-buffer-tests.c | 23 +++++++++++------
> fs/btrfs/tests/free-space-tests.c | 14 +++++++----
> fs/btrfs/tests/free-space-tree-tests.c | 18 +++++++------
> fs/btrfs/tests/inode-tests.c | 46 ++++++++++++++++++----------------
> fs/btrfs/tests/qgroup-tests.c | 23 +++++++++--------
> 10 files changed, 103 insertions(+), 61 deletions(-)
>
> diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
> index 100d2ea..4781057 100644
> --- a/fs/btrfs/ctree.h
> +++ b/fs/btrfs/ctree.h
> @@ -117,6 +117,7 @@ static inline unsigned long btrfs_chunk_item_size(int num_stripes)
> #define BTRFS_FS_STATE_REMOUNTING 1
> #define BTRFS_FS_STATE_TRANS_ABORTED 2
> #define BTRFS_FS_STATE_DEV_REPLACING 3
> +#define BTRFS_FS_STATE_DUMMY_FS_INFO 4
>
> #define BTRFS_BACKREF_REV_MAX 256
> #define BTRFS_BACKREF_REV_SHIFT 56
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index 8f27127..418163d 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -1233,6 +1233,7 @@ static void __setup_root(u32 nodesize, u32 sectorsize, u32 stripesize,
> struct btrfs_root *root, struct btrfs_fs_info *fs_info,
> u64 objectid)
> {
> + bool dummy = test_bit(BTRFS_FS_STATE_DUMMY_FS_INFO, &fs_info->fs_state);
> root->node = NULL;
> root->commit_root = NULL;
> root->sectorsize = sectorsize;
> @@ -1287,14 +1288,14 @@ static void __setup_root(u32 nodesize, u32 sectorsize, u32 stripesize,
> root->log_transid = 0;
> root->log_transid_committed = -1;
> root->last_log_commit = 0;
> - if (fs_info)
> + if (dummy)
This should be:
if (!dummy)
> extent_io_tree_init(&root->dirty_log_pages,
> fs_info->btree_inode->i_mapping);
>
> memset(&root->root_key, 0, sizeof(root->root_key));
> memset(&root->root_item, 0, sizeof(root->root_item));
> memset(&root->defrag_progress, 0, sizeof(root->defrag_progress));
> - if (fs_info)
> + if (dummy)
So should this.
-Jeff
--
Jeff Mahoney
SUSE Labs
Attachment:
signature.asc
Description: OpenPGP digital signature
