diff options
author | Theodore Ts'o <tytso@mit.edu> | 2010-10-27 21:30:10 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2010-10-27 21:30:10 -0400 |
commit | 3ecdb3a193a5f224f084c04a63aa28cdccf4d7d0 (patch) | |
tree | 9949f753917004c75ddd4549c8e9741ccdbd435e /fs | |
parent | cb20d5188366f04d96d2e07b1240cc92170ade40 (diff) |
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: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext4/inode.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 97a0c35219ae..5da6cfcecd83 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -2011,8 +2011,8 @@ static int mpage_da_submit_io(struct mpage_da_data *mpd) | |||
2011 | struct inode *inode = mpd->inode; | 2011 | struct inode *inode = mpd->inode; |
2012 | struct address_space *mapping = inode->i_mapping; | 2012 | struct address_space *mapping = inode->i_mapping; |
2013 | loff_t size = i_size_read(inode); | 2013 | loff_t size = i_size_read(inode); |
2014 | unsigned int len; | 2014 | unsigned int len, block_start; |
2015 | struct buffer_head *page_bufs = NULL; | 2015 | struct buffer_head *bh, *page_bufs = NULL; |
2016 | int journal_data = ext4_should_journal_data(inode); | 2016 | int journal_data = ext4_should_journal_data(inode); |
2017 | 2017 | ||
2018 | BUG_ON(mpd->next_page <= mpd->first_page); | 2018 | BUG_ON(mpd->next_page <= mpd->first_page); |
@@ -2064,15 +2064,17 @@ static int mpage_da_submit_io(struct mpage_da_data *mpd) | |||
2064 | } | 2064 | } |
2065 | commit_write = 1; | 2065 | commit_write = 1; |
2066 | } | 2066 | } |
2067 | page_bufs = page_buffers(page); | 2067 | |
2068 | if (walk_page_buffers(NULL, page_bufs, 0, len, NULL, | 2068 | bh = page_bufs = page_buffers(page); |
2069 | ext4_bh_delay_or_unwritten)) { | 2069 | block_start = 0; |
2070 | /* | 2070 | do { |
2071 | * We couldn't do block allocation for | 2071 | /* redirty page if block allocation undone */ |
2072 | * some reason. | 2072 | if (!bh || buffer_delay(bh) || |
2073 | */ | 2073 | buffer_unwritten(bh)) |
2074 | goto redirty_page; | 2074 | goto redirty_page; |
2075 | } | 2075 | bh = bh->b_this_page; |
2076 | block_start += bh->b_size; | ||
2077 | } while ((bh != page_bufs) && (block_start < len)); | ||
2076 | 2078 | ||
2077 | if (commit_write) | 2079 | if (commit_write) |
2078 | /* mark the buffer_heads as dirty & uptodate */ | 2080 | /* mark the buffer_heads as dirty & uptodate */ |