]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: Improve FL_KEEP_SIZE handling in fallocate
authorDavide Italiano <dccitaliano@gmail.com>
Tue, 7 Apr 2015 05:09:15 +0000 (22:09 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 4 Apr 2016 14:25:28 +0000 (16:25 +0200)
commit0b934a354611621f01b01bdef83f5004d3d9b6dd
treeb834d3ea66baeeab145c1c11dd15addf732b567f
parentcc2f4c0cc1cce51b016372ec2464570f2c9e1645
Btrfs: Improve FL_KEEP_SIZE handling in fallocate

- We call inode_size_ok() only if FL_KEEP_SIZE isn't specified.
- As an optimisation we can skip the call if (off + len)
  isn't greater than the current size of the file. This operation
  is called under the lock so the less work we do, the better.
- If we call inode_size_ok() pass to it the correct value rather
  than a more conservative estimation.

Signed-off-by: Davide Italiano <dccitaliano@gmail.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/file.c