1. 17 Mar, 2011 6 commits
    • Josef Bacik's avatar
      Btrfs: convert to the new truncate sequence · a41ad394
      Josef Bacik authored
      ->truncate() is going away, instead all of the work needs to be done in
      ->setattr().  So this converts us over to do this.  It's fairly straightforward,
      just get rid of our .truncate inode operation and call btrfs_truncate() directly
      from btrfs_setsize.  This works out better for us since truncate can technically
      return ENOSPC, and before we had no way of letting anybody know.  Thanks,
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      a41ad394
    • Josef Bacik's avatar
      Btrfs: use a slab for the free space entries · dc89e982
      Josef Bacik authored
      Since we alloc/free free space entries a whole lot, lets use a slab to keep
      track of them.  This makes some of my tests slightly faster.  Thanks,
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      dc89e982
    • Josef Bacik's avatar
      Btrfs: change reserved_extents to an atomic_t · 57a45ced
      Josef Bacik authored
      We track delayed allocation per inodes via 2 counters, one is
      outstanding_extents and reserved_extents.  Outstanding_extents is already an
      atomic_t, but reserved_extents is not and is protected by a spinlock.  So
      convert this to an atomic_t and instead of using a spinlock, use atomic_cmpxchg
      when releasing delalloc bytes.  This makes our inode 72 bytes smaller, and
      reduces locking overhead (albiet it was minimal to begin with).  Thanks,
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      57a45ced
    • Josef Bacik's avatar
      Btrfs: fix how we deal with the pages array in the write path · 4a64001f
      Josef Bacik authored
      Really we don't need to memset the pages array at all, since we know how many
      pages we're going to use in the array and pass that around.  So don't memset,
      just trust we're not idiots and we pass num_pages around properly.
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      4a64001f
    • Josef Bacik's avatar
      Btrfs: simplify our write path · d0215f3e
      Josef Bacik authored
      Our aio_write function is huge and kind of hard to follow at times.  So this
      patch fixes this by breaking out the buffered and direct write paths out into
      seperate functions so it's a little clearer what's going on.  I've also fixed
      some wrong typing that we had and added the ability to handle getting an error
      back from btrfs_set_extent_delalloc.  Tested this with xfstests and everything
      came out fine.  Thanks,
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      d0215f3e
    • Josef Bacik's avatar
      Btrfs: fix formatting in file.c · 9f570b8d
      Josef Bacik authored
      Sorry, but these were bugging me.  Just cleanup some of the formatting in
      file.c.
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      9f570b8d
  2. 15 Mar, 2011 1 commit
  3. 14 Mar, 2011 33 commits