]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
Btrfs: faster/more efficient insertion of file extent items
authorFilipe David Borba Manana <fdmanana@gmail.com>
Sun, 9 Feb 2014 23:45:12 +0000 (23:45 +0000)
committerJosef Bacik <jbacik@fb.com>
Mon, 10 Mar 2014 19:16:37 +0000 (15:16 -0400)
commitd5f375270aa55794f4a7196b5247469f86278a8f
tree7dc16bffd23b6665f4bc2c3702a40b4e269900fa
parent51b98effa4c673feaa7237ba87645ea60d8f3578
Btrfs: faster/more efficient insertion of file extent items

This is an extension to my previous commit titled:

  "Btrfs: faster file extent item replace operations"
  (hash 1acae57b161ef1282f565ef907f72aeed0eb71d9)

Instead of inserting the new file extent item if we deleted existing
file extent items covering our target file range, also allow to insert
the new file extent item if we didn't find any existing items to delete
and replace_extent != 0, since in this case our caller would do another
tree search to insert the new file extent item anyway, therefore just
combine the two tree searches into a single one, saving cpu time, reducing
lock contention and reducing btree node/leaf COW operations.

This covers the case where applications keep doing tail append writes to
files, which for example is the case of Apache CouchDB (its database and
view index files are always open with O_APPEND).

Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
fs/btrfs/file.c