backref.c (7e4d960993331e92567f0180e45322a93e6780ba) | backref.c (d3b010640e5c59b98d3b11229ba4cc2838dc7cbf) |
---|---|
1/* 2 * Copyright (C) 2011 STRATO. All rights reserved. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public 6 * License v2 as published by the Free Software Foundation. 7 * 8 * This program is distributed in the hope that it will be useful, --- 569 unchanged lines hidden (view full) --- 578static int find_parent_nodes(struct btrfs_trans_handle *trans, 579 struct btrfs_fs_info *fs_info, u64 bytenr, 580 u64 seq, struct ulist *refs, struct ulist *roots) 581{ 582 struct btrfs_key key; 583 struct btrfs_path *path; 584 struct btrfs_key info_key = { 0 }; 585 struct btrfs_delayed_ref_root *delayed_refs = NULL; | 1/* 2 * Copyright (C) 2011 STRATO. All rights reserved. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public 6 * License v2 as published by the Free Software Foundation. 7 * 8 * This program is distributed in the hope that it will be useful, --- 569 unchanged lines hidden (view full) --- 578static int find_parent_nodes(struct btrfs_trans_handle *trans, 579 struct btrfs_fs_info *fs_info, u64 bytenr, 580 u64 seq, struct ulist *refs, struct ulist *roots) 581{ 582 struct btrfs_key key; 583 struct btrfs_path *path; 584 struct btrfs_key info_key = { 0 }; 585 struct btrfs_delayed_ref_root *delayed_refs = NULL; |
586 struct btrfs_delayed_ref_head *head = NULL; | 586 struct btrfs_delayed_ref_head *head; |
587 int info_level = 0; 588 int ret; 589 struct list_head prefs_delayed; 590 struct list_head prefs; 591 struct __prelim_ref *ref; 592 593 INIT_LIST_HEAD(&prefs); 594 INIT_LIST_HEAD(&prefs_delayed); --- 7 unchanged lines hidden (view full) --- 602 return -ENOMEM; 603 604 /* 605 * grab both a lock on the path and a lock on the delayed ref head. 606 * We need both to get a consistent picture of how the refs look 607 * at a specified point in time 608 */ 609again: | 587 int info_level = 0; 588 int ret; 589 struct list_head prefs_delayed; 590 struct list_head prefs; 591 struct __prelim_ref *ref; 592 593 INIT_LIST_HEAD(&prefs); 594 INIT_LIST_HEAD(&prefs_delayed); --- 7 unchanged lines hidden (view full) --- 602 return -ENOMEM; 603 604 /* 605 * grab both a lock on the path and a lock on the delayed ref head. 606 * We need both to get a consistent picture of how the refs look 607 * at a specified point in time 608 */ 609again: |
610 head = NULL; 611 |
|
610 ret = btrfs_search_slot(trans, fs_info->extent_root, &key, path, 0, 0); 611 if (ret < 0) 612 goto out; 613 BUG_ON(ret == 0); 614 615 /* 616 * look if there are updates for this ref queued and lock the head 617 */ --- 12 unchanged lines hidden (view full) --- 630 * released and try again 631 */ 632 mutex_lock(&head->mutex); 633 mutex_unlock(&head->mutex); 634 btrfs_put_delayed_ref(&head->node); 635 goto again; 636 } 637 ret = __add_delayed_refs(head, seq, &info_key, &prefs_delayed); | 612 ret = btrfs_search_slot(trans, fs_info->extent_root, &key, path, 0, 0); 613 if (ret < 0) 614 goto out; 615 BUG_ON(ret == 0); 616 617 /* 618 * look if there are updates for this ref queued and lock the head 619 */ --- 12 unchanged lines hidden (view full) --- 632 * released and try again 633 */ 634 mutex_lock(&head->mutex); 635 mutex_unlock(&head->mutex); 636 btrfs_put_delayed_ref(&head->node); 637 goto again; 638 } 639 ret = __add_delayed_refs(head, seq, &info_key, &prefs_delayed); |
638 if (ret) | 640 if (ret) { 641 spin_unlock(&delayed_refs->lock); |
639 goto out; | 642 goto out; |
643 } |
|
640 } 641 spin_unlock(&delayed_refs->lock); 642 643 if (path->slots[0]) { 644 struct extent_buffer *leaf; 645 int slot; 646 647 leaf = path->nodes[0]; --- 756 unchanged lines hidden --- | 644 } 645 spin_unlock(&delayed_refs->lock); 646 647 if (path->slots[0]) { 648 struct extent_buffer *leaf; 649 int slot; 650 651 leaf = path->nodes[0]; --- 756 unchanged lines hidden --- |