aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/aops.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/aops.c')
-rw-r--r--fs/ocfs2/aops.c32
1 files changed, 11 insertions, 21 deletions
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index f37d3c0e2053..aeb44e879c51 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -80,6 +80,7 @@ static int ocfs2_symlink_get_block(struct inode *inode, sector_t iblock,
80 80
81 if ((u64)iblock >= ocfs2_clusters_to_blocks(inode->i_sb, 81 if ((u64)iblock >= ocfs2_clusters_to_blocks(inode->i_sb,
82 le32_to_cpu(fe->i_clusters))) { 82 le32_to_cpu(fe->i_clusters))) {
83 err = -ENOMEM;
83 mlog(ML_ERROR, "block offset is outside the allocated size: " 84 mlog(ML_ERROR, "block offset is outside the allocated size: "
84 "%llu\n", (unsigned long long)iblock); 85 "%llu\n", (unsigned long long)iblock);
85 goto bail; 86 goto bail;
@@ -92,6 +93,7 @@ static int ocfs2_symlink_get_block(struct inode *inode, sector_t iblock,
92 iblock; 93 iblock;
93 buffer_cache_bh = sb_getblk(osb->sb, blkno); 94 buffer_cache_bh = sb_getblk(osb->sb, blkno);
94 if (!buffer_cache_bh) { 95 if (!buffer_cache_bh) {
96 err = -ENOMEM;
95 mlog(ML_ERROR, "couldn't getblock for symlink!\n"); 97 mlog(ML_ERROR, "couldn't getblock for symlink!\n");
96 goto bail; 98 goto bail;
97 } 99 }
@@ -592,26 +594,11 @@ static void ocfs2_dio_end_io(struct kiocb *iocb,
592 ocfs2_rw_unlock(inode, level); 594 ocfs2_rw_unlock(inode, level);
593} 595}
594 596
595/*
596 * ocfs2_invalidatepage() and ocfs2_releasepage() are shamelessly stolen
597 * from ext3. PageChecked() bits have been removed as OCFS2 does not
598 * do journalled data.
599 */
600static void ocfs2_invalidatepage(struct page *page, unsigned int offset,
601 unsigned int length)
602{
603 journal_t *journal = OCFS2_SB(page->mapping->host->i_sb)->journal->j_journal;
604
605 jbd2_journal_invalidatepage(journal, page, offset, length);
606}
607
608static int ocfs2_releasepage(struct page *page, gfp_t wait) 597static int ocfs2_releasepage(struct page *page, gfp_t wait)
609{ 598{
610 journal_t *journal = OCFS2_SB(page->mapping->host->i_sb)->journal->j_journal;
611
612 if (!page_has_buffers(page)) 599 if (!page_has_buffers(page))
613 return 0; 600 return 0;
614 return jbd2_journal_try_to_free_buffers(journal, page, wait); 601 return try_to_free_buffers(page);
615} 602}
616 603
617static ssize_t ocfs2_direct_IO(int rw, 604static ssize_t ocfs2_direct_IO(int rw,
@@ -1802,8 +1789,7 @@ try_again:
1802 data_ac->ac_resv = &OCFS2_I(inode)->ip_la_data_resv; 1789 data_ac->ac_resv = &OCFS2_I(inode)->ip_la_data_resv;
1803 1790
1804 credits = ocfs2_calc_extend_credits(inode->i_sb, 1791 credits = ocfs2_calc_extend_credits(inode->i_sb,
1805 &di->id2.i_list, 1792 &di->id2.i_list);
1806 clusters_to_alloc);
1807 1793
1808 } 1794 }
1809 1795
@@ -1897,10 +1883,14 @@ out_commit:
1897out: 1883out:
1898 ocfs2_free_write_ctxt(wc); 1884 ocfs2_free_write_ctxt(wc);
1899 1885
1900 if (data_ac) 1886 if (data_ac) {
1901 ocfs2_free_alloc_context(data_ac); 1887 ocfs2_free_alloc_context(data_ac);
1902 if (meta_ac) 1888 data_ac = NULL;
1889 }
1890 if (meta_ac) {
1903 ocfs2_free_alloc_context(meta_ac); 1891 ocfs2_free_alloc_context(meta_ac);
1892 meta_ac = NULL;
1893 }
1904 1894
1905 if (ret == -ENOSPC && try_free) { 1895 if (ret == -ENOSPC && try_free) {
1906 /* 1896 /*
@@ -2087,7 +2077,7 @@ const struct address_space_operations ocfs2_aops = {
2087 .write_end = ocfs2_write_end, 2077 .write_end = ocfs2_write_end,
2088 .bmap = ocfs2_bmap, 2078 .bmap = ocfs2_bmap,
2089 .direct_IO = ocfs2_direct_IO, 2079 .direct_IO = ocfs2_direct_IO,
2090 .invalidatepage = ocfs2_invalidatepage, 2080 .invalidatepage = block_invalidatepage,
2091 .releasepage = ocfs2_releasepage, 2081 .releasepage = ocfs2_releasepage,
2092 .migratepage = buffer_migrate_page, 2082 .migratepage = buffer_migrate_page,
2093 .is_partially_uptodate = block_is_partially_uptodate, 2083 .is_partially_uptodate = block_is_partially_uptodate,