aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/aops.c
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2008-09-03 23:03:41 -0400
committerMark Fasheh <mfasheh@suse.com>2008-10-13 20:02:43 -0400
commit2b4e30fbde425828b17f0e9c8f8e3fd3ecb2bc75 (patch)
tree5b340cde72e058b51642f0c7255818f62014bc91 /fs/ocfs2/aops.c
parent12462f1d9f0b96389497438dc2730c6f7410be82 (diff)
ocfs2: Switch over to JBD2.
ocfs2 wants JBD2 for many reasons, not the least of which is that JBD is limiting our maximum filesystem size. It's a pretty trivial change. Most functions are just renamed. The only functional change is moving to Jan's inode-based ordered data mode. It's better, too. Because JBD2 reads and writes JBD journals, this is compatible with any existing filesystem. It can even interact with JBD-based ocfs2 as long as the journal is formated for JBD. We provide a compatibility option so that paranoid people can still use JBD for the time being. This will go away shortly. [ Moved call of ocfs2_begin_ordered_truncate() from ocfs2_delete_inode() to ocfs2_truncate_for_delete(). --Mark ] Signed-off-by: Joel Becker <joel.becker@oracle.com> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/aops.c')
-rw-r--r--fs/ocfs2/aops.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index 259775eedb8..de179054a74 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -485,11 +485,14 @@ handle_t *ocfs2_start_walk_page_trans(struct inode *inode,
485 } 485 }
486 486
487 if (ocfs2_should_order_data(inode)) { 487 if (ocfs2_should_order_data(inode)) {
488 ret = ocfs2_jbd2_file_inode(handle, inode);
489#ifdef CONFIG_OCFS2_COMPAT_JBD
488 ret = walk_page_buffers(handle, 490 ret = walk_page_buffers(handle,
489 page_buffers(page), 491 page_buffers(page),
490 from, to, NULL, 492 from, to, NULL,
491 ocfs2_journal_dirty_data); 493 ocfs2_journal_dirty_data);
492 if (ret < 0) 494#endif
495 if (ret < 0)
493 mlog_errno(ret); 496 mlog_errno(ret);
494 } 497 }
495out: 498out:
@@ -669,7 +672,7 @@ static void ocfs2_invalidatepage(struct page *page, unsigned long offset)
669{ 672{
670 journal_t *journal = OCFS2_SB(page->mapping->host->i_sb)->journal->j_journal; 673 journal_t *journal = OCFS2_SB(page->mapping->host->i_sb)->journal->j_journal;
671 674
672 journal_invalidatepage(journal, page, offset); 675 jbd2_journal_invalidatepage(journal, page, offset);
673} 676}
674 677
675static int ocfs2_releasepage(struct page *page, gfp_t wait) 678static int ocfs2_releasepage(struct page *page, gfp_t wait)
@@ -678,7 +681,7 @@ static int ocfs2_releasepage(struct page *page, gfp_t wait)
678 681
679 if (!page_has_buffers(page)) 682 if (!page_has_buffers(page))
680 return 0; 683 return 0;
681 return journal_try_to_free_buffers(journal, page, wait); 684 return jbd2_journal_try_to_free_buffers(journal, page, wait);
682} 685}
683 686
684static ssize_t ocfs2_direct_IO(int rw, 687static ssize_t ocfs2_direct_IO(int rw,
@@ -1074,11 +1077,15 @@ static void ocfs2_write_failure(struct inode *inode,
1074 tmppage = wc->w_pages[i]; 1077 tmppage = wc->w_pages[i];
1075 1078
1076 if (page_has_buffers(tmppage)) { 1079 if (page_has_buffers(tmppage)) {
1077 if (ocfs2_should_order_data(inode)) 1080 if (ocfs2_should_order_data(inode)) {
1081 ocfs2_jbd2_file_inode(wc->w_handle, inode);
1082#ifdef CONFIG_OCFS2_COMPAT_JBD
1078 walk_page_buffers(wc->w_handle, 1083 walk_page_buffers(wc->w_handle,
1079 page_buffers(tmppage), 1084 page_buffers(tmppage),
1080 from, to, NULL, 1085 from, to, NULL,
1081 ocfs2_journal_dirty_data); 1086 ocfs2_journal_dirty_data);
1087#endif
1088 }
1082 1089
1083 block_commit_write(tmppage, from, to); 1090 block_commit_write(tmppage, from, to);
1084 } 1091 }
@@ -1917,11 +1924,15 @@ int ocfs2_write_end_nolock(struct address_space *mapping,
1917 } 1924 }
1918 1925
1919 if (page_has_buffers(tmppage)) { 1926 if (page_has_buffers(tmppage)) {
1920 if (ocfs2_should_order_data(inode)) 1927 if (ocfs2_should_order_data(inode)) {
1928 ocfs2_jbd2_file_inode(wc->w_handle, inode);
1929#ifdef CONFIG_OCFS2_COMPAT_JBD
1921 walk_page_buffers(wc->w_handle, 1930 walk_page_buffers(wc->w_handle,
1922 page_buffers(tmppage), 1931 page_buffers(tmppage),
1923 from, to, NULL, 1932 from, to, NULL,
1924 ocfs2_journal_dirty_data); 1933 ocfs2_journal_dirty_data);
1934#endif
1935 }
1925 block_commit_write(tmppage, from, to); 1936 block_commit_write(tmppage, from, to);
1926 } 1937 }
1927 } 1938 }