]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: add cancellation points to defrag
authorDavid Sterba <dsterba@suse.cz>
Sat, 9 Feb 2013 23:38:06 +0000 (23:38 +0000)
committerJosef Bacik <jbacik@fusionio.com>
Wed, 20 Feb 2013 17:59:51 +0000 (12:59 -0500)
commit77b11eef44210d909da9e47735500daa7cb64cb9
tree57c9c8123a46a1170abba0fc476ded82eac442ed
parent45a30b42e035b5aa8389e158b4202bced2d9fb8d
btrfs: add cancellation points to defrag

The defrag operation can take very long, we want to have a way how to
cancel it. The code checks for a pending signal at safe points in the
defrag loops and returns EAGAIN. This means a user can press ^C after
running 'btrfs fi defrag', woks for both defrag modes, files and root.

Returning from the command was instant in my light tests, but may take
longer depending on the aging factor of the filesystem.

Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/ctree.h
fs/btrfs/ioctl.c
fs/btrfs/transaction.c