Commit 3ecdb3a1 authored by Theodore Ts'o's avatar Theodore Ts'o

ext4: inline walk_page_buffers() into mpage_da_submit_io

Expand the call:

  if (walk_page_buffers(NULL, page_bufs, 0, len, NULL,
                        ext4_bh_delay_or_unwritten))
	goto redirty_page

into mpage_da_submit_io().

This will allow us to merge in mpage_put_bnr_to_bhs() in the next
patch.
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent cb20d518
...@@ -2011,8 +2011,8 @@ static int mpage_da_submit_io(struct mpage_da_data *mpd) ...@@ -2011,8 +2011,8 @@ static int mpage_da_submit_io(struct mpage_da_data *mpd)
struct inode *inode = mpd->inode; struct inode *inode = mpd->inode;
struct address_space *mapping = inode->i_mapping; struct address_space *mapping = inode->i_mapping;
loff_t size = i_size_read(inode); loff_t size = i_size_read(inode);
unsigned int len; unsigned int len, block_start;
struct buffer_head *page_bufs = NULL; struct buffer_head *bh, *page_bufs = NULL;
int journal_data = ext4_should_journal_data(inode); int journal_data = ext4_should_journal_data(inode);
BUG_ON(mpd->next_page <= mpd->first_page); BUG_ON(mpd->next_page <= mpd->first_page);
...@@ -2064,15 +2064,17 @@ static int mpage_da_submit_io(struct mpage_da_data *mpd) ...@@ -2064,15 +2064,17 @@ static int mpage_da_submit_io(struct mpage_da_data *mpd)
} }
commit_write = 1; commit_write = 1;
} }
page_bufs = page_buffers(page);
if (walk_page_buffers(NULL, page_bufs, 0, len, NULL, bh = page_bufs = page_buffers(page);
ext4_bh_delay_or_unwritten)) { block_start = 0;
/* do {
* We couldn't do block allocation for /* redirty page if block allocation undone */
* some reason. if (!bh || buffer_delay(bh) ||
*/ buffer_unwritten(bh))
goto redirty_page; goto redirty_page;
} bh = bh->b_this_page;
block_start += bh->b_size;
} while ((bh != page_bufs) && (block_start < len));
if (commit_write) if (commit_write)
/* mark the buffer_heads as dirty & uptodate */ /* mark the buffer_heads as dirty & uptodate */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment