Btrfs: change reserved_extents to an atomic_t
authorJosef Bacik <josef@redhat.com>
Tue, 25 Jan 2011 21:30:38 +0000 (16:30 -0500)
committerJosef Bacik <josef@redhat.com>
Thu, 17 Mar 2011 18:21:18 +0000 (14:21 -0400)
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: Josef Bacik <josef@redhat.com>

No differences found