1. 29 Mar, 2012 10 commits
  2. 27 Mar, 2012 18 commits
  3. 26 Mar, 2012 12 commits
    • Chris Mason's avatar
      Btrfs: don't use threaded IO completion helpers for metadata writes · f3f266ab
      Chris Mason authored
      The metadata write IO completion code is now simple enough that we
      don't need the threaded helpers anymore.
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      f3f266ab
    • Chris Mason's avatar
      Btrfs: adjust the write_lock_level as we unlock · f7c79f30
      Chris Mason authored
      btrfs_search_slot sometimes needs write locks on high levels of
      the tree.  It remembers the highest level that needs a write lock
      and will use that for all future searches through the tree in a given
      call.
      
      But, very often we'll just cow the top level or the level below and we
      won't really need write locks on the root again after that.  This patch
      changes things to adjust the write lock requirement as it unlocks
      levels.
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      f7c79f30
    • Chris Mason's avatar
      Btrfs: loop waiting on writeback · a098d8e8
      Chris Mason authored
      lock_extent_buffer_for_io needs to loop around and make sure the
      writeback bits are not set.
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      a098d8e8
    • Chris Mason's avatar
      Btrfs: add the ability to cache a pointer into the eb · cfed81a0
      Chris Mason authored
      This cuts down on the CPU time used by map_private_extent_buffer
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      cfed81a0
    • Josef Bacik's avatar
      Btrfs: ensure an entire eb is written at once · 0b32f4bb
      Josef Bacik authored
      This patch simplifies how we track our extent buffers.  Previously we could exit
      writepages with only having written half of an extent buffer, which meant we had
      to track the state of the pages and the state of the extent buffers differently.
      Now we only read in entire extent buffers and write out entire extent buffers,
      this allows us to simply set bits in our bflags to indicate the state of the eb
      and we no longer have to do things like track uptodate with our iotree.  Thanks,
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      0b32f4bb
    • Josef Bacik's avatar
      Btrfs: introduce mark_extent_buffer_accessed · 5df4235e
      Josef Bacik authored
      Because an eb can have multiple pages we need to make sure that all pages within
      the eb are markes as accessed, since releasepage can be called against any page
      in the eb.  This will keep us from possibly evicting hot eb's when we're doing
      larger than pagesize eb's.  Thanks,
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      5df4235e
    • Josef Bacik's avatar
      Btrfs: introduce free_extent_buffer_stale · 3083ee2e
      Josef Bacik authored
      Because btrfs cow's we can end up with extent buffers that are no longer
      necessary just sitting around in memory.  So instead of evicting these pages, we
      could end up evicting things we actually care about.  Thus we have
      free_extent_buffer_stale for use when we are freeing tree blocks.  This will
      make it so that the ref for the eb being in the radix tree is dropped as soon as
      possible and then is freed when the refcount hits 0 instead of waiting to be
      released by releasepage.  Thanks,
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      3083ee2e
    • Josef Bacik's avatar
      Btrfs: only use the existing eb if it's count isn't 0 · 115391d2
      Josef Bacik authored
      We can run into a problem where we find an eb for our existing page already on
      the radix tree but it has a ref count of 0.  It hasn't yet been removed by RCU
      yet so this can cause issues where we will use the EB after free.  So do
      atomic_inc_not_zero on the exists->refs and if it is zero just do
      synchronize_rcu() and try again.  We won't have to worry about new allocators
      coming in since they will block on the page lock at this point.  Thanks,
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      115391d2
    • Josef Bacik's avatar
      Btrfs: set page->private to the eb · 4f2de97a
      Josef Bacik authored
      We spend a lot of time looking up extent buffers from pages when we could just
      store the pointer to the eb the page is associated with in page->private.  This
      patch does just that, and it makes things a little simpler and reduces a bit of
      CPU overhead involved with doing metadata IO.  Thanks,
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      4f2de97a
    • Chris Mason's avatar
      Btrfs: allow metadata blocks larger than the page size · 727011e0
      Chris Mason authored
      A few years ago the btrfs code to support blocks lager than
      the page size was disabled to fix a few corner cases in the
      page cache handling.  This fixes the code to properly support
      large metadata blocks again.
      
      Since current kernels will crash early and often with larger
      metadata blocks, this adds an incompat bit so that older kernels
      can't mount it.
      
      This also does away with different blocksizes for nodes and leaves.
      You get a single block size for all tree blocks.
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      727011e0
    • Josef Bacik's avatar
      Btrfs: remove search_start and search_end from find_free_extent and callers · 81c9ad23
      Josef Bacik authored
      We have been passing nothing but (u64)-1 to find_free_extent for search_end in
      all of the callers, so it's completely useless, and we've always been passing 0
      in as search_start, so just remove them as function arguments and move
      search_start into find_free_extent.  Thanks,
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      81c9ad23
    • Josef Bacik's avatar
      Btrfs: remove the ideal caching code · 285ff5af
      Josef Bacik authored
      This is a relic from before we had the disk space cache and it was to make
      bootup times when you had btrfs as root not be so damned slow.  Now that we have
      the disk space cache this isn't a problem anymore and really having this code
      casues uneeded fragmentation and complexity, so just remove it.  Thanks,
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      285ff5af