diff options
author | Boaz Harrosh <bharrosh@panasas.com> | 2010-03-22 05:23:40 -0400 |
---|---|---|
committer | Boaz Harrosh <bharrosh@panasas.com> | 2010-05-17 06:50:50 -0400 |
commit | 200b0700420a78c3ade543761f0901985f41f96b (patch) | |
tree | 521fd32425502856bf38d81e73f4cdf49103a80f /fs/exofs | |
parent | e40152ee1e1c7a63f4777791863215e3faa37a86 (diff) |
exofs: Add default address_space_operations
All vectors of address_space_operations should be initialized
by the filesystem. Add the missing parts.
This is actually an optimization, by using
__set_page_dirty_nobuffers. The default, in case of NULL,
would be __set_page_dirty_buffers which has these extar if(s).
.releasepage && .invalidatepage should both not be called
because page_private() is NULL in exofs. Put a WARN_ON if
they are called, to indicate the Kernel has changed in this
regard, if when it does.
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Diffstat (limited to 'fs/exofs')
-rw-r--r-- | fs/exofs/inode.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/fs/exofs/inode.c b/fs/exofs/inode.c index 76d2a79ef93e..9507283be3ad 100644 --- a/fs/exofs/inode.c +++ b/fs/exofs/inode.c | |||
@@ -755,6 +755,21 @@ static int exofs_write_end(struct file *file, struct address_space *mapping, | |||
755 | return ret; | 755 | return ret; |
756 | } | 756 | } |
757 | 757 | ||
758 | static int exofs_releasepage(struct page *page, gfp_t gfp) | ||
759 | { | ||
760 | EXOFS_DBGMSG("page 0x%lx\n", page->index); | ||
761 | WARN_ON(1); | ||
762 | return try_to_free_buffers(page); | ||
763 | } | ||
764 | |||
765 | static void exofs_invalidatepage(struct page *page, unsigned long offset) | ||
766 | { | ||
767 | EXOFS_DBGMSG("page_has_buffers=>%d\n", page_has_buffers(page)); | ||
768 | WARN_ON(1); | ||
769 | |||
770 | block_invalidatepage(page, offset); | ||
771 | } | ||
772 | |||
758 | const struct address_space_operations exofs_aops = { | 773 | const struct address_space_operations exofs_aops = { |
759 | .readpage = exofs_readpage, | 774 | .readpage = exofs_readpage, |
760 | .readpages = exofs_readpages, | 775 | .readpages = exofs_readpages, |
@@ -762,6 +777,21 @@ const struct address_space_operations exofs_aops = { | |||
762 | .writepages = exofs_writepages, | 777 | .writepages = exofs_writepages, |
763 | .write_begin = exofs_write_begin_export, | 778 | .write_begin = exofs_write_begin_export, |
764 | .write_end = exofs_write_end, | 779 | .write_end = exofs_write_end, |
780 | .releasepage = exofs_releasepage, | ||
781 | .set_page_dirty = __set_page_dirty_nobuffers, | ||
782 | .invalidatepage = exofs_invalidatepage, | ||
783 | |||
784 | /* Not implemented Yet */ | ||
785 | .bmap = NULL, /* TODO: use osd's OSD_ACT_READ_MAP */ | ||
786 | .direct_IO = NULL, /* TODO: Should be trivial to do */ | ||
787 | |||
788 | /* With these NULL has special meaning or default is not exported */ | ||
789 | .sync_page = NULL, | ||
790 | .get_xip_mem = NULL, | ||
791 | .migratepage = NULL, | ||
792 | .launder_page = NULL, | ||
793 | .is_partially_uptodate = NULL, | ||
794 | .error_remove_page = NULL, | ||
765 | }; | 795 | }; |
766 | 796 | ||
767 | /****************************************************************************** | 797 | /****************************************************************************** |