diff options
Diffstat (limited to 'fs/ext2')
-rw-r--r-- | fs/ext2/inode.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index 63ab02aa4c52..1b102a1ccebb 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c | |||
@@ -659,6 +659,20 @@ ext2_write_begin(struct file *file, struct address_space *mapping, | |||
659 | return __ext2_write_begin(file, mapping, pos, len, flags, pagep,fsdata); | 659 | return __ext2_write_begin(file, mapping, pos, len, flags, pagep,fsdata); |
660 | } | 660 | } |
661 | 661 | ||
662 | static int | ||
663 | ext2_nobh_write_begin(struct file *file, struct address_space *mapping, | ||
664 | loff_t pos, unsigned len, unsigned flags, | ||
665 | struct page **pagep, void **fsdata) | ||
666 | { | ||
667 | /* | ||
668 | * Dir-in-pagecache still uses ext2_write_begin. Would have to rework | ||
669 | * directory handling code to pass around offsets rather than struct | ||
670 | * pages in order to make this work easily. | ||
671 | */ | ||
672 | return nobh_write_begin(file, mapping, pos, len, flags, pagep, fsdata, | ||
673 | ext2_get_block); | ||
674 | } | ||
675 | |||
662 | static int ext2_nobh_writepage(struct page *page, | 676 | static int ext2_nobh_writepage(struct page *page, |
663 | struct writeback_control *wbc) | 677 | struct writeback_control *wbc) |
664 | { | 678 | { |
@@ -710,7 +724,8 @@ const struct address_space_operations ext2_nobh_aops = { | |||
710 | .readpages = ext2_readpages, | 724 | .readpages = ext2_readpages, |
711 | .writepage = ext2_nobh_writepage, | 725 | .writepage = ext2_nobh_writepage, |
712 | .sync_page = block_sync_page, | 726 | .sync_page = block_sync_page, |
713 | /* XXX: todo */ | 727 | .write_begin = ext2_nobh_write_begin, |
728 | .write_end = nobh_write_end, | ||
714 | .bmap = ext2_bmap, | 729 | .bmap = ext2_bmap, |
715 | .direct_IO = ext2_direct_IO, | 730 | .direct_IO = ext2_direct_IO, |
716 | .writepages = ext2_writepages, | 731 | .writepages = ext2_writepages, |
@@ -927,7 +942,8 @@ void ext2_truncate (struct inode * inode) | |||
927 | if (mapping_is_xip(inode->i_mapping)) | 942 | if (mapping_is_xip(inode->i_mapping)) |
928 | xip_truncate_page(inode->i_mapping, inode->i_size); | 943 | xip_truncate_page(inode->i_mapping, inode->i_size); |
929 | else if (test_opt(inode->i_sb, NOBH)) | 944 | else if (test_opt(inode->i_sb, NOBH)) |
930 | nobh_truncate_page(inode->i_mapping, inode->i_size); | 945 | nobh_truncate_page(inode->i_mapping, |
946 | inode->i_size, ext2_get_block); | ||
931 | else | 947 | else |
932 | block_truncate_page(inode->i_mapping, | 948 | block_truncate_page(inode->i_mapping, |
933 | inode->i_size, ext2_get_block); | 949 | inode->i_size, ext2_get_block); |