linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: osandov@osandov.com, Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH 1/6] btrfs-progs: Add support for freespace tree in btrfs_read_fs_root
Date: Fri, 15 Jun 2018 14:05:57 +0300	[thread overview]
Message-ID: <1529060762-4372-2-git-send-email-nborisov@suse.com> (raw)
In-Reply-To: <1529060762-4372-1-git-send-email-nborisov@suse.com>

For completeness sake add code to btrfs_read_fs_root so that it can
handle the freespace tree.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 disk-io.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/disk-io.c b/disk-io.c
index 8da6e3ce5fc8..9ad826b83b3e 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -664,6 +664,9 @@ struct btrfs_root *btrfs_read_fs_root(struct btrfs_fs_info *fs_info,
 	if (location->objectid == BTRFS_QUOTA_TREE_OBJECTID)
 		return fs_info->quota_enabled ? fs_info->quota_root :
 				ERR_PTR(-ENOENT);
+	if (location->objectid == BTRFS_FREE_SPACE_TREE_OBJECTID)
+        return fs_info->free_space_root ? fs_info->free_space_root :
+                                                  ERR_PTR(-ENOENT);
 
 	BUG_ON(location->objectid == BTRFS_TREE_RELOC_OBJECTID ||
 	       location->offset != (u64)-1);
-- 
2.7.4


  reply	other threads:[~2018-06-15 11:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-15 11:05 [PATCH 0/6] Freespace tree repair support Nikolay Borisov
2018-06-15 11:05 ` Nikolay Borisov [this message]
2018-09-21 19:50   ` [PATCH 1/6] btrfs-progs: Add support for freespace tree in btrfs_read_fs_root Omar Sandoval
2018-06-15 11:05 ` [PATCH 2/6] btrfs-progs: Add extent buffer bitmap manipulation infrastructure Nikolay Borisov
2018-09-21 20:08   ` Omar Sandoval
2018-06-15 11:05 ` [PATCH 3/6] btrfs-progs: Pull free space tree related code from kernel Nikolay Borisov
2018-09-21 20:19   ` Omar Sandoval
2018-09-21 20:38     ` Nikolay Borisov
2018-06-15 11:06 ` [PATCH 4/6] btrfs-progs: Add freespace tree as compat_ro supported feature Nikolay Borisov
2018-09-21 20:39   ` Omar Sandoval
2018-06-15 11:06 ` [PATCH 5/6] btrfs-progs: check: Add support for freespace tree fixing Nikolay Borisov
2018-09-21 20:42   ` Omar Sandoval
2018-06-15 11:06 ` [PATCH 6/6] btrfs-progs: tests: Test for FST corruption detection/repair Nikolay Borisov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1529060762-4372-2-git-send-email-nborisov@suse.com \
    --to=nborisov@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=osandov@osandov.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).