From patchwork Tue May 4 00:39:43 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Brandt X-Patchwork-Id: 96644 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o440nMLo021398 for ; Tue, 4 May 2010 00:49:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751864Ab0EDAtV (ORCPT ); Mon, 3 May 2010 20:49:21 -0400 Received: from mxc.mnstate.edu ([199.17.81.76]:32992 "HELO mxc.mnstate.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751163Ab0EDAtU (ORCPT ); Mon, 3 May 2010 20:49:20 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 04 May 2010 00:49:23 +0000 (UTC) X-Greylist: delayed 552 seconds by postgrey-1.27 at vger.kernel.org; Mon, 03 May 2010 20:49:10 EDT Received: from localhost (localhost.localdomain [127.0.0.1]) by mxc.mnstate.edu (Postfix) with ESMTP id D995994C14C for ; Mon, 3 May 2010 19:39:53 -0500 (CDT) X-Virus-Scanned: amavisd-new at mxc.mnstate.edu Received: from mxc.mnstate.edu ([127.0.0.1]) by localhost (mxc.mnstate.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HYS2HFrbEU3i for ; Mon, 3 May 2010 19:39:49 -0500 (CDT) Received: from elijah.localnet (75-1-138-1.lightspeed.snantx.sbcglobal.net [75.1.138.1]) by mxc.mnstate.edu (Postfix) with ESMTP id 8329A94C13A for ; Mon, 3 May 2010 19:39:49 -0500 (CDT) From: Alex Brandt Organization: Minnesota State University Moorhead To: linux-btrfs@vger.kernel.org Subject: boot fsck of btrfs Date: Mon, 3 May 2010 19:39:43 -0500 User-Agent: KMail/1.13.2 (Linux/2.6.34-rc5; KDE/4.4.2; x86_64; ; ) MIME-Version: 1.0 Message-Id: <201005031939.47927.alunduil@alunduil.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org diff --git a/btrfsck.c b/btrfsck.c index 73f1836..b3fabcc 100644 --- a/btrfsck.c +++ b/btrfsck.c @@ -1847,7 +1847,7 @@ static int all_backpointers_checked(struct extent_record *rec, int print_errs) (unsigned long long)rec->start, back->full_backref ? "parent" : "root", - back->full_backref ? + back->full_backref ? (unsigned long long)dback->parent: (unsigned long long)dback->root, (unsigned long long)dback->owner, @@ -1941,7 +1941,7 @@ static int check_owner_ref(struct btrfs_root *root, btrfs_item_key_to_cpu(buf, &key, 0); else btrfs_node_key_to_cpu(buf, &key, 0); - + btrfs_init_path(&path); path.lowest_level = level + 1; ret = btrfs_search_slot(NULL, ref_root, &key, &path, 0, 0); @@ -2047,7 +2047,7 @@ static struct data_backref *find_data_backref(struct extent_record *rec, if (!node->is_data) continue; back = (struct data_backref *)node; - if (parent > 0) { + if (parent > 0) { if (!node->full_backref) continue; if (parent == back->parent) @@ -2583,7 +2583,7 @@ static int run_next_block(struct btrfs_root *root, ref = btrfs_item_ptr(buf, i, struct btrfs_shared_data_ref); add_data_backref(extent_cache, - key.objectid, key.offset, 0, 0, 0, + key.objectid, key.offset, 0, 0, 0, btrfs_shared_data_ref_count(buf, ref), 0); continue; @@ -2626,7 +2626,7 @@ static int run_next_block(struct btrfs_root *root, ptr, size, 0, 0, 1, 0); BUG_ON(ret); - add_tree_backref(extent_cache, ptr, parent, + add_tree_backref(extent_cache, ptr, parent, owner, 1); if (level > 1) { @@ -2815,13 +2815,18 @@ int main(int ac, char **av) struct cache_tree root_cache; struct btrfs_root *root; int ret; + int i; if (ac < 2) print_usage(); radix_tree_init(); cache_tree_init(&root_cache); - root = open_ctree(av[1], 0, 0); + + for (i = 1; !strncmp("-", av[i], 1) && i < ac; ++i); + if (i >= ac) + print_usage(); + root = open_ctree(av[i], 0, 0); if (root == NULL) return 1;