1. 18 3月, 2011 6 次提交
    • J
      Btrfs: convert to the new truncate sequence · a41ad394
      Josef Bacik 提交于
      ->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: NJosef Bacik <josef@redhat.com>
      a41ad394
    • J
      Btrfs: use a slab for the free space entries · dc89e982
      Josef Bacik 提交于
      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: NJosef Bacik <josef@redhat.com>
      dc89e982
    • J
      Btrfs: change reserved_extents to an atomic_t · 57a45ced
      Josef Bacik 提交于
      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: NJosef Bacik <josef@redhat.com>
      57a45ced
    • J
      Btrfs: fix how we deal with the pages array in the write path · 4a64001f
      Josef Bacik 提交于
      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: NJosef Bacik <josef@redhat.com>
      4a64001f
    • J
      Btrfs: simplify our write path · d0215f3e
      Josef Bacik 提交于
      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: NJosef Bacik <josef@redhat.com>
      d0215f3e
    • J
      Btrfs: fix formatting in file.c · 9f570b8d
      Josef Bacik 提交于
      Sorry, but these were bugging me.  Just cleanup some of the formatting in
      file.c.
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      9f570b8d
  2. 15 3月, 2011 34 次提交