2222
2323int reiserfs_commit_write (struct file * f , struct page * page ,
2424 unsigned from , unsigned to );
25- int reiserfs_prepare_write (struct file * f , struct page * page ,
26- unsigned from , unsigned to );
2725
2826void reiserfs_evict_inode (struct inode * inode )
2927{
@@ -165,7 +163,7 @@ inline void make_le_item_head(struct item_head *ih, const struct cpu_key *key,
165163** but tail is still sitting in a direct item, and we can't write to
166164** it. So, look through this page, and check all the mapped buffers
167165** to make sure they have valid block numbers. Any that don't need
168- ** to be unmapped, so that block_prepare_write will correctly call
166+ ** to be unmapped, so that __block_write_begin will correctly call
169167** reiserfs_get_block to convert the tail into an unformatted node
170168*/
171169static inline void fix_tail_page_for_writing (struct page * page )
@@ -439,13 +437,13 @@ static int reiserfs_bmap(struct inode *inode, sector_t block,
439437}
440438
441439/* special version of get_block that is only used by grab_tail_page right
442- ** now. It is sent to block_prepare_write , and when you try to get a
440+ ** now. It is sent to __block_write_begin , and when you try to get a
443441** block past the end of the file (or a block from a hole) it returns
444- ** -ENOENT instead of a valid buffer. block_prepare_write expects to
442+ ** -ENOENT instead of a valid buffer. __block_write_begin expects to
445443** be able to do i/o on the buffers returned, unless an error value
446444** is also returned.
447445**
448- ** So, this allows block_prepare_write to be used for reading a single block
446+ ** So, this allows __block_write_begin to be used for reading a single block
449447** in a page. Where it does not produce a valid page for holes, or past the
450448** end of the file. This turns out to be exactly what we need for reading
451449** tails for conversion.
@@ -558,11 +556,12 @@ static int convert_tail_for_hole(struct inode *inode,
558556 **
559557 ** We must fix the tail page for writing because it might have buffers
560558 ** that are mapped, but have a block number of 0. This indicates tail
561- ** data that has been read directly into the page, and block_prepare_write
562- ** won't trigger a get_block in this case.
559+ ** data that has been read directly into the page, and
560+ ** __block_write_begin won't trigger a get_block in this case.
563561 */
564562 fix_tail_page_for_writing (tail_page );
565- retval = reiserfs_prepare_write (NULL , tail_page , tail_start , tail_end );
563+ retval = __reiserfs_write_begin (tail_page , tail_start ,
564+ tail_end - tail_start );
566565 if (retval )
567566 goto unlock ;
568567
@@ -2033,7 +2032,7 @@ static int grab_tail_page(struct inode *inode,
20332032 /* start within the page of the last block in the file */
20342033 start = (offset / blocksize ) * blocksize ;
20352034
2036- error = block_prepare_write (page , start , offset ,
2035+ error = __block_write_begin (page , start , offset - start ,
20372036 reiserfs_get_block_create_0 );
20382037 if (error )
20392038 goto unlock ;
@@ -2628,8 +2627,7 @@ static int reiserfs_write_begin(struct file *file,
26282627 return ret ;
26292628}
26302629
2631- int reiserfs_prepare_write (struct file * f , struct page * page ,
2632- unsigned from , unsigned to )
2630+ int __reiserfs_write_begin (struct page * page , unsigned from , unsigned len )
26332631{
26342632 struct inode * inode = page -> mapping -> host ;
26352633 int ret ;
@@ -2650,7 +2648,7 @@ int reiserfs_prepare_write(struct file *f, struct page *page,
26502648 th -> t_refcount ++ ;
26512649 }
26522650
2653- ret = block_prepare_write (page , from , to , reiserfs_get_block );
2651+ ret = __block_write_begin (page , from , len , reiserfs_get_block );
26542652 if (ret && reiserfs_transaction_running (inode -> i_sb )) {
26552653 struct reiserfs_transaction_handle * th = current -> journal_info ;
26562654 /* this gets a little ugly. If reiserfs_get_block returned an
0 commit comments