]> bbs.cooldavid.org Git - net-next-2.6.git/commit
Btrfs: cache values for locking extents
authorChris Mason <chris.mason@oracle.com>
Wed, 2 Sep 2009 19:04:12 +0000 (15:04 -0400)
committerChris Mason <chris.mason@oracle.com>
Fri, 11 Sep 2009 17:31:06 +0000 (13:31 -0400)
commit2c64c53d8d30d43d0670482503a3914dfd3d6d46
treecfe7bfa8f5dc4078f8c995f305229622e25572b1
parent1edbb734b4e010974c41d2859d22a43d04f5f1cf
Btrfs: cache values for locking extents

Many of the btrfs extent state tree users follow the same pattern.
They lock an extent range in the tree, do some operation and then
unlock.

This translates to at least 2 rbtree searches, and maybe more if they
are doing operations on the extent state tree.  A locked extent
in the tree isn't going to be merged or changed, and so we can
safely return the extent state structure as a cached handle.

This changes set_extent_bit to give back a cached handle, and also
changes both set_extent_bit and clear_extent_bit to use the cached
handle if it is available.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/extent_io.c
fs/btrfs/extent_io.h
fs/btrfs/inode.c