15 Jan, 2015

1 commit


18 Sep, 2014

1 commit

  • We have been iterating all references for each extent we have in a file when we
    do fiemap to see if it is shared. This is fine when you have a few clones or a
    few snapshots, but when you have 5k snapshots suddenly fiemap just sits there
    and stares at you. So add btrfs_check_shared which will use the backref walking
    code but will short circuit as soon as it finds a root or inode that doesn't
    match the one we currently have. This makes fiemap on my testbox go from
    looking at me blankly for a day to spitting out actual output in a reasonable
    amount of time. Thanks,

    Signed-off-by: Josef Bacik
    Signed-off-by: Chris Mason

    Josef Bacik
     

10 Jun, 2014

2 commits

  • The skinny extents are intepreted incorrectly in scrub_print_warning(),
    and end up hitting the BUG() in btrfs_extent_inline_ref_size.

    Reported-by: Konstantinos Skarlatos
    Signed-off-by: Liu Bo
    Signed-off-by: Chris Mason

    Liu Bo
     
  • Currently qgroups account for space by intercepting delayed ref updates to fs
    trees. It does this by adding sequence numbers to delayed ref updates so that
    it can figure out how the tree looked before the update so we can adjust the
    counters properly. The problem with this is that it does not allow delayed refs
    to be merged, so if you say are defragging an extent with 5k snapshots pointing
    to it we will thrash the delayed ref lock because we need to go back and
    manually merge these things together. Instead we want to process quota changes
    when we know they are going to happen, like when we first allocate an extent, we
    free a reference for an extent, we add new references etc. This patch
    accomplishes this by only adding qgroup operations for real ref changes. We
    only modify the sequence number when we need to lookup roots for bytenrs, this
    reduces the amount of churn on the sequence number and allows us to merge
    delayed refs as we add them most of the time. This patch encompasses a bunch of
    architectural changes

    1) qgroup ref operations: instead of tracking qgroup operations through the
    delayed refs we simply add new ref operations whenever we notice that we need to
    when we've modified the refs themselves.

    2) tree mod seq: we no longer have this separation of major/minor counters.
    this makes the sequence number stuff much more sane and we can remove some
    locking that was needed to protect the counter.

    3) delayed ref seq: we now read the tree mod seq number and use that as our
    sequence. This means each new delayed ref doesn't have it's own unique sequence
    number, rather whenever we go to lookup backrefs we inc the sequence number so
    we can make sure to keep any new operations from screwing up our world view at
    that given point. This allows us to merge delayed refs during runtime.

    With all of these changes the delayed ref stuff is a little saner and the qgroup
    accounting stuff no longer goes negative in some cases like it was before.
    Thanks,

    Signed-off-by: Josef Bacik
    Signed-off-by: Chris Mason

    Josef Bacik
     

01 Sep, 2013

1 commit

  • struct __prelim_ref is allocated and freed frequently when
    walking backref tree, using slab allocater can not only
    speed up allocating but also detect memory leaks.

    Signed-off-by: Wang Shilong
    Reviewed-by: Miao Xie
    Reviewed-by: Jan Schmidt
    Signed-off-by: Josef Bacik
    Signed-off-by: Chris Mason

    Wang Shilong
     

01 Jul, 2013

1 commit

  • Looking into this backref problem I noticed we're using a macro to what turns
    out to essentially be a NULL check to see if we need to search the commit root.
    I'm killing this, let's just do what everybody else does and checks if trans ==
    NULL. I've also made it so we pass in the path to __resolve_indirect_refs which
    will have the search_commit_root flag set properly already and that way we can
    avoid allocating another path when we have a perfectly good one to use. Thanks,

    Signed-off-by: Josef Bacik

    Josef Bacik
     

07 May, 2013

1 commit

  • Big patch, but all it does is add statics to functions which
    are in fact static, then remove the associated dead-code fallout.

    removed functions:

    btrfs_iref_to_path()
    __btrfs_lookup_delayed_deletion_item()
    __btrfs_search_delayed_insertion_item()
    __btrfs_search_delayed_deletion_item()
    find_eb_for_page()
    btrfs_find_block_group()
    range_straddles_pages()
    extent_range_uptodate()
    btrfs_file_extent_length()
    btrfs_scrub_cancel_devid()
    btrfs_start_transaction_lflush()

    btrfs_print_tree() is left because it is used for debugging.
    btrfs_start_transaction_lflush() and btrfs_reada_detach() are
    left for symmetry.

    ulist.c functions are left, another patch will take care of those.

    Signed-off-by: Eric Sandeen
    Signed-off-by: Josef Bacik

    Eric Sandeen
     

20 Feb, 2013

1 commit


26 Oct, 2012

1 commit


09 Oct, 2012

2 commits

  • The iterate_irefs in backref.c is used to build path components from inode
    refs. This patch adds code to iterate extended refs as well.

    I had modify the callback function signature to abstract out some of the
    differences between ref structures. iref_to_path() also needed similar
    changes.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • This patch adds basic support for extended inode refs. This includes support
    for link and unlink of the refs, which basically gets us support for rename
    as well.

    Inode creation does not need changing - extended refs are only added after
    the ref array is full.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     

02 Oct, 2012

1 commit

  • In logical resolve, we parse extent_from_logical()'s 'ret' as a kind of flag.

    It is possible to lose our errors because
    (-EXXXX & BTRFS_EXTENT_FLAG_TREE_BLOCK) is true.

    I'm not sure if it is on purpose, it just looks too hacky if it is.
    I'd rather use a real flag and a 'ret' to catch errors.

    Acked-by: Jan Schmidt
    Signed-off-by: Liu Bo

    Liu Bo
     

26 Jul, 2012

2 commits


10 Jul, 2012

1 commit

  • We've got two mechanisms both required for reliable backref resolving (tree
    mod log and holding back delayed refs). You cannot make use of one without
    the other. So instead of requiring the user of this mechanism to setup both
    correctly, we join them into a single interface.

    Additionally, we stop inserting non-blockers into fs_info->tree_mod_seq_list
    as we did before, which was of no value.

    Signed-off-by: Jan Schmidt

    Jan Schmidt
     

30 May, 2012

1 commit


26 May, 2012

1 commit

  • Before this patch we called find_all_leafs for a data extent, then called
    find_all_roots and then looked into the extent to grab the information
    we were seeking. This was done without holding the leaves locked to avoid
    deadlocks. However, this can obviouly race with concurrent tree
    modifications.

    Instead, we now look into the extent while we're holding the lock during
    find_all_leafs and store this information together with the leaf list.

    Signed-off-by: Jan Schmidt

    Jan Schmidt
     

27 Mar, 2012

1 commit

  • In commit 4692cf58 we introduced new backref walking code for btrfs. This
    assumes we're searching live roots, which requires a transaction context.
    While scrubbing, however, we must not join a transaction because this could
    deadlock with the commit path. Additionally, what scrub really wants to do
    is resolving a logical address in the commit root it's currently checking.

    This patch adds support for logical to path resolving on commit roots and
    makes scrub use that.

    Signed-off-by: Jan Schmidt

    Jan Schmidt
     

04 Jan, 2012

1 commit

  • This function gets a byte number (a data extent), collects all the leafs
    pointing to it and walks up the trees to find all fs roots pointing to those
    leafs. It also returns the list of all leafs pointing to that extent.

    It does proper locking for the involved trees, can be used on busy file
    systems and honors delayed refs.

    Signed-off-by: Arne Jansen
    Signed-off-by: Jan Schmidt

    Jan Schmidt
     

29 Sep, 2011

1 commit