aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs
diff options
context:
space:
mode:
authorVladimir Saveliev <vs@namesys.com>2007-10-16 04:25:14 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:42:56 -0400
commitf7557e8f7ff785d6c2b5bc914cd1675314ff0fcf (patch)
treead00de4fd519ff462df289f23dfb21d395e1e011 /fs/reiserfs
parentba9d8cec6c7165e440f9b2413a0464cf3c12fb25 (diff)
reiserfs: use generic_cont_expand_simple
This patch makes reiserfs to use AOP_FLAG_CONT_EXPAND in order to get rid of the special generic_cont_expand routine Signed-off-by: Vladimir Saveliev <vs@namesys.com> Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/reiserfs')
-rw-r--r--fs/reiserfs/inode.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index 21db3a705f1e..95051d44a918 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -2562,13 +2562,20 @@ static int reiserfs_write_begin(struct file *file,
2562 int ret; 2562 int ret;
2563 int old_ref = 0; 2563 int old_ref = 0;
2564 2564
2565 inode = mapping->host;
2566 *fsdata = 0;
2567 if (flags & AOP_FLAG_CONT_EXPAND &&
2568 (pos & (inode->i_sb->s_blocksize - 1)) == 0) {
2569 pos ++;
2570 *fsdata = (void *)(unsigned long)flags;
2571 }
2572
2565 index = pos >> PAGE_CACHE_SHIFT; 2573 index = pos >> PAGE_CACHE_SHIFT;
2566 page = __grab_cache_page(mapping, index); 2574 page = __grab_cache_page(mapping, index);
2567 if (!page) 2575 if (!page)
2568 return -ENOMEM; 2576 return -ENOMEM;
2569 *pagep = page; 2577 *pagep = page;
2570 2578
2571 inode = mapping->host;
2572 reiserfs_wait_on_write_block(inode->i_sb); 2579 reiserfs_wait_on_write_block(inode->i_sb);
2573 fix_tail_page_for_writing(page); 2580 fix_tail_page_for_writing(page);
2574 if (reiserfs_transaction_running(inode->i_sb)) { 2581 if (reiserfs_transaction_running(inode->i_sb)) {
@@ -2678,6 +2685,8 @@ static int reiserfs_write_end(struct file *file, struct address_space *mapping,
2678 struct reiserfs_transaction_handle *th; 2685 struct reiserfs_transaction_handle *th;
2679 unsigned start; 2686 unsigned start;
2680 2687
2688 if ((unsigned long)fsdata & AOP_FLAG_CONT_EXPAND)
2689 pos ++;
2681 2690
2682 reiserfs_wait_on_write_block(inode->i_sb); 2691 reiserfs_wait_on_write_block(inode->i_sb);
2683 if (reiserfs_transaction_running(inode->i_sb)) 2692 if (reiserfs_transaction_running(inode->i_sb))
@@ -3065,7 +3074,7 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
3065 } 3074 }
3066 /* fill in hole pointers in the expanding truncate case. */ 3075 /* fill in hole pointers in the expanding truncate case. */
3067 if (attr->ia_size > inode->i_size) { 3076 if (attr->ia_size > inode->i_size) {
3068 error = generic_cont_expand(inode, attr->ia_size); 3077 error = generic_cont_expand_simple(inode, attr->ia_size);
3069 if (REISERFS_I(inode)->i_prealloc_count > 0) { 3078 if (REISERFS_I(inode)->i_prealloc_count > 0) {
3070 int err; 3079 int err;
3071 struct reiserfs_transaction_handle th; 3080 struct reiserfs_transaction_handle th;