diff options
author | Eric Whitney <enwlinux@gmail.com> | 2018-10-01 20:17:41 +0200 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2018-10-01 20:17:41 +0200 |
commit | 1dc0aa46e74a3366e12f426b7caaca477853e9c3 (patch) | |
tree | 7da00fca5375a302a3711f24ca3af44af0a5e7c8 /fs/ext4/super.c | |
parent | ext4: generalize extents status tree search functions (diff) | |
download | linux-1dc0aa46e74a3366e12f426b7caaca477853e9c3.tar.xz linux-1dc0aa46e74a3366e12f426b7caaca477853e9c3.zip |
ext4: add new pending reservation mechanism
Add new pending reservation mechanism to help manage reserved cluster
accounting. Its primary function is to avoid the need to read extents
from the disk when invalidating pages as a result of a truncate, punch
hole, or collapse range operation.
Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 1145109968ef..faf293ed8060 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1040,6 +1040,7 @@ static struct inode *ext4_alloc_inode(struct super_block *sb) ei->i_da_metadata_calc_len = 0; ei->i_da_metadata_calc_last_lblock = 0; spin_lock_init(&(ei->i_block_reservation_lock)); + ext4_init_pending_tree(&ei->i_pending_tree); #ifdef CONFIG_QUOTA ei->i_reserved_quota = 0; memset(&ei->i_dquot, 0, sizeof(ei->i_dquot)); @@ -5954,6 +5955,10 @@ static int __init ext4_init_fs(void) if (err) return err; + err = ext4_init_pending(); + if (err) + goto out6; + err = ext4_init_pageio(); if (err) goto out5; @@ -5992,6 +5997,8 @@ out3: out4: ext4_exit_pageio(); out5: + ext4_exit_pending(); +out6: ext4_exit_es(); return err; @@ -6009,6 +6016,7 @@ static void __exit ext4_exit_fs(void) ext4_exit_system_zone(); ext4_exit_pageio(); ext4_exit_es(); + ext4_exit_pending(); } MODULE_AUTHOR("Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others"); |