diff options
author | Lukas Czerner <lczerner@redhat.com> | 2010-11-22 11:29:17 (GMT) |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2011-01-10 18:03:58 (GMT) |
commit | b853b96b1dbdc05fc8eae141a595366d8172962b (patch) | |
tree | d0f7eb47da8263f2ac35554ead88a8cf70cd99cf /include/linux/ext3_fs.h | |
parent | ad1857a0e0cb29313efae3bb69c913b2c3c833a1 (diff) | |
download | linux-fsl-qoriq-b853b96b1dbdc05fc8eae141a595366d8172962b.tar.xz |
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>
Diffstat (limited to 'include/linux/ext3_fs.h')
-rw-r--r-- | include/linux/ext3_fs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 6ce1bca..a443965 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h @@ -856,6 +856,7 @@ extern struct ext3_group_desc * ext3_get_group_desc(struct super_block * sb, extern int ext3_should_retry_alloc(struct super_block *sb, int *retries); extern void ext3_init_block_alloc_info(struct inode *); extern void ext3_rsv_window_add(struct super_block *sb, struct ext3_reserve_window_node *rsv); +extern int ext3_trim_fs(struct super_block *sb, struct fstrim_range *range); /* dir.c */ extern int ext3_check_dir_entry(const char *, struct inode *, |