diff options
author | Jan Kara <jack@suse.cz> | 2013-07-06 03:57:22 +0200 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2013-07-06 03:57:22 +0200 |
commit | 27d7c4ed1f7dfa3fc462e870dc60a4c9c2253f3e (patch) | |
tree | 3fee0d413a5bbf4adcd3bdccac40ba4b4ba3b2a3 | |
parent | ext4: optimize starting extent in ext4_ext_rm_leaf() (diff) | |
download | linux-27d7c4ed1f7dfa3fc462e870dc60a4c9c2253f3e.tar.xz linux-27d7c4ed1f7dfa3fc462e870dc60a4c9c2253f3e.zip |
ext4: silence warning in ext4_writepages()
The loop in mpage_map_and_submit_extent() is guaranteed to always run
at least once since the caller of mpage_map_and_submit_extent() makes
sure map->m_len > 0. So make that explicit using do-while instead of
pure while which also silences the compiler warning about
uninitialized 'err' variable.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
-rw-r--r-- | fs/ext4/inode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 0188e65e1f58..19a1643cbdfa 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2163,7 +2163,7 @@ static int mpage_map_and_submit_extent(handle_t *handle, mpd->io_submit.io_end->offset = ((loff_t)map->m_lblk) << inode->i_blkbits; - while (map->m_len) { + do { err = mpage_map_one_extent(handle, mpd); if (err < 0) { struct super_block *sb = inode->i_sb; @@ -2201,7 +2201,7 @@ static int mpage_map_and_submit_extent(handle_t *handle, err = mpage_map_and_submit_buffers(mpd); if (err < 0) return err; - } + } while (map->m_len); /* Update on-disk size after IO is submitted */ disksize = ((loff_t)mpd->first_page) << PAGE_CACHE_SHIFT; |