diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2018-06-04 08:56:51 -0400 |
---|---|---|
committer | Bob Peterson <rpeterso@redhat.com> | 2018-06-04 08:56:51 -0400 |
commit | 628e366df11c0a61487522ec1d4bca5c77fe9083 (patch) | |
tree | fe32126aa08767b5621741b63b096af966604f9d /fs/gfs2/file.c | |
parent | 845802b112eeedfa32b2ebba694996a49677596e (diff) |
gfs2: Iomap cleanups and improvements
Clean up gfs2_iomap_alloc and gfs2_iomap_get. Document how
gfs2_iomap_alloc works: it now needs to be called separately after
gfs2_iomap_get where necessary; this will be used later by iomap write.
Move gfs2_iomap_ops into bmap.c.
Introduce a new gfs2_iomap_get_alloc helper and use it in
fallocate_chunk: gfs2_iomap_begin will become unsuitable for fallocate
with proper iomap write support.
In gfs2_block_map and fallocate_chunk, zero-initialize struct iomap.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Diffstat (limited to 'fs/gfs2/file.c')
-rw-r--r-- | fs/gfs2/file.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index 4b71f021a9e2..7137db7b0119 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c | |||
@@ -733,7 +733,7 @@ static int fallocate_chunk(struct inode *inode, loff_t offset, loff_t len, | |||
733 | struct gfs2_inode *ip = GFS2_I(inode); | 733 | struct gfs2_inode *ip = GFS2_I(inode); |
734 | loff_t end = offset + len; | 734 | loff_t end = offset + len; |
735 | struct buffer_head *dibh; | 735 | struct buffer_head *dibh; |
736 | struct iomap iomap; | 736 | struct iomap iomap = { }; |
737 | int error; | 737 | int error; |
738 | 738 | ||
739 | error = gfs2_meta_inode_buffer(ip, &dibh); | 739 | error = gfs2_meta_inode_buffer(ip, &dibh); |
@@ -749,8 +749,8 @@ static int fallocate_chunk(struct inode *inode, loff_t offset, loff_t len, | |||
749 | } | 749 | } |
750 | 750 | ||
751 | while (offset < end) { | 751 | while (offset < end) { |
752 | error = gfs2_iomap_begin(inode, offset, end - offset, | 752 | error = gfs2_iomap_get_alloc(inode, offset, end - offset, |
753 | IOMAP_WRITE, &iomap); | 753 | &iomap); |
754 | if (error) | 754 | if (error) |
755 | goto out; | 755 | goto out; |
756 | offset = iomap.offset + iomap.length; | 756 | offset = iomap.offset + iomap.length; |