diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-02-09 12:02:44 -0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-02-11 17:04:48 -0800 |
commit | f7ef9b83b583640111039b30e13263b71c3a6ed5 (patch) | |
tree | 712cb50392f1b1a2d922a991fa63acf8d5c3c553 /fs/f2fs/file.c | |
parent | da17eece035d72cb50d48529744a490784f29d2f (diff) | |
download | lwn-f7ef9b83b583640111039b30e13263b71c3a6ed5.tar.gz lwn-f7ef9b83b583640111039b30e13263b71c3a6ed5.zip |
f2fs: introduce macros to convert bytes and blocks in f2fs
This patch adds two macros for transition between byte and block offsets.
Currently, f2fs only supports 4KB blocks, so use the default size for now.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r-- | fs/f2fs/file.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 7188a2ac64b5..f3b007540a48 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -491,8 +491,7 @@ int truncate_blocks(struct inode *inode, u64 from, bool lock) trace_f2fs_truncate_blocks_enter(inode, from); - free_from = (pgoff_t) - ((from + blocksize - 1) >> (sbi->log_blocksize)); + free_from = (pgoff_t)F2FS_BYTES_TO_BLK(from + blocksize - 1); if (lock) f2fs_lock_op(sbi); |