summaryrefslogtreecommitdiff
path: root/fs/f2fs/file.c
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2018-03-20 18:08:29 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2018-03-28 06:09:32 +0300
commitdf033caf51c01edf3d2bfc61b41a9f1e566743ed (patch)
tree2cb6bf6d09b90fc21649e2a5a82ee0a1a9829281 /fs/f2fs/file.c
parent0833721ec3658a4e9d5e58b6fa82cf9edc431e59 (diff)
downloadlinux-df033caf51c01edf3d2bfc61b41a9f1e566743ed.tar.xz
f2fs: clean up with F2FS_BLK_ALIGN
Clean up F2FS_BYTES_TO_BLK(x + F2FS_BLKSIZE - 1) with F2FS_BLK_ALIGN(x). Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r--fs/f2fs/file.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index ee88058acd63..8068b015ece5 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -573,7 +573,6 @@ truncate_out:
int truncate_blocks(struct inode *inode, u64 from, bool lock)
{
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
- unsigned int blocksize = inode->i_sb->s_blocksize;
struct dnode_of_data dn;
pgoff_t free_from;
int count = 0, err = 0;
@@ -582,7 +581,7 @@ int truncate_blocks(struct inode *inode, u64 from, bool lock)
trace_f2fs_truncate_blocks_enter(inode, from);
- free_from = (pgoff_t)F2FS_BYTES_TO_BLK(from + blocksize - 1);
+ free_from = (pgoff_t)F2FS_BLK_ALIGN(from);
if (free_from >= sbi->max_file_blocks)
goto free_partial;