summaryrefslogtreecommitdiffstats
path: root/fs/ext4/file.c
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2016-09-15 11:55:01 -0400
committerTheodore Ts'o <tytso@mit.edu>2016-09-15 11:55:01 -0400
commit518eaa6387df796d54e065e04502e800cae1df80 (patch)
tree9b7ce844047f58763185a4a66cb7cd1f80666f51 /fs/ext4/file.c
parentc3fe493ccdb1f443c30155150391835004014c6a (diff)
downloadlinux-518eaa6387df796d54e065e04502e800cae1df80.tar.bz2
ext4: create EXT4_MAX_BLOCKS() macro
Create a macro to calculate length + offset -> maximum blocks This adds more readability. Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/file.c')
-rw-r--r--fs/ext4/file.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index 261ac3734c58..34acda78ce25 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -144,8 +144,7 @@ ext4_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
int err, len;
map.m_lblk = pos >> blkbits;
- map.m_len = (EXT4_BLOCK_ALIGN(pos + length, blkbits) >> blkbits)
- - map.m_lblk;
+ map.m_len = EXT4_MAX_BLOCKS(length, pos, blkbits);
len = map.m_len;
err = ext4_map_blocks(NULL, inode, &map, 0);