diff options
author | Jan Kara <jack@suse.com> | 2015-12-07 15:09:35 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2015-12-07 15:09:35 -0500 |
commit | 53085fac02d12fcd29a9cb074ec480ff0f77ae5c (patch) | |
tree | 52b3a182a397ee36470e44b5deb4633f67c1478b /fs/ext4/inode.c | |
parent | 2dcba4781fa3842e28f47ab23056d58cd283fca6 (diff) | |
download | blackbird-obmc-linux-53085fac02d12fcd29a9cb074ec480ff0f77ae5c.tar.gz blackbird-obmc-linux-53085fac02d12fcd29a9cb074ec480ff0f77ae5c.zip |
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/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index f100c1780e03..0c9a5ee3e106 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -383,6 +383,21 @@ static int __check_block_validity(struct inode *inode, const char *func, return 0; } +int ext4_issue_zeroout(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk, + ext4_lblk_t len) +{ + int ret; + + if (ext4_encrypted_inode(inode)) + return ext4_encrypted_zeroout(inode, lblk, pblk, len); + + ret = sb_issue_zeroout(inode->i_sb, pblk, len, GFP_NOFS); + if (ret > 0) + ret = 0; + + return ret; +} + #define check_block_validity(inode, map) \ __check_block_validity((inode), __func__, __LINE__, (map)) |