aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/ops_address.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/ops_address.c')
-rw-r--r--fs/gfs2/ops_address.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c
index ac5659521386..9ab35a9ee75a 100644
--- a/fs/gfs2/ops_address.c
+++ b/fs/gfs2/ops_address.c
@@ -137,7 +137,9 @@ static int gfs2_writepage(struct page *page, struct writeback_control *wbc)
137 return 0; /* don't care */ 137 return 0; /* don't care */
138 } 138 }
139 139
140 if (sdp->sd_args.ar_data == GFS2_DATA_ORDERED || gfs2_is_jdata(ip)) { 140 if ((sdp->sd_args.ar_data == GFS2_DATA_ORDERED || gfs2_is_jdata(ip)) &&
141 PageChecked(page)) {
142 ClearPageChecked(page);
141 error = gfs2_trans_begin(sdp, RES_DINODE + 1, 0); 143 error = gfs2_trans_begin(sdp, RES_DINODE + 1, 0);
142 if (error) 144 if (error)
143 goto out_ignore; 145 goto out_ignore;
@@ -574,6 +576,23 @@ fail_nounlock:
574} 576}
575 577
576/** 578/**
579 * gfs2_set_page_dirty - Page dirtying function
580 * @page: The page to dirty
581 *
582 * Returns: 1 if it dirtyed the page, or 0 otherwise
583 */
584
585static int gfs2_set_page_dirty(struct page *page)
586{
587 struct gfs2_inode *ip = GFS2_I(page->mapping->host);
588 struct gfs2_sbd *sdp = GFS2_SB(page->mapping->host);
589
590 if (sdp->sd_args.ar_data == GFS2_DATA_ORDERED || gfs2_is_jdata(ip))
591 SetPageChecked(page);
592 return __set_page_dirty_buffers(page);
593}
594
595/**
577 * gfs2_bmap - Block map function 596 * gfs2_bmap - Block map function
578 * @mapping: Address space info 597 * @mapping: Address space info
579 * @lblock: The block to map 598 * @lblock: The block to map
@@ -609,6 +628,8 @@ static void discard_buffer(struct gfs2_sbd *sdp, struct buffer_head *bh)
609 if (bd) { 628 if (bd) {
610 bd->bd_bh = NULL; 629 bd->bd_bh = NULL;
611 bh->b_private = NULL; 630 bh->b_private = NULL;
631 if (!bd->bd_ail && list_empty(&bd->bd_le.le_list))
632 kmem_cache_free(gfs2_bufdata_cachep, bd);
612 } 633 }
613 gfs2_log_unlock(sdp); 634 gfs2_log_unlock(sdp);
614 635
@@ -629,6 +650,8 @@ static void gfs2_invalidatepage(struct page *page, unsigned long offset)
629 unsigned int curr_off = 0; 650 unsigned int curr_off = 0;
630 651
631 BUG_ON(!PageLocked(page)); 652 BUG_ON(!PageLocked(page));
653 if (offset == 0)
654 ClearPageChecked(page);
632 if (!page_has_buffers(page)) 655 if (!page_has_buffers(page))
633 return; 656 return;
634 657
@@ -841,6 +864,7 @@ const struct address_space_operations gfs2_file_aops = {
841 .sync_page = block_sync_page, 864 .sync_page = block_sync_page,
842 .prepare_write = gfs2_prepare_write, 865 .prepare_write = gfs2_prepare_write,
843 .commit_write = gfs2_commit_write, 866 .commit_write = gfs2_commit_write,
867 .set_page_dirty = gfs2_set_page_dirty,
844 .bmap = gfs2_bmap, 868 .bmap = gfs2_bmap,
845 .invalidatepage = gfs2_invalidatepage, 869 .invalidatepage = gfs2_invalidatepage,
846 .releasepage = gfs2_releasepage, 870 .releasepage = gfs2_releasepage,