diff options
author | Jan Kara <jack@suse.com> | 2015-12-07 23:09:35 +0300 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2015-12-07 23:09:35 +0300 |
commit | 53085fac02d12fcd29a9cb074ec480ff0f77ae5c (patch) | |
tree | 52b3a182a397ee36470e44b5deb4633f67c1478b /fs/ext4/extents.c | |
parent | 2dcba4781fa3842e28f47ab23056d58cd283fca6 (diff) | |
download | linux-53085fac02d12fcd29a9cb074ec480ff0f77ae5c.tar.xz |
ext4: provide ext4_issue_zeroout()
Create new function ext4_issue_zeroout() to zeroout contiguous (both
logically and physically) part of inode data. We will need to issue
zeroout when extent structure is not readily available and this function
will allow us to do it without making up fake extent structures.
Signed-off-by: Jan Kara <jack@suse.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r-- | fs/ext4/extents.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 3578b25fccfd..867e98b6bc6c 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -3119,19 +3119,11 @@ static int ext4_ext_zeroout(struct inode *inode, struct ext4_extent *ex) { ext4_fsblk_t ee_pblock; unsigned int ee_len; - int ret; ee_len = ext4_ext_get_actual_len(ex); ee_pblock = ext4_ext_pblock(ex); - - if (ext4_encrypted_inode(inode)) - return ext4_encrypted_zeroout(inode, ex); - - ret = sb_issue_zeroout(inode->i_sb, ee_pblock, ee_len, GFP_NOFS); - if (ret > 0) - ret = 0; - - return ret; + return ext4_issue_zeroout(inode, le32_to_cpu(ex->ee_block), ee_pblock, + ee_len); } /* |