1. 17 Mar, 2011 8 commits
    • Josef Bacik's avatar
      Btrfs: handle errors in btrfs_orphan_cleanup · 66b4ffd1
      Josef Bacik authored
      If we cannot truncate an inode for some reason we will never delete the orphan
      item associated with that inode, which means that we will loop forever in
      btrfs_orphan_cleanup.  Instead of doing this just return error so we fail to
      mount.  It sucks, but hey it's better than hanging.  Thanks,
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      66b4ffd1
    • Josef Bacik's avatar
      Btrfs: cleanup error handling in the truncate path · 3893e33b
      Josef Bacik authored
      Now that we can handle having errors in the truncate path lets make sure we
      return errors instead of doing BUG_ON() and such.  Thanks,
      Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
      3893e33b
    • 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 31 commits