]> git.baikalelectronics.ru Git - kernel.git/commit
ext3: Add batched discard support for ext3
authorLukas Czerner <lczerner@redhat.com>
Mon, 22 Nov 2010 11:29:17 +0000 (12:29 +0100)
committerJan Kara <jack@suse.cz>
Mon, 10 Jan 2011 18:03:58 +0000 (19:03 +0100)
commit961c95157df61dc33650bbcb8bf978784a9b4c2d
treed0f7eb47da8263f2ac35554ead88a8cf70cd99cf
parent8facf89c94500097b446d3fccde86b7596876411
ext3: Add batched discard support for ext3

Walk through allocation groups and trim all free extents. It can be
invoked through FITRIM ioctl on the file system. The main idea is to
provide a way to trim the whole file system if needed, since some SSD's
may suffer from performance loss after the whole device was filled (it
does not mean that fs is full!).

It search for free extents in allocation groups specified by Byte range
start -> start+len. When the free extent is within this range, blocks are
marked as used and then trimmed. Afterwards these blocks are marked as
free in per-group bitmap.

[JK: Fixed up error handling and trimming of a single group]

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/ext3/balloc.c
include/linux/ext3_fs.h