]> Pileus Git - ~andy/linux/blobdiff - fs/ocfs2/aops.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arjan/linux...
[~andy/linux] / fs / ocfs2 / aops.c
index 259775eedb85a2992ffa19dc5d036ba34879d7c6..c22543b3342062f0308ec06a6f74f2334291727f 100644 (file)
@@ -68,9 +68,7 @@ static int ocfs2_symlink_get_block(struct inode *inode, sector_t iblock,
                goto bail;
        }
 
-       status = ocfs2_read_block(OCFS2_SB(inode->i_sb),
-                                 OCFS2_I(inode)->ip_blkno,
-                                 &bh, OCFS2_BH_CACHED, inode);
+       status = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &bh);
        if (status < 0) {
                mlog_errno(status);
                goto bail;
@@ -128,8 +126,7 @@ static int ocfs2_symlink_get_block(struct inode *inode, sector_t iblock,
        err = 0;
 
 bail:
-       if (bh)
-               brelse(bh);
+       brelse(bh);
 
        mlog_exit(err);
        return err;
@@ -261,13 +258,11 @@ static int ocfs2_readpage_inline(struct inode *inode, struct page *page)
 {
        int ret;
        struct buffer_head *di_bh = NULL;
-       struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
 
        BUG_ON(!PageLocked(page));
        BUG_ON(!(OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL));
 
-       ret = ocfs2_read_block(osb, OCFS2_I(inode)->ip_blkno, &di_bh,
-                              OCFS2_BH_CACHED, inode);
+       ret = ocfs2_read_block(inode, OCFS2_I(inode)->ip_blkno, &di_bh);
        if (ret) {
                mlog_errno(ret);
                goto out;
@@ -485,11 +480,14 @@ handle_t *ocfs2_start_walk_page_trans(struct inode *inode,
        }
 
        if (ocfs2_should_order_data(inode)) {
+               ret = ocfs2_jbd2_file_inode(handle, inode);
+#ifdef CONFIG_OCFS2_COMPAT_JBD
                ret = walk_page_buffers(handle,
                                        page_buffers(page),
                                        from, to, NULL,
                                        ocfs2_journal_dirty_data);
-               if (ret < 0) 
+#endif
+               if (ret < 0)
                        mlog_errno(ret);
        }
 out:
@@ -669,7 +667,7 @@ static void ocfs2_invalidatepage(struct page *page, unsigned long offset)
 {
        journal_t *journal = OCFS2_SB(page->mapping->host->i_sb)->journal->j_journal;
 
-       journal_invalidatepage(journal, page, offset);
+       jbd2_journal_invalidatepage(journal, page, offset);
 }
 
 static int ocfs2_releasepage(struct page *page, gfp_t wait)
@@ -678,7 +676,7 @@ static int ocfs2_releasepage(struct page *page, gfp_t wait)
 
        if (!page_has_buffers(page))
                return 0;
-       return journal_try_to_free_buffers(journal, page, wait);
+       return jbd2_journal_try_to_free_buffers(journal, page, wait);
 }
 
 static ssize_t ocfs2_direct_IO(int rw,
@@ -1074,11 +1072,15 @@ static void ocfs2_write_failure(struct inode *inode,
                tmppage = wc->w_pages[i];
 
                if (page_has_buffers(tmppage)) {
-                       if (ocfs2_should_order_data(inode))
+                       if (ocfs2_should_order_data(inode)) {
+                               ocfs2_jbd2_file_inode(wc->w_handle, inode);
+#ifdef CONFIG_OCFS2_COMPAT_JBD
                                walk_page_buffers(wc->w_handle,
                                                  page_buffers(tmppage),
                                                  from, to, NULL,
                                                  ocfs2_journal_dirty_data);
+#endif
+                       }
 
                        block_commit_write(tmppage, from, to);
                }
@@ -1917,11 +1919,15 @@ int ocfs2_write_end_nolock(struct address_space *mapping,
                }
 
                if (page_has_buffers(tmppage)) {
-                       if (ocfs2_should_order_data(inode))
+                       if (ocfs2_should_order_data(inode)) {
+                               ocfs2_jbd2_file_inode(wc->w_handle, inode);
+#ifdef CONFIG_OCFS2_COMPAT_JBD
                                walk_page_buffers(wc->w_handle,
                                                  page_buffers(tmppage),
                                                  from, to, NULL,
                                                  ocfs2_journal_dirty_data);
+#endif
+                       }
                        block_commit_write(tmppage, from, to);
                }
        }