Skip to content

Commit

Permalink
ocfs2: simplify ocfs2_invalidatepage() and ocfs2_releasepage()
Browse files Browse the repository at this point in the history
Ocfs2 doesn't do data journalling.  Thus its ->invalidatepage and
->releasepage functions never get called on buffers that have journal
heads attached.  So just use standard variants of functions from
buffer.c.

Signed-off-by: Jan Kara <[email protected]>
Cc: Joel Becker <[email protected]>
Cc: Mark Fasheh <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
jankara authored and torvalds committed Nov 13, 2013
1 parent d00d2f8 commit 41ecc34
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions fs/ocfs2/aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,26 +594,11 @@ static void ocfs2_dio_end_io(struct kiocb *iocb,
ocfs2_rw_unlock(inode, level);
}

/*
* ocfs2_invalidatepage() and ocfs2_releasepage() are shamelessly stolen
* from ext3. PageChecked() bits have been removed as OCFS2 does not
* do journalled data.
*/
static void ocfs2_invalidatepage(struct page *page, unsigned int offset,
unsigned int length)
{
journal_t *journal = OCFS2_SB(page->mapping->host->i_sb)->journal->j_journal;

jbd2_journal_invalidatepage(journal, page, offset, length);
}

static int ocfs2_releasepage(struct page *page, gfp_t wait)
{
journal_t *journal = OCFS2_SB(page->mapping->host->i_sb)->journal->j_journal;

if (!page_has_buffers(page))
return 0;
return jbd2_journal_try_to_free_buffers(journal, page, wait);
return try_to_free_buffers(page);
}

static ssize_t ocfs2_direct_IO(int rw,
Expand Down Expand Up @@ -2092,7 +2077,7 @@ const struct address_space_operations ocfs2_aops = {
.write_end = ocfs2_write_end,
.bmap = ocfs2_bmap,
.direct_IO = ocfs2_direct_IO,
.invalidatepage = ocfs2_invalidatepage,
.invalidatepage = block_invalidatepage,
.releasepage = ocfs2_releasepage,
.migratepage = buffer_migrate_page,
.is_partially_uptodate = block_is_partially_uptodate,
Expand Down

0 comments on commit 41ecc34

Please sign in to comment.