diff options
Diffstat (limited to 'fs/ocfs2/aops.c')
-rw-r--r-- | fs/ocfs2/aops.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 93628b02ef5d..875c11443817 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c | |||
@@ -614,6 +614,27 @@ static void ocfs2_dio_end_io(struct kiocb *iocb, | |||
614 | ocfs2_rw_unlock(inode, 0); | 614 | ocfs2_rw_unlock(inode, 0); |
615 | } | 615 | } |
616 | 616 | ||
617 | /* | ||
618 | * ocfs2_invalidatepage() and ocfs2_releasepage() are shamelessly stolen | ||
619 | * from ext3. PageChecked() bits have been removed as OCFS2 does not | ||
620 | * do journalled data. | ||
621 | */ | ||
622 | static void ocfs2_invalidatepage(struct page *page, unsigned long offset) | ||
623 | { | ||
624 | journal_t *journal = OCFS2_SB(page->mapping->host->i_sb)->journal->j_journal; | ||
625 | |||
626 | journal_invalidatepage(journal, page, offset); | ||
627 | } | ||
628 | |||
629 | static int ocfs2_releasepage(struct page *page, gfp_t wait) | ||
630 | { | ||
631 | journal_t *journal = OCFS2_SB(page->mapping->host->i_sb)->journal->j_journal; | ||
632 | |||
633 | if (!page_has_buffers(page)) | ||
634 | return 0; | ||
635 | return journal_try_to_free_buffers(journal, page, wait); | ||
636 | } | ||
637 | |||
617 | static ssize_t ocfs2_direct_IO(int rw, | 638 | static ssize_t ocfs2_direct_IO(int rw, |
618 | struct kiocb *iocb, | 639 | struct kiocb *iocb, |
619 | const struct iovec *iov, | 640 | const struct iovec *iov, |
@@ -661,5 +682,8 @@ const struct address_space_operations ocfs2_aops = { | |||
661 | .commit_write = ocfs2_commit_write, | 682 | .commit_write = ocfs2_commit_write, |
662 | .bmap = ocfs2_bmap, | 683 | .bmap = ocfs2_bmap, |
663 | .sync_page = block_sync_page, | 684 | .sync_page = block_sync_page, |
664 | .direct_IO = ocfs2_direct_IO | 685 | .direct_IO = ocfs2_direct_IO, |
686 | .invalidatepage = ocfs2_invalidatepage, | ||
687 | .releasepage = ocfs2_releasepage, | ||
688 | .migratepage = buffer_migrate_page, | ||
665 | }; | 689 | }; |