Commit 5c500029 authored by Ross Zwisler's avatar Ross Zwisler Committed by Al Viro

vfs: remove unused wrapper block_page_mkwrite()

The function currently called "__block_page_mkwrite()" used to be called
"block_page_mkwrite()" until a wrapper for this function was added by:

commit 24da4fab ("vfs: Create __block_page_mkwrite() helper passing
	error values back")

This wrapper, the current "block_page_mkwrite()", is currently unused.
__block_page_mkwrite() is used directly by ext4, nilfs2 and xfs.

Remove the unused wrapper, rename __block_page_mkwrite() back to
block_page_mkwrite() and update the comment above block_page_mkwrite().
Signed-off-by: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: default avatarJan Kara <jack@suse.com>
Cc: Jan Kara <jack@suse.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 54d15714
...@@ -2420,9 +2420,9 @@ EXPORT_SYMBOL(block_commit_write); ...@@ -2420,9 +2420,9 @@ EXPORT_SYMBOL(block_commit_write);
* unlock the page. * unlock the page.
* *
* Direct callers of this function should protect against filesystem freezing * Direct callers of this function should protect against filesystem freezing
* using sb_start_write() - sb_end_write() functions. * using sb_start_pagefault() - sb_end_pagefault() functions.
*/ */
int __block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
get_block_t get_block) get_block_t get_block)
{ {
struct page *page = vmf->page; struct page *page = vmf->page;
...@@ -2459,26 +2459,6 @@ int __block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, ...@@ -2459,26 +2459,6 @@ int __block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
unlock_page(page); unlock_page(page);
return ret; return ret;
} }
EXPORT_SYMBOL(__block_page_mkwrite);
int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
get_block_t get_block)
{
int ret;
struct super_block *sb = file_inode(vma->vm_file)->i_sb;
sb_start_pagefault(sb);
/*
* Update file times before taking page lock. We may end up failing the
* fault so this update may be superfluous but who really cares...
*/
file_update_time(vma->vm_file);
ret = __block_page_mkwrite(vma, vmf, get_block);
sb_end_pagefault(sb);
return block_page_mkwrite_return(ret);
}
EXPORT_SYMBOL(block_page_mkwrite); EXPORT_SYMBOL(block_page_mkwrite);
/* /*
......
...@@ -5283,7 +5283,7 @@ int ext4_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) ...@@ -5283,7 +5283,7 @@ int ext4_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
!ext4_should_journal_data(inode) && !ext4_should_journal_data(inode) &&
!ext4_nonda_switch(inode->i_sb)) { !ext4_nonda_switch(inode->i_sb)) {
do { do {
ret = __block_page_mkwrite(vma, vmf, ret = block_page_mkwrite(vma, vmf,
ext4_da_get_block_prep); ext4_da_get_block_prep);
} while (ret == -ENOSPC && } while (ret == -ENOSPC &&
ext4_should_retry_alloc(inode->i_sb, &retries)); ext4_should_retry_alloc(inode->i_sb, &retries));
...@@ -5330,7 +5330,7 @@ int ext4_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) ...@@ -5330,7 +5330,7 @@ int ext4_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
ret = VM_FAULT_SIGBUS; ret = VM_FAULT_SIGBUS;
goto out; goto out;
} }
ret = __block_page_mkwrite(vma, vmf, get_block); ret = block_page_mkwrite(vma, vmf, get_block);
if (!ret && ext4_should_journal_data(inode)) { if (!ret && ext4_should_journal_data(inode)) {
if (ext4_walk_page_buffers(handle, page_buffers(page), 0, if (ext4_walk_page_buffers(handle, page_buffers(page), 0,
PAGE_CACHE_SIZE, NULL, do_journal_get_write_access)) { PAGE_CACHE_SIZE, NULL, do_journal_get_write_access)) {
......
...@@ -109,7 +109,7 @@ static int nilfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) ...@@ -109,7 +109,7 @@ static int nilfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
goto out; goto out;
file_update_time(vma->vm_file); file_update_time(vma->vm_file);
ret = __block_page_mkwrite(vma, vmf, nilfs_get_block); ret = block_page_mkwrite(vma, vmf, nilfs_get_block);
if (ret) { if (ret) {
nilfs_transaction_abort(inode->i_sb); nilfs_transaction_abort(inode->i_sb);
goto out; goto out;
......
...@@ -1506,7 +1506,7 @@ xfs_filemap_page_mkwrite( ...@@ -1506,7 +1506,7 @@ xfs_filemap_page_mkwrite(
ret = __dax_mkwrite(vma, vmf, xfs_get_blocks_direct, ret = __dax_mkwrite(vma, vmf, xfs_get_blocks_direct,
xfs_end_io_dax_write); xfs_end_io_dax_write);
} else { } else {
ret = __block_page_mkwrite(vma, vmf, xfs_get_blocks); ret = block_page_mkwrite(vma, vmf, xfs_get_blocks);
ret = block_page_mkwrite_return(ret); ret = block_page_mkwrite_return(ret);
} }
......
...@@ -227,8 +227,6 @@ int cont_write_begin(struct file *, struct address_space *, loff_t, ...@@ -227,8 +227,6 @@ int cont_write_begin(struct file *, struct address_space *, loff_t,
get_block_t *, loff_t *); get_block_t *, loff_t *);
int generic_cont_expand_simple(struct inode *inode, loff_t size); int generic_cont_expand_simple(struct inode *inode, loff_t size);
int block_commit_write(struct page *page, unsigned from, unsigned to); int block_commit_write(struct page *page, unsigned from, unsigned to);
int __block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
get_block_t get_block);
int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
get_block_t get_block); get_block_t get_block);
/* Convert errno to return value from ->page_mkwrite() call */ /* Convert errno to return value from ->page_mkwrite() call */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment