* [PATCH 10/10] fs: Remove flags parameter from aops->write_begin()
2018-02-19 14:02 [PATCH 00/10] Use the memalloc_nofs scope API Goldwyn Rodrigues
` (8 preceding siblings ...)
2018-02-19 14:02 ` [PATCH 09/10] reiserfs: cont_expand() to eliminate AOP_FLAG_CONT_EXPAND Goldwyn Rodrigues
@ 2018-02-19 14:02 ` Goldwyn Rodrigues
9 siblings, 0 replies; 16+ messages in thread
From: Goldwyn Rodrigues @ 2018-02-19 14:02 UTC (permalink / raw)
To: linux-fsdevel; +Cc: mhocko, Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
---
drivers/gpu/drm/i915/i915_gem.c | 4 ++--
drivers/staging/lustre/lustre/llite/rw26.c | 5 ++---
fs/9p/vfs_addr.c | 4 ++--
fs/adfs/inode.c | 4 ++--
fs/affs/file.c | 10 +++++-----
fs/afs/internal.h | 2 +-
fs/afs/write.c | 4 ++--
fs/block_dev.c | 4 ++--
fs/buffer.c | 18 +++++++++---------
fs/ceph/addr.c | 4 ++--
fs/cifs/file.c | 4 ++--
fs/ecryptfs/mmap.c | 4 ++--
fs/exofs/inode.c | 5 ++---
fs/ext2/inode.c | 4 ++--
fs/ext4/ext4.h | 2 --
fs/ext4/inline.c | 18 ++++++------------
fs/ext4/inode.c | 18 +++++++++---------
fs/ext4/move_extent.c | 4 ++--
fs/f2fs/data.c | 4 ++--
fs/f2fs/f2fs.h | 2 +-
fs/f2fs/super.c | 2 +-
fs/fat/inode.c | 4 ++--
fs/fuse/file.c | 6 +++---
fs/gfs2/aops.c | 4 ++--
fs/hfs/extent.c | 2 +-
fs/hfs/inode.c | 4 ++--
fs/hfsplus/extents.c | 2 +-
fs/hfsplus/inode.c | 4 ++--
fs/hostfs/hostfs_kern.c | 4 ++--
fs/hpfs/file.c | 4 ++--
fs/hugetlbfs/inode.c | 2 +-
fs/iomap.c | 2 +-
fs/jffs2/file.c | 6 +++---
fs/jfs/inode.c | 4 ++--
fs/libfs.c | 4 ++--
fs/minix/inode.c | 4 ++--
fs/namei.c | 2 +-
fs/nfs/file.c | 4 ++--
fs/nilfs2/recovery.c | 2 +-
fs/ocfs2/aops.c | 2 +-
fs/omfs/file.c | 4 ++--
fs/reiserfs/inode.c | 6 +++---
fs/sysv/itree.c | 4 ++--
fs/ubifs/file.c | 11 +++++------
fs/udf/file.c | 4 ++--
fs/udf/inode.c | 4 ++--
fs/ufs/inode.c | 4 ++--
include/linux/buffer_head.h | 6 +++---
include/linux/fs.h | 6 +++---
include/linux/pagemap.h | 2 +-
include/trace/events/ext4.h | 21 ++++++++-------------
include/trace/events/f2fs.h | 12 ++++--------
mm/filemap.c | 10 ++++------
mm/shmem.c | 2 +-
54 files changed, 133 insertions(+), 155 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index dd89abd2263d..ec9efb4d93c9 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2797,7 +2797,7 @@ i915_gem_object_pwrite_gtt(struct drm_i915_gem_object *obj,
len = remain;
err = pagecache_write_begin(obj->base.filp, mapping,
- offset, len, 0,
+ offset, len,
&page, &data);
if (err < 0)
return err;
@@ -5612,7 +5612,7 @@ i915_gem_object_create_from_data(struct drm_i915_private *dev_priv,
void *pgdata, *vaddr;
err = pagecache_write_begin(file, file->f_mapping,
- offset, len, 0,
+ offset, len,
&page, &pgdata);
if (err < 0)
goto fail;
diff --git a/drivers/staging/lustre/lustre/llite/rw26.c b/drivers/staging/lustre/lustre/llite/rw26.c
index 722e5ea1af5f..735512b99e89 100644
--- a/drivers/staging/lustre/lustre/llite/rw26.c
+++ b/drivers/staging/lustre/lustre/llite/rw26.c
@@ -439,7 +439,7 @@ static int ll_prepare_partial_page(const struct lu_env *env, struct cl_io *io,
}
static int ll_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned int len, unsigned int flags,
+ loff_t pos, unsigned int len,
struct page **pagep, void **fsdata)
{
struct ll_cl_context *lcc;
@@ -489,8 +489,7 @@ static int ll_write_begin(struct file *file, struct address_space *mapping,
goto out;
if (!vmpage) {
- vmpage = grab_cache_page_write_begin(mapping, index,
- flags);
+ vmpage = grab_cache_page_write_begin(mapping, index);
if (!vmpage) {
result = -ENOMEM;
goto out;
diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c
index e1cbdfdb7c68..5a51110a157c 100644
--- a/fs/9p/vfs_addr.c
+++ b/fs/9p/vfs_addr.c
@@ -266,7 +266,7 @@ v9fs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
}
static int v9fs_write_begin(struct file *filp, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
int retval = 0;
@@ -280,7 +280,7 @@ static int v9fs_write_begin(struct file *filp, struct address_space *mapping,
v9inode = V9FS_I(inode);
start:
- page = grab_cache_page_write_begin(mapping, index, flags);
+ page = grab_cache_page_write_begin(mapping, index);
if (!page) {
retval = -ENOMEM;
goto out;
diff --git a/fs/adfs/inode.c b/fs/adfs/inode.c
index 8dbd36f5e581..c47af801d427 100644
--- a/fs/adfs/inode.c
+++ b/fs/adfs/inode.c
@@ -54,13 +54,13 @@ static void adfs_write_failed(struct address_space *mapping, loff_t to)
}
static int adfs_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
int ret;
*pagep = NULL;
- ret = cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
+ ret = cont_write_begin(file, mapping, pos, len, pagep, fsdata,
adfs_get_block,
&ADFS_I(mapping->host)->mmu_private);
if (unlikely(ret))
diff --git a/fs/affs/file.c b/fs/affs/file.c
index a85817f54483..2ca2044e4702 100644
--- a/fs/affs/file.c
+++ b/fs/affs/file.c
@@ -413,13 +413,13 @@ affs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
}
static int affs_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
int ret;
*pagep = NULL;
- ret = cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
+ ret = cont_write_begin(file, mapping, pos, len, pagep, fsdata,
affs_get_block,
&AFFS_I(mapping->host)->mmu_private);
if (unlikely(ret))
@@ -629,7 +629,7 @@ affs_readpage_ofs(struct file *file, struct page *page)
}
static int affs_write_begin_ofs(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
struct inode *inode = mapping->host;
@@ -649,7 +649,7 @@ static int affs_write_begin_ofs(struct file *file, struct address_space *mapping
}
index = pos >> PAGE_SHIFT;
- page = grab_cache_page_write_begin(mapping, index, flags);
+ page = grab_cache_page_write_begin(mapping, index);
if (!page)
return -ENOMEM;
*pagep = page;
@@ -858,7 +858,7 @@ affs_truncate(struct inode *inode)
loff_t isize = inode->i_size;
int res;
- res = mapping->a_ops->write_begin(NULL, mapping, isize, 0, 0, &page, &fsdata);
+ res = mapping->a_ops->write_begin(NULL, mapping, isize, 0, &page, &fsdata);
if (!res)
res = mapping->a_ops->write_end(NULL, mapping, isize, 0, 0, page, fsdata);
else
diff --git a/fs/afs/internal.h b/fs/afs/internal.h
index f38d6a561a84..0cc5270596c6 100644
--- a/fs/afs/internal.h
+++ b/fs/afs/internal.h
@@ -938,7 +938,7 @@ extern int afs_check_volume_status(struct afs_volume *, struct key *);
*/
extern int afs_set_page_dirty(struct page *);
extern int afs_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata);
extern int afs_write_end(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned copied,
diff --git a/fs/afs/write.c b/fs/afs/write.c
index 9370e2feb999..82760729e222 100644
--- a/fs/afs/write.c
+++ b/fs/afs/write.c
@@ -68,7 +68,7 @@ static int afs_fill_page(struct afs_vnode *vnode, struct key *key,
* prepare to perform part of a write to a page
*/
int afs_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
struct afs_vnode *vnode = AFS_FS_I(file_inode(file));
@@ -88,7 +88,7 @@ int afs_write_begin(struct file *file, struct address_space *mapping,
*/
BUILD_BUG_ON(PAGE_SIZE > 32768 && sizeof(page->private) < 8);
- page = grab_cache_page_write_begin(mapping, index, flags);
+ page = grab_cache_page_write_begin(mapping, index);
if (!page)
return -ENOMEM;
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 4a181fcb5175..b0f54ef9193a 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -578,10 +578,10 @@ static int blkdev_readpages(struct file *file, struct address_space *mapping,
}
static int blkdev_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
- return block_write_begin(mapping, pos, len, flags, pagep,
+ return block_write_begin(mapping, pos, len, pagep,
blkdev_get_block);
}
diff --git a/fs/buffer.c b/fs/buffer.c
index 1787b29f3fb3..5f4c912c3bdf 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2082,13 +2082,13 @@ static int __block_commit_write(struct inode *inode, struct page *page,
* The filesystem needs to handle block truncation upon failure.
*/
int block_write_begin(struct address_space *mapping, loff_t pos, unsigned len,
- unsigned flags, struct page **pagep, get_block_t *get_block)
+ struct page **pagep, get_block_t *get_block)
{
pgoff_t index = pos >> PAGE_SHIFT;
struct page *page;
int status;
- page = grab_cache_page_write_begin(mapping, index, flags);
+ page = grab_cache_page_write_begin(mapping, index);
if (!page)
return -ENOMEM;
@@ -2334,7 +2334,7 @@ int generic_cont_expand_simple(struct inode *inode, loff_t size)
goto out;
err = pagecache_write_begin(NULL, mapping, size, 0,
- AOP_FLAG_CONT_EXPAND, &page, &fsdata);
+ &page, &fsdata);
if (err)
goto out;
@@ -2369,7 +2369,7 @@ static int cont_expand_zero(struct file *file, struct address_space *mapping,
}
len = PAGE_SIZE - zerofrom;
- err = pagecache_write_begin(file, mapping, curpos, len, 0,
+ err = pagecache_write_begin(file, mapping, curpos, len,
&page, &fsdata);
if (err)
goto out;
@@ -2402,7 +2402,7 @@ static int cont_expand_zero(struct file *file, struct address_space *mapping,
}
len = offset - zerofrom;
- err = pagecache_write_begin(file, mapping, curpos, len, 0,
+ err = pagecache_write_begin(file, mapping, curpos, len,
&page, &fsdata);
if (err)
goto out;
@@ -2423,7 +2423,7 @@ static int cont_expand_zero(struct file *file, struct address_space *mapping,
* We may have to extend the file.
*/
int cont_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata,
get_block_t *get_block, loff_t *bytes)
{
@@ -2442,7 +2442,7 @@ int cont_write_begin(struct file *file, struct address_space *mapping,
(*bytes)++;
}
- return block_write_begin(mapping, pos, len, flags, pagep, get_block);
+ return block_write_begin(mapping, pos, len, pagep, get_block);
}
EXPORT_SYMBOL(cont_write_begin);
@@ -2551,7 +2551,7 @@ static void attach_nobh_buffers(struct page *page, struct buffer_head *head)
* The filesystem needs to handle block truncation upon failure.
*/
int nobh_write_begin(struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata,
get_block_t *get_block)
{
@@ -2573,7 +2573,7 @@ int nobh_write_begin(struct address_space *mapping,
from = pos & (PAGE_SIZE - 1);
to = from + len;
- page = grab_cache_page_write_begin(mapping, index, flags);
+ page = grab_cache_page_write_begin(mapping, index);
if (!page)
return -ENOMEM;
*pagep = page;
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index b4336b42ce3b..d21c2f842e08 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -1322,7 +1322,7 @@ static int ceph_update_writeable_page(struct file *file,
* clean, or already dirty within the same snap context.
*/
static int ceph_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
struct inode *inode = file_inode(file);
@@ -1332,7 +1332,7 @@ static int ceph_write_begin(struct file *file, struct address_space *mapping,
do {
/* get a page */
- page = grab_cache_page_write_begin(mapping, index, 0);
+ page = grab_cache_page_write_begin(mapping, index);
if (!page)
return -ENOMEM;
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 7cee97b93a61..1d5be6cb28d5 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -3944,7 +3944,7 @@ bool is_size_safe_to_change(struct cifsInodeInfo *cifsInode, __u64 end_of_file)
}
static int cifs_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
int oncethru = 0;
@@ -3958,7 +3958,7 @@ static int cifs_write_begin(struct file *file, struct address_space *mapping,
cifs_dbg(FYI, "write_begin from %lld len %d\n", (long long)pos, len);
start:
- page = grab_cache_page_write_begin(mapping, index, flags);
+ page = grab_cache_page_write_begin(mapping, index);
if (!page) {
rc = -ENOMEM;
goto out;
diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c
index cdf358b209d9..10d4dbd844c0 100644
--- a/fs/ecryptfs/mmap.c
+++ b/fs/ecryptfs/mmap.c
@@ -277,7 +277,7 @@ static int fill_zeros_to_end_of_page(struct page *page, unsigned int to)
*/
static int ecryptfs_write_begin(struct file *file,
struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
pgoff_t index = pos >> PAGE_SHIFT;
@@ -285,7 +285,7 @@ static int ecryptfs_write_begin(struct file *file,
loff_t prev_page_end_size;
int rc = 0;
- page = grab_cache_page_write_begin(mapping, index, flags);
+ page = grab_cache_page_write_begin(mapping, index);
if (!page)
return -ENOMEM;
*pagep = page;
diff --git a/fs/exofs/inode.c b/fs/exofs/inode.c
index 0ac62811b341..b6d39012397d 100644
--- a/fs/exofs/inode.c
+++ b/fs/exofs/inode.c
@@ -862,7 +862,7 @@ static void _write_failed(struct inode *inode, loff_t to)
}
int exofs_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
int ret = 0;
@@ -870,8 +870,7 @@ int exofs_write_begin(struct file *file, struct address_space *mapping,
page = *pagep;
if (page == NULL) {
- page = grab_cache_page_write_begin(mapping, pos >> PAGE_SHIFT,
- flags);
+ page = grab_cache_page_write_begin(mapping, pos >> PAGE_SHIFT);
if (!page) {
EXOFS_DBGMSG("grab_cache_page_write_begin failed\n");
return -ENOMEM;
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index 9b2ac55ac34f..0129a095f91c 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -881,12 +881,12 @@ ext2_readpages(struct file *file, struct address_space *mapping,
static int
ext2_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
int ret;
- ret = block_write_begin(mapping, pos, len, flags, pagep,
+ ret = block_write_begin(mapping, pos, len, pagep,
ext2_get_block);
if (ret < 0)
ext2_write_failed(mapping, pos + len);
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 3241475a1733..ffeae3c26887 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -2954,7 +2954,6 @@ extern int ext4_readpage_inline(struct inode *inode, struct page *page);
extern int ext4_try_to_write_inline_data(struct address_space *mapping,
struct inode *inode,
loff_t pos, unsigned len,
- unsigned flags,
struct page **pagep);
extern int ext4_write_inline_data_end(struct inode *inode,
loff_t pos, unsigned len,
@@ -2967,7 +2966,6 @@ ext4_journalled_write_inline_data(struct inode *inode,
extern int ext4_da_write_inline_data_begin(struct address_space *mapping,
struct inode *inode,
loff_t pos, unsigned len,
- unsigned flags,
struct page **pagep,
void **fsdata);
extern int ext4_da_write_inline_data_end(struct inode *inode, loff_t pos,
diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
index e59f8a8e40e7..298830b25b9b 100644
--- a/fs/ext4/inline.c
+++ b/fs/ext4/inline.c
@@ -517,8 +517,7 @@ int ext4_readpage_inline(struct inode *inode, struct page *page)
}
static int ext4_convert_inline_data_to_extent(struct address_space *mapping,
- struct inode *inode,
- unsigned flags)
+ struct inode *inode)
{
int ret, needed_blocks, no_expand;
handle_t *handle = NULL;
@@ -555,7 +554,7 @@ static int ext4_convert_inline_data_to_extent(struct address_space *mapping,
* started */
nofs_flags = memalloc_nofs_save();
- page = grab_cache_page_write_begin(mapping, 0, flags);
+ page = grab_cache_page_write_begin(mapping, 0);
memalloc_nofs_restore(nofs_flags);
@@ -643,7 +642,6 @@ static int ext4_convert_inline_data_to_extent(struct address_space *mapping,
int ext4_try_to_write_inline_data(struct address_space *mapping,
struct inode *inode,
loff_t pos, unsigned len,
- unsigned flags,
struct page **pagep)
{
int ret;
@@ -684,7 +682,7 @@ int ext4_try_to_write_inline_data(struct address_space *mapping,
nofs_flags = memalloc_nofs_save();
- page = grab_cache_page_write_begin(mapping, 0, flags);
+ page = grab_cache_page_write_begin(mapping, 0);
memalloc_nofs_restore(nofs_flags);
if (!page) {
@@ -717,8 +715,7 @@ int ext4_try_to_write_inline_data(struct address_space *mapping,
brelse(iloc.bh);
return ret;
convert:
- return ext4_convert_inline_data_to_extent(mapping,
- inode, flags);
+ return ext4_convert_inline_data_to_extent(mapping, inode);
}
int ext4_write_inline_data_end(struct inode *inode, loff_t pos, unsigned len,
@@ -793,13 +790,12 @@ ext4_journalled_write_inline_data(struct inode *inode,
*/
static int ext4_da_convert_inline_data_to_extent(struct address_space *mapping,
struct inode *inode,
- unsigned flags,
void **fsdata)
{
int ret = 0, inline_size;
struct page *page;
- page = grab_cache_page_write_begin(mapping, 0, flags);
+ page = grab_cache_page_write_begin(mapping, 0);
if (!page)
return -ENOMEM;
@@ -852,7 +848,6 @@ static int ext4_da_convert_inline_data_to_extent(struct address_space *mapping,
int ext4_da_write_inline_data_begin(struct address_space *mapping,
struct inode *inode,
loff_t pos, unsigned len,
- unsigned flags,
struct page **pagep,
void **fsdata)
{
@@ -886,7 +881,6 @@ int ext4_da_write_inline_data_begin(struct address_space *mapping,
int nofs_flags = memalloc_nofs_save();
ret = ext4_da_convert_inline_data_to_extent(mapping,
inode,
- flags,
fsdata);
memalloc_nofs_restore(nofs_flags);
ext4_journal_stop(handle);
@@ -897,7 +891,7 @@ int ext4_da_write_inline_data_begin(struct address_space *mapping,
}
- page = grab_cache_page_write_begin(mapping, 0, flags);
+ page = grab_cache_page_write_begin(mapping, 0);
if (!page) {
ret = -ENOMEM;
goto out_journal;
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index c94780075b04..a8b8bad7bd8b 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1239,7 +1239,7 @@ static int ext4_block_write_begin(struct page *page, loff_t pos, unsigned len,
#endif
static int ext4_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
struct inode *inode = mapping->host;
@@ -1253,7 +1253,7 @@ static int ext4_write_begin(struct file *file, struct address_space *mapping,
if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb))))
return -EIO;
- trace_ext4_write_begin(inode, pos, len, flags);
+ trace_ext4_write_begin(inode, pos, len);
/*
* Reserve one block more for addition to orphan list in case
* we allocate blocks but write fails for some reason
@@ -1265,7 +1265,7 @@ static int ext4_write_begin(struct file *file, struct address_space *mapping,
if (ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA)) {
ret = ext4_try_to_write_inline_data(mapping, inode, pos, len,
- flags, pagep);
+ pagep);
if (ret < 0)
return ret;
if (ret == 1)
@@ -1280,7 +1280,7 @@ static int ext4_write_begin(struct file *file, struct address_space *mapping,
* the page (if needed) without using GFP_NOFS.
*/
retry_grab:
- page = grab_cache_page_write_begin(mapping, index, flags);
+ page = grab_cache_page_write_begin(mapping, index);
if (!page)
return -ENOMEM;
unlock_page(page);
@@ -3003,7 +3003,7 @@ static int ext4_da_write_credits(struct inode *inode, loff_t pos, unsigned len)
}
static int ext4_da_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
int ret, retries = 0;
@@ -3021,14 +3021,14 @@ static int ext4_da_write_begin(struct file *file, struct address_space *mapping,
S_ISLNK(inode->i_mode)) {
*fsdata = (void *)FALL_BACK_TO_NONDELALLOC;
return ext4_write_begin(file, mapping, pos,
- len, flags, pagep, fsdata);
+ len, pagep, fsdata);
}
*fsdata = (void *)0;
- trace_ext4_da_write_begin(inode, pos, len, flags);
+ trace_ext4_da_write_begin(inode, pos, len);
if (ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA)) {
ret = ext4_da_write_inline_data_begin(mapping, inode,
- pos, len, flags,
+ pos, len,
pagep, fsdata);
if (ret < 0)
return ret;
@@ -3044,7 +3044,7 @@ static int ext4_da_write_begin(struct file *file, struct address_space *mapping,
* the page (if needed) without using GFP_NOFS.
*/
retry_grab:
- page = grab_cache_page_write_begin(mapping, index, flags);
+ page = grab_cache_page_write_begin(mapping, index);
if (!page)
return -ENOMEM;
unlock_page(page);
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
index 9e35e72dcd29..e0caa00ea6fb 100644
--- a/fs/ext4/move_extent.c
+++ b/fs/ext4/move_extent.c
@@ -142,13 +142,13 @@ mext_page_double_lock(struct inode *inode1, struct inode *inode2,
mapping[1] = inode1->i_mapping;
}
- page[0] = grab_cache_page_write_begin(mapping[0], index1, 0);
+ page[0] = grab_cache_page_write_begin(mapping[0], index1);
if (!page[0]) {
memalloc_nofs_restore(nofs_fl);
return -ENOMEM;
}
- page[1] = grab_cache_page_write_begin(mapping[1], index2, 0);
+ page[1] = grab_cache_page_write_begin(mapping[1], index2);
memalloc_nofs_restore(nofs_fl);
if (!page[1]) {
unlock_page(page[0]);
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 7578ed1a85e0..bb99733b819d 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -2134,7 +2134,7 @@ static int prepare_write_begin(struct f2fs_sb_info *sbi,
}
static int f2fs_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
struct inode *inode = mapping->host;
@@ -2145,7 +2145,7 @@ static int f2fs_write_begin(struct file *file, struct address_space *mapping,
block_t blkaddr = NULL_ADDR;
int err = 0;
- trace_f2fs_write_begin(inode, pos, len, flags);
+ trace_f2fs_write_begin(inode, pos, len);
if (f2fs_is_atomic_file(inode) &&
!available_free_memory(sbi, INMEM_PAGES)) {
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 98b0827af06e..b314b0cca8a2 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1923,7 +1923,7 @@ static inline struct page *f2fs_grab_cache_page(struct address_space *mapping,
return grab_cache_page(mapping, index);
nofs_flags = memalloc_nofs_save();
- pg = grab_cache_page_write_begin(mapping, index, 0);
+ pg = grab_cache_page_write_begin(mapping, index);
memalloc_nofs_restore(nofs_flags);
return pg;
}
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 8173ae688814..e7a9a590ddd9 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1507,7 +1507,7 @@ static ssize_t f2fs_quota_write(struct super_block *sb, int type,
tocopy = min_t(unsigned long, sb->s_blocksize - offset,
towrite);
retry:
- err = a_ops->write_begin(NULL, mapping, off, tocopy, 0,
+ err = a_ops->write_begin(NULL, mapping, off, tocopy,
&page, NULL);
if (unlikely(err)) {
if (err == -ENOMEM) {
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index ffbbf0520d9e..652a0c5f2908 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -214,13 +214,13 @@ static void fat_write_failed(struct address_space *mapping, loff_t to)
}
static int fat_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
int err;
*pagep = NULL;
- err = cont_write_begin(file, mapping, pos, len, flags,
+ err = cont_write_begin(file, mapping, pos, len,
pagep, fsdata, fat_get_block,
&MSDOS_I(mapping->host)->mmu_private);
if (err < 0)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index a201fb0ac64f..eeb13c97584a 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1063,7 +1063,7 @@ static ssize_t fuse_fill_write_pages(struct fuse_req *req,
break;
err = -ENOMEM;
- page = grab_cache_page_write_begin(mapping, index, 0);
+ page = grab_cache_page_write_begin(mapping, index);
if (!page)
break;
@@ -1940,7 +1940,7 @@ static int fuse_writepages(struct address_space *mapping,
* but how to implement it without killing performance need more thinking.
*/
static int fuse_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
pgoff_t index = pos >> PAGE_SHIFT;
@@ -1951,7 +1951,7 @@ static int fuse_write_begin(struct file *file, struct address_space *mapping,
WARN_ON(!fc->writeback_cache);
- page = grab_cache_page_write_begin(mapping, index, flags);
+ page = grab_cache_page_write_begin(mapping, index);
if (!page)
goto error;
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index 802d2d223902..c438c71bfec6 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -659,7 +659,7 @@ static int gfs2_readpages(struct file *file, struct address_space *mapping,
*/
static int gfs2_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
struct gfs2_inode *ip = GFS2_I(mapping->host);
@@ -722,7 +722,7 @@ static int gfs2_write_begin(struct file *file, struct address_space *mapping,
error = -ENOMEM;
nofs_flags = memalloc_nofs_save();
- page = grab_cache_page_write_begin(mapping, index, flags);
+ page = grab_cache_page_write_begin(mapping, index);
memalloc_nofs_restore(nofs_flags);
*pagep = page;
if (unlikely(!page))
diff --git a/fs/hfs/extent.c b/fs/hfs/extent.c
index 5d0182654580..e7564f0a9110 100644
--- a/fs/hfs/extent.c
+++ b/fs/hfs/extent.c
@@ -485,7 +485,7 @@ void hfs_file_truncate(struct inode *inode)
/* XXX: Can use generic_cont_expand? */
size = inode->i_size - 1;
- res = pagecache_write_begin(NULL, mapping, size+1, 0, 0,
+ res = pagecache_write_begin(NULL, mapping, size+1, 0,
&page, &fsdata);
if (!res) {
res = pagecache_write_end(NULL, mapping, size+1, 0, 0,
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c
index 2538b49cc349..38a5a44ed950 100644
--- a/fs/hfs/inode.c
+++ b/fs/hfs/inode.c
@@ -49,13 +49,13 @@ static void hfs_write_failed(struct address_space *mapping, loff_t to)
}
static int hfs_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
int ret;
*pagep = NULL;
- ret = cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
+ ret = cont_write_begin(file, mapping, pos, len, pagep, fsdata,
hfs_get_block,
&HFS_I(mapping->host)->phys_size);
if (unlikely(ret))
diff --git a/fs/hfsplus/extents.c b/fs/hfsplus/extents.c
index e8770935ce6d..0cc237ef2732 100644
--- a/fs/hfsplus/extents.c
+++ b/fs/hfsplus/extents.c
@@ -546,7 +546,7 @@ void hfsplus_file_truncate(struct inode *inode)
void *fsdata;
loff_t size = inode->i_size;
- res = pagecache_write_begin(NULL, mapping, size, 0, 0,
+ res = pagecache_write_begin(NULL, mapping, size, 0,
&page, &fsdata);
if (res)
return;
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
index c0c8d433864f..70d81f4f3b8c 100644
--- a/fs/hfsplus/inode.c
+++ b/fs/hfsplus/inode.c
@@ -44,13 +44,13 @@ static void hfsplus_write_failed(struct address_space *mapping, loff_t to)
}
static int hfsplus_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
int ret;
*pagep = NULL;
- ret = cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
+ ret = cont_write_begin(file, mapping, pos, len, pagep, fsdata,
hfsplus_get_block,
&HFSPLUS_I(mapping->host)->phys_size);
if (unlikely(ret))
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index c148e7f4f451..947a5bf543aa 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -468,12 +468,12 @@ static int hostfs_readpage(struct file *file, struct page *page)
}
static int hostfs_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
pgoff_t index = pos >> PAGE_SHIFT;
- *pagep = grab_cache_page_write_begin(mapping, index, flags);
+ *pagep = grab_cache_page_write_begin(mapping, index);
if (!*pagep)
return -ENOMEM;
return 0;
diff --git a/fs/hpfs/file.c b/fs/hpfs/file.c
index 1ecec124e76f..b4caa9bd0d1f 100644
--- a/fs/hpfs/file.c
+++ b/fs/hpfs/file.c
@@ -152,13 +152,13 @@ static void hpfs_write_failed(struct address_space *mapping, loff_t to)
}
static int hpfs_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
int ret;
*pagep = NULL;
- ret = cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
+ ret = cont_write_begin(file, mapping, pos, len, pagep, fsdata,
hpfs_get_block,
&hpfs_i(mapping->host)->mmu_private);
if (unlikely(ret))
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 8fe1b0aa2896..1911f3bc130b 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -302,7 +302,7 @@ static ssize_t hugetlbfs_read_iter(struct kiocb *iocb, struct iov_iter *to)
static int hugetlbfs_write_begin(struct file *file,
struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
return -EINVAL;
diff --git a/fs/iomap.c b/fs/iomap.c
index afaf6ffff34f..711dfa22213c 100644
--- a/fs/iomap.c
+++ b/fs/iomap.c
@@ -124,7 +124,7 @@ iomap_write_begin(struct inode *inode, loff_t pos, unsigned len,
return -EINTR;
nofs_flags = memalloc_nofs_save();
- page = grab_cache_page_write_begin(inode->i_mapping, index, 0);
+ page = grab_cache_page_write_begin(inode->i_mapping, index);
memalloc_nofs_restore(nofs_flags);
if (!page)
return -ENOMEM;
diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c
index bd0428bebe9b..aba7e915e7a4 100644
--- a/fs/jffs2/file.c
+++ b/fs/jffs2/file.c
@@ -25,7 +25,7 @@ static int jffs2_write_end(struct file *filp, struct address_space *mapping,
loff_t pos, unsigned len, unsigned copied,
struct page *pg, void *fsdata);
static int jffs2_write_begin(struct file *filp, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata);
static int jffs2_readpage (struct file *filp, struct page *pg);
@@ -129,7 +129,7 @@ static int jffs2_readpage (struct file *filp, struct page *pg)
}
static int jffs2_write_begin(struct file *filp, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
struct page *pg;
@@ -139,7 +139,7 @@ static int jffs2_write_begin(struct file *filp, struct address_space *mapping,
uint32_t pageofs = index << PAGE_SHIFT;
int ret = 0;
- pg = grab_cache_page_write_begin(mapping, index, flags);
+ pg = grab_cache_page_write_begin(mapping, index);
if (!pg)
return -ENOMEM;
*pagep = pg;
diff --git a/fs/jfs/inode.c b/fs/jfs/inode.c
index 054cc761b426..f65876c6c597 100644
--- a/fs/jfs/inode.c
+++ b/fs/jfs/inode.c
@@ -314,12 +314,12 @@ static void jfs_write_failed(struct address_space *mapping, loff_t to)
}
static int jfs_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
int ret;
- ret = nobh_write_begin(mapping, pos, len, flags, pagep, fsdata,
+ ret = nobh_write_begin(mapping, pos, len, pagep, fsdata,
jfs_get_block);
if (unlikely(ret))
jfs_write_failed(mapping, pos + len);
diff --git a/fs/libfs.c b/fs/libfs.c
index 7ff3cb904acd..0af0ba1f9283 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -424,7 +424,7 @@ int simple_readpage(struct file *file, struct page *page)
EXPORT_SYMBOL(simple_readpage);
int simple_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
struct page *page;
@@ -432,7 +432,7 @@ int simple_write_begin(struct file *file, struct address_space *mapping,
index = pos >> PAGE_SHIFT;
- page = grab_cache_page_write_begin(mapping, index, flags);
+ page = grab_cache_page_write_begin(mapping, index);
if (!page)
return -ENOMEM;
diff --git a/fs/minix/inode.c b/fs/minix/inode.c
index 72e308c3e66b..26caaba24f0d 100644
--- a/fs/minix/inode.c
+++ b/fs/minix/inode.c
@@ -407,12 +407,12 @@ static void minix_write_failed(struct address_space *mapping, loff_t to)
}
static int minix_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
int ret;
- ret = block_write_begin(mapping, pos, len, flags, pagep,
+ ret = block_write_begin(mapping, pos, len, pagep,
minix_get_block);
if (unlikely(ret))
minix_write_failed(mapping, pos + len);
diff --git a/fs/namei.c b/fs/namei.c
index 6cb314a256c5..b23142853feb 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -4802,7 +4802,7 @@ int __page_symlink(struct inode *inode, const char *symname, int len, int nofs)
retry:
err = pagecache_write_begin(NULL, mapping, 0, len-1,
- flags, &page, &fsdata);
+ &page, &fsdata);
if (err)
goto fail;
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 81cca49a8375..d3d5c6ef904b 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -322,7 +322,7 @@ static int nfs_want_read_modify_write(struct file *file, struct page *page,
* increment the page use counts until he is done with the page.
*/
static int nfs_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
int ret;
@@ -334,7 +334,7 @@ static int nfs_write_begin(struct file *file, struct address_space *mapping,
file, mapping->host->i_ino, len, (long long) pos);
start:
- page = grab_cache_page_write_begin(mapping, index, flags);
+ page = grab_cache_page_write_begin(mapping, index);
if (!page)
return -ENOMEM;
*pagep = page;
diff --git a/fs/nilfs2/recovery.c b/fs/nilfs2/recovery.c
index 5139efed1888..c986bab23423 100644
--- a/fs/nilfs2/recovery.c
+++ b/fs/nilfs2/recovery.c
@@ -520,7 +520,7 @@ static int nilfs_recover_dsync_blocks(struct the_nilfs *nilfs,
pos = rb->blkoff << inode->i_blkbits;
err = block_write_begin(inode->i_mapping, pos, blocksize,
- 0, &page, nilfs_get_block);
+ &page, nilfs_get_block);
if (unlikely(err)) {
loff_t isize = inode->i_size;
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index e8e205bf2e41..5650df1b7dee 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -1906,7 +1906,7 @@ int ocfs2_write_begin_nolock(struct address_space *mapping,
}
static int ocfs2_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
int ret;
diff --git a/fs/omfs/file.c b/fs/omfs/file.c
index bf83e6644333..c4db04b0e120 100644
--- a/fs/omfs/file.c
+++ b/fs/omfs/file.c
@@ -317,12 +317,12 @@ static void omfs_write_failed(struct address_space *mapping, loff_t to)
}
static int omfs_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
int ret;
- ret = block_write_begin(mapping, pos, len, flags, pagep,
+ ret = block_write_begin(mapping, pos, len, pagep,
omfs_get_block);
if (unlikely(ret))
omfs_write_failed(mapping, pos + len);
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index 44895c4dc354..8b6dcd7d327b 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -2751,7 +2751,7 @@ static void reiserfs_truncate_failed_write(struct inode *inode)
static int reiserfs_write_begin(struct file *file,
struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
struct inode *inode;
@@ -2762,7 +2762,7 @@ static int reiserfs_write_begin(struct file *file,
inode = mapping->host;
index = pos >> PAGE_SHIFT;
- page = grab_cache_page_write_begin(mapping, index, flags);
+ page = grab_cache_page_write_begin(mapping, index);
if (!page)
return -ENOMEM;
*pagep = page;
@@ -3280,7 +3280,7 @@ int cont_expand(struct inode *inode, loff_t pos)
if ((pos & (inode->i_sb->s_blocksize -1)) == 0)
pos++;
- err = reiserfs_write_begin(NULL, inode->i_mapping, pos, 0, 0,
+ err = reiserfs_write_begin(NULL, inode->i_mapping, pos, 0,
&page, &fsdata);
if (err)
goto out;
diff --git a/fs/sysv/itree.c b/fs/sysv/itree.c
index bcb67b0cabe7..ec72eaa9f4b3 100644
--- a/fs/sysv/itree.c
+++ b/fs/sysv/itree.c
@@ -477,12 +477,12 @@ static void sysv_write_failed(struct address_space *mapping, loff_t to)
}
static int sysv_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
int ret;
- ret = block_write_begin(mapping, pos, len, flags, pagep, get_block);
+ ret = block_write_begin(mapping, pos, len, pagep, get_block);
if (unlikely(ret))
sysv_write_failed(mapping, pos + len);
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
index cf348ba99238..53084b29b055 100644
--- a/fs/ubifs/file.c
+++ b/fs/ubifs/file.c
@@ -226,8 +226,7 @@ static void release_existing_page_budget(struct ubifs_info *c)
}
static int write_begin_slow(struct address_space *mapping,
- loff_t pos, unsigned len, struct page **pagep,
- unsigned flags)
+ loff_t pos, unsigned len, struct page **pagep)
{
struct inode *inode = mapping->host;
struct ubifs_info *c = inode->i_sb->s_fs_info;
@@ -255,7 +254,7 @@ static int write_begin_slow(struct address_space *mapping,
if (unlikely(err))
return err;
- page = grab_cache_page_write_begin(mapping, index, flags);
+ page = grab_cache_page_write_begin(mapping, index);
if (unlikely(!page)) {
ubifs_release_budget(c, &req);
return -ENOMEM;
@@ -430,7 +429,7 @@ static int allocate_budget(struct ubifs_info *c, struct page *page,
* without forcing write-back. The slow path does not make this assumption.
*/
static int ubifs_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
struct inode *inode = mapping->host;
@@ -448,7 +447,7 @@ static int ubifs_write_begin(struct file *file, struct address_space *mapping,
return -EROFS;
/* Try out the fast-path part first */
- page = grab_cache_page_write_begin(mapping, index, flags);
+ page = grab_cache_page_write_begin(mapping, index);
if (unlikely(!page))
return -ENOMEM;
@@ -504,7 +503,7 @@ static int ubifs_write_begin(struct file *file, struct address_space *mapping,
unlock_page(page);
put_page(page);
- return write_begin_slow(mapping, pos, len, pagep, flags);
+ return write_begin_slow(mapping, pos, len, pagep);
}
/*
diff --git a/fs/udf/file.c b/fs/udf/file.c
index 356c2bf148a5..9a7ed361ae92 100644
--- a/fs/udf/file.c
+++ b/fs/udf/file.c
@@ -88,14 +88,14 @@ static int udf_adinicb_writepage(struct page *page,
static int udf_adinicb_write_begin(struct file *file,
struct address_space *mapping, loff_t pos,
- unsigned len, unsigned flags, struct page **pagep,
+ unsigned len, struct page **pagep,
void **fsdata)
{
struct page *page;
if (WARN_ON_ONCE(pos >= PAGE_SIZE))
return -EIO;
- page = grab_cache_page_write_begin(mapping, 0, flags);
+ page = grab_cache_page_write_begin(mapping, 0);
if (!page)
return -ENOMEM;
*pagep = page;
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index c23744d5ae5c..b6a30322052a 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -195,12 +195,12 @@ static int udf_readpages(struct file *file, struct address_space *mapping,
}
static int udf_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
int ret;
- ret = block_write_begin(mapping, pos, len, flags, pagep, udf_get_block);
+ ret = block_write_begin(mapping, pos, len, pagep, udf_get_block);
if (unlikely(ret))
udf_write_failed(mapping, pos + len);
return ret;
diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c
index c843ec858cf7..4f0be14542dc 100644
--- a/fs/ufs/inode.c
+++ b/fs/ufs/inode.c
@@ -495,12 +495,12 @@ static void ufs_write_failed(struct address_space *mapping, loff_t to)
}
static int ufs_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
int ret;
- ret = block_write_begin(mapping, pos, len, flags, pagep,
+ ret = block_write_begin(mapping, pos, len, pagep,
ufs_getfrag_block);
if (unlikely(ret))
ufs_write_failed(mapping, pos + len);
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 894e5d125de6..4a1b25dd602e 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -225,7 +225,7 @@ int block_read_full_page(struct page*, get_block_t*);
int block_is_partially_uptodate(struct page *page, unsigned long from,
unsigned long count);
int block_write_begin(struct address_space *mapping, loff_t pos, unsigned len,
- unsigned flags, struct page **pagep, get_block_t *get_block);
+ struct page **pagep, get_block_t *get_block);
int __block_write_begin(struct page *page, loff_t pos, unsigned len,
get_block_t *get_block);
int block_write_end(struct file *, struct address_space *,
@@ -237,7 +237,7 @@ int generic_write_end(struct file *, struct address_space *,
void page_zero_new_buffers(struct page *page, unsigned from, unsigned to);
void clean_page_buffers(struct page *page);
int cont_write_begin(struct file *, struct address_space *, loff_t,
- unsigned, unsigned, struct page **, void **,
+ unsigned, struct page **, void **,
get_block_t *, loff_t *);
int generic_cont_expand_simple(struct inode *inode, loff_t size);
int block_commit_write(struct page *page, unsigned from, unsigned to);
@@ -257,7 +257,7 @@ static inline int block_page_mkwrite_return(int err)
}
sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *);
int block_truncate_page(struct address_space *, loff_t, get_block_t *);
-int nobh_write_begin(struct address_space *, loff_t, unsigned, unsigned,
+int nobh_write_begin(struct address_space *, loff_t, unsigned,
struct page **, void **, get_block_t*);
int nobh_write_end(struct file *, struct address_space *,
loff_t, unsigned, unsigned,
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 67f81b737935..7f9565ec56d7 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -337,7 +337,7 @@ struct address_space_operations {
struct list_head *pages, unsigned nr_pages);
int (*write_begin)(struct file *, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata);
int (*write_end)(struct file *, struct address_space *mapping,
loff_t pos, unsigned len, unsigned copied,
@@ -376,7 +376,7 @@ extern const struct address_space_operations empty_aops;
* to write into the pagecache.
*/
int pagecache_write_begin(struct file *, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata);
int pagecache_write_end(struct file *, struct address_space *mapping,
@@ -3127,7 +3127,7 @@ extern int noop_fsync(struct file *, loff_t, loff_t, int);
extern int simple_empty(struct dentry *);
extern int simple_readpage(struct file *file, struct page *page);
extern int simple_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata);
extern int simple_write_end(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned copied,
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 34ce3ebf97d5..7a8aa306b370 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -377,7 +377,7 @@ unsigned find_get_entries_tag(struct address_space *mapping, pgoff_t start,
struct page **entries, pgoff_t *indices);
struct page *grab_cache_page_write_begin(struct address_space *mapping,
- pgoff_t index, unsigned flags);
+ pgoff_t index);
/*
* Returns locked page at given index in given cache, creating it if needed.
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index 4d0e3af4e561..9f15847e5672 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -272,17 +272,15 @@ TRACE_EVENT(ext4_begin_ordered_truncate,
DECLARE_EVENT_CLASS(ext4__write_begin,
- TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
- unsigned int flags),
+ TP_PROTO(struct inode *inode, loff_t pos, unsigned int len),
- TP_ARGS(inode, pos, len, flags),
+ TP_ARGS(inode, pos, len),
TP_STRUCT__entry(
__field( dev_t, dev )
__field( ino_t, ino )
__field( loff_t, pos )
__field( unsigned int, len )
- __field( unsigned int, flags )
),
TP_fast_assign(
@@ -290,29 +288,26 @@ DECLARE_EVENT_CLASS(ext4__write_begin,
__entry->ino = inode->i_ino;
__entry->pos = pos;
__entry->len = len;
- __entry->flags = flags;
),
- TP_printk("dev %d,%d ino %lu pos %lld len %u flags %u",
+ TP_printk("dev %d,%d ino %lu pos %lld len %u",
MAJOR(__entry->dev), MINOR(__entry->dev),
(unsigned long) __entry->ino,
- __entry->pos, __entry->len, __entry->flags)
+ __entry->pos, __entry->len)
);
DEFINE_EVENT(ext4__write_begin, ext4_write_begin,
- TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
- unsigned int flags),
+ TP_PROTO(struct inode *inode, loff_t pos, unsigned int len),
- TP_ARGS(inode, pos, len, flags)
+ TP_ARGS(inode, pos, len)
);
DEFINE_EVENT(ext4__write_begin, ext4_da_write_begin,
- TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
- unsigned int flags),
+ TP_PROTO(struct inode *inode, loff_t pos, unsigned int len),
- TP_ARGS(inode, pos, len, flags)
+ TP_ARGS(inode, pos, len)
);
DECLARE_EVENT_CLASS(ext4__write_end,
diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
index 06c87f9f720c..f7167f5bf2ad 100644
--- a/include/trace/events/f2fs.h
+++ b/include/trace/events/f2fs.h
@@ -1090,17 +1090,15 @@ DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_write_bio,
TRACE_EVENT(f2fs_write_begin,
- TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
- unsigned int flags),
+ TP_PROTO(struct inode *inode, loff_t pos, unsigned int len),
- TP_ARGS(inode, pos, len, flags),
+ TP_ARGS(inode, pos, len),
TP_STRUCT__entry(
__field(dev_t, dev)
__field(ino_t, ino)
__field(loff_t, pos)
__field(unsigned int, len)
- __field(unsigned int, flags)
),
TP_fast_assign(
@@ -1108,14 +1106,12 @@ TRACE_EVENT(f2fs_write_begin,
__entry->ino = inode->i_ino;
__entry->pos = pos;
__entry->len = len;
- __entry->flags = flags;
),
- TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, flags = %u",
+ TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u",
show_dev_ino(__entry),
(unsigned long long)__entry->pos,
- __entry->len,
- __entry->flags)
+ __entry->len)
);
TRACE_EVENT(f2fs_write_end,
diff --git a/mm/filemap.c b/mm/filemap.c
index 07d28fedd62f..64f768e10fbd 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2974,13 +2974,12 @@ inline ssize_t generic_write_checks(struct kiocb *iocb, struct iov_iter *from)
EXPORT_SYMBOL(generic_write_checks);
int pagecache_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
const struct address_space_operations *aops = mapping->a_ops;
- return aops->write_begin(file, mapping, pos, len, flags,
- pagep, fsdata);
+ return aops->write_begin(file, mapping, pos, len, pagep, fsdata);
}
EXPORT_SYMBOL(pagecache_write_begin);
@@ -3077,7 +3076,7 @@ EXPORT_SYMBOL(generic_file_direct_write);
* page. This function is specifically for buffered writes.
*/
struct page *grab_cache_page_write_begin(struct address_space *mapping,
- pgoff_t index, unsigned flags)
+ pgoff_t index)
{
struct page *page;
@@ -3097,7 +3096,6 @@ ssize_t generic_perform_write(struct file *file,
const struct address_space_operations *a_ops = mapping->a_ops;
long status = 0;
ssize_t written = 0;
- unsigned int flags = 0;
do {
struct page *page;
@@ -3131,7 +3129,7 @@ ssize_t generic_perform_write(struct file *file,
break;
}
- status = a_ops->write_begin(file, mapping, pos, bytes, flags,
+ status = a_ops->write_begin(file, mapping, pos, bytes,
&page, &fsdata);
if (unlikely(status < 0))
break;
diff --git a/mm/shmem.c b/mm/shmem.c
index 1907688b75ee..72f61a9631ea 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2352,7 +2352,7 @@ static int shmem_initxattrs(struct inode *, const struct xattr *, void *);
static int
shmem_write_begin(struct file *file, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{
struct inode *inode = mapping->host;
--
2.16.1
^ permalink raw reply related [flat|nested] 16+ messages in thread