ext4: Move __ext4_journalled_writepage() to avoid forward declaration

In addition, fix two unused variable warnings.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>

authored by Aneesh Kumar K.V and committed by Theodore Ts'o 62e086be 43ce1d23

+54 -58
+54 -58
fs/ext4/inode.c
··· 47 48 #define MPAGE_DA_EXTENT_TAIL 0x01 49 50 - static int __ext4_journalled_writepage(struct page *page, 51 - struct writeback_control *wbc, 52 - unsigned int len); 53 - 54 static inline int ext4_begin_ordered_truncate(struct inode *inode, 55 loff_t new_size) 56 { ··· 2518 return ret; 2519 } 2520 2521 /* 2522 * Note that we don't need to start a transaction unless we're journaling data 2523 * because we should have holes filled from ext4_page_mkwrite(). We even don't ··· 2613 * Page also have the dirty flag cleared so we don't get recurive page_lock. 2614 */ 2615 static int ext4_writepage(struct page *page, 2616 - struct writeback_control *wbc) 2617 { 2618 int ret = 0; 2619 loff_t size; ··· 3217 } 3218 3219 return generic_block_bmap(mapping, block, ext4_get_block); 3220 - } 3221 - 3222 - static int bget_one(handle_t *handle, struct buffer_head *bh) 3223 - { 3224 - get_bh(bh); 3225 - return 0; 3226 - } 3227 - 3228 - static int bput_one(handle_t *handle, struct buffer_head *bh) 3229 - { 3230 - put_bh(bh); 3231 - return 0; 3232 - } 3233 - 3234 - static int __ext4_journalled_writepage(struct page *page, 3235 - struct writeback_control *wbc, 3236 - unsigned int len) 3237 - { 3238 - struct address_space *mapping = page->mapping; 3239 - struct inode *inode = mapping->host; 3240 - struct buffer_head *page_bufs; 3241 - handle_t *handle = NULL; 3242 - int ret = 0; 3243 - int err; 3244 - 3245 - page_bufs = page_buffers(page); 3246 - BUG_ON(!page_bufs); 3247 - walk_page_buffers(handle, page_bufs, 0, len, NULL, bget_one); 3248 - /* As soon as we unlock the page, it can go away, but we have 3249 - * references to buffers so we are safe */ 3250 - unlock_page(page); 3251 - 3252 - handle = ext4_journal_start(inode, ext4_writepage_trans_blocks(inode)); 3253 - if (IS_ERR(handle)) { 3254 - ret = PTR_ERR(handle); 3255 - goto out; 3256 - } 3257 - 3258 - ret = walk_page_buffers(handle, page_bufs, 0, len, NULL, 3259 - do_journal_get_write_access); 3260 - 3261 - err = walk_page_buffers(handle, page_bufs, 0, len, NULL, 3262 - write_end_fn); 3263 - if (ret == 0) 3264 - ret = err; 3265 - err = ext4_journal_stop(handle); 3266 - if (!ret) 3267 - ret = err; 3268 - 3269 - walk_page_buffers(handle, page_bufs, 0, len, NULL, bput_one); 3270 - EXT4_I(inode)->i_state |= EXT4_STATE_JDATA; 3271 - out: 3272 - return ret; 3273 } 3274 3275 static int ext4_readpage(struct file *file, struct page *page)
··· 47 48 #define MPAGE_DA_EXTENT_TAIL 0x01 49 50 static inline int ext4_begin_ordered_truncate(struct inode *inode, 51 loff_t new_size) 52 { ··· 2522 return ret; 2523 } 2524 2525 + static int bget_one(handle_t *handle, struct buffer_head *bh) 2526 + { 2527 + get_bh(bh); 2528 + return 0; 2529 + } 2530 + 2531 + static int bput_one(handle_t *handle, struct buffer_head *bh) 2532 + { 2533 + put_bh(bh); 2534 + return 0; 2535 + } 2536 + 2537 + static int __ext4_journalled_writepage(struct page *page, 2538 + struct writeback_control *wbc, 2539 + unsigned int len) 2540 + { 2541 + struct address_space *mapping = page->mapping; 2542 + struct inode *inode = mapping->host; 2543 + struct buffer_head *page_bufs; 2544 + handle_t *handle = NULL; 2545 + int ret = 0; 2546 + int err; 2547 + 2548 + page_bufs = page_buffers(page); 2549 + BUG_ON(!page_bufs); 2550 + walk_page_buffers(handle, page_bufs, 0, len, NULL, bget_one); 2551 + /* As soon as we unlock the page, it can go away, but we have 2552 + * references to buffers so we are safe */ 2553 + unlock_page(page); 2554 + 2555 + handle = ext4_journal_start(inode, ext4_writepage_trans_blocks(inode)); 2556 + if (IS_ERR(handle)) { 2557 + ret = PTR_ERR(handle); 2558 + goto out; 2559 + } 2560 + 2561 + ret = walk_page_buffers(handle, page_bufs, 0, len, NULL, 2562 + do_journal_get_write_access); 2563 + 2564 + err = walk_page_buffers(handle, page_bufs, 0, len, NULL, 2565 + write_end_fn); 2566 + if (ret == 0) 2567 + ret = err; 2568 + err = ext4_journal_stop(handle); 2569 + if (!ret) 2570 + ret = err; 2571 + 2572 + walk_page_buffers(handle, page_bufs, 0, len, NULL, bput_one); 2573 + EXT4_I(inode)->i_state |= EXT4_STATE_JDATA; 2574 + out: 2575 + return ret; 2576 + } 2577 + 2578 /* 2579 * Note that we don't need to start a transaction unless we're journaling data 2580 * because we should have holes filled from ext4_page_mkwrite(). We even don't ··· 2564 * Page also have the dirty flag cleared so we don't get recurive page_lock. 2565 */ 2566 static int ext4_writepage(struct page *page, 2567 + struct writeback_control *wbc) 2568 { 2569 int ret = 0; 2570 loff_t size; ··· 3168 } 3169 3170 return generic_block_bmap(mapping, block, ext4_get_block); 3171 } 3172 3173 static int ext4_readpage(struct file *file, struct page *page)