1. 06 4月, 2010 3 次提交
    • S
      Btrfs: create snapshot references in same commit as snapshot · 6bdb72de
      Sage Weil 提交于
      This creates the reference to a new snapshot in the same commit as the
      snapshot itself.  This avoids the need for a second commit in order for a
      snapshot to be persistent, and also avoids the problem of "leaking" a
      new snapshot tree root if the host crashes before the second commit takes
      place.
      
      It is not at all clear to me why it wasn't always done this way.  If there
      is still a reason for the two-stage {create,finish}_pending_snapshots()
      approach I'm missing something!  :)
      
      I've been running this for a couple weeks under pretty heavy usage (a few
      snapshots per minute) without obvious problems.
      Signed-off-by: NSage Weil <sage@newdream.net>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      6bdb72de
    • J
      Btrfs: fix small race with delalloc flushing waitqueue's · b5cb1600
      Josef Bacik 提交于
      Everytime we start a new flushing thread, we init the waitqueue if there isn't a
      flushing thread running.  The problem with this is we check
      space_info->flushing, which we clear right before doing a wake_up on the
      flushing waitqueue, which causes problems if we init the waitqueue in the middle
      of clearing the flushing flagh and calling wake_up.  This is hard to hit, but
      the code is wrong anyway, so init the flushing/allocating waitqueue when
      creating the space info and let it be.  I haven't seen the panic since I've been
      using this patch.  Thanks,
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      b5cb1600
    • N
      Btrfs: use add_to_page_cache_lru, use __page_cache_alloc · 28ecb609
      Nick Piggin 提交于
      Pagecache pages should be allocated with __page_cache_alloc, so they
      obey pagecache memory policies.
      
      add_to_page_cache_lru is exported, so it should be used. Benefits over
      using a private pagevec: neater code, 128 bytes fewer stack used, percpu
      lru ordering is preserved, and finally don't need to flush pagevec
      before returning so batching may be shared with other LRU insertions.
      
      Signed-off-by: Nick Piggin <npiggin@suse.de>:
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      28ecb609
  2. 31 3月, 2010 11 次提交
  3. 19 3月, 2010 4 次提交
    • C
      Btrfs: fix the inode ref searches done by btrfs_search_path_in_tree · 8ad6fcab
      Chris Mason 提交于
      This is used by the inode lookup ioctl to follow all the backrefs up
      to the subvol root.  But the search being done would sometimes land one
      past the last item in the leaf instead of finding the backref.
      
      This changes the search to look for the highest possible backref and hop
      back one item.  It also fixes a leaked path on failure to find the root.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      8ad6fcab
    • C
      Btrfs: allow treeid==0 in the inode lookup ioctl · 1b53ac4d
      Chris Mason 提交于
      When a root id of 0 is sent to the inode lookup ioctl, it will
      use the root of the file we're ioctling and pass the root id
      back to userland along with the results.
      
      This allows userland to do searches based on that root later on.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      1b53ac4d
    • C
      Btrfs: return keys for large items to the search ioctl · 90fdde14
      Chris Mason 提交于
      The search ioctl was skipping large items entirely (ones that are too
      big for the results buffer).  This changes things to at least copy
      the item header so that we can send information about the item back to
      userland.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      90fdde14
    • C
      Btrfs: fix key checks and advance in the search ioctl · abc6e134
      Chris Mason 提交于
      The search ioctl was working well for finding tree roots, but using it for
      generic searches requires a few changes to how the keys are advanced.
      This treats the search control min fields for objectid, type and offset
      more like a key, where we drop the offset to zero once we bump the type,
      etc.
      
      The downside of this is that we are changing the min_type and min_offset
      fields during the search, and so the ioctl caller needs extra checks to make sure
      the keys in the result are the ones it wanted.
      
      This also changes key_in_sk to use btrfs_comp_cpu_keys, just to make
      things more readable.
      Signed-off-by: NChris Mason <chris.mason@oracle.com>
      abc6e134
  4. 17 3月, 2010 3 次提交
  5. 15 3月, 2010 19 次提交