]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: punch hole past the end of the file
authorMiao Xie <miaox@cn.fujitsu.com>
Wed, 5 Dec 2012 10:54:52 +0000 (10:54 +0000)
committerChris Mason <chris.mason@fusionio.com>
Mon, 17 Dec 2012 01:46:20 +0000 (20:46 -0500)
commit44df04ba773d87298ec91ce61c801a42270ce317
treec4ee079d8f66cd23ac58f770f618a02f419dd01e
parentf64f8bb1909770db301dd071876a2a5f33ef9362
Btrfs: punch hole past the end of the file

Since we can pre-allocate the space past EOF, we should be able to reclaim
that space if we need. This patch implements it by removing the EOF check.

Though the manual of fallocate command says we can use truncate command to
reclaim the pre-allocated space which past EOF, but because truncate command
changes the file size, we must run several commands to reclaim the space if we
don't want to change the file size, so it is not a good choice.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/file.c