]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitb3c2bf71e6c3f3b58469462ddb50f34cd01c58ae
tree8f0cfe52ba0b3fb8a6ed3cc5d3e7449369b0b9a5
parentcec40a0a4176a228dd365175275b124492f5ed03
Btrfs: change reserved_extents to an atomic_t

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>
fs/btrfs/btrfs_inode.h
fs/btrfs/extent-tree.c
fs/btrfs/inode.c