diff options
| author | Josef Bacik <[email protected]> | 2011-01-25 21:30:38 +0000 |
|---|---|---|
| committer | Josef Bacik <[email protected]> | 2011-03-17 18:21:18 +0000 |
| commit | 57a45ced94fe48a701361d64230fc16eefa189dd (patch) | |
| tree | 8f0cfe52ba0b3fb8a6ed3cc5d3e7449369b0b9a5 /fs/btrfs/btrfs_inode.h | |
| parent | Btrfs: fix how we deal with the pages array in the write path (diff) | |
| download | kernel-57a45ced94fe48a701361d64230fc16eefa189dd.tar.gz kernel-57a45ced94fe48a701361d64230fc16eefa189dd.zip | |
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 <[email protected]>
Diffstat (limited to 'fs/btrfs/btrfs_inode.h')
| -rw-r--r-- | fs/btrfs/btrfs_inode.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index ccc991c542df..57c3bb2884ce 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h @@ -136,9 +136,8 @@ struct btrfs_inode { * items we think we'll end up using, and reserved_extents is the number * of extent items we've reserved metadata for. */ - spinlock_t accounting_lock; atomic_t outstanding_extents; - int reserved_extents; + atomic_t reserved_extents; /* * ordered_data_close is set by truncate when a file that used |
