Commit dcd6158d authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong

iomap: always use AOP_FLAG_NOFS in iomap_write_begin

All callers pass AOP_FLAG_NOFS, so lift that flag to iomap_write_begin
to allow reusing the flags arguments for an internal flags namespace
soon.  Also remove the local index variable that is only used once.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent c12d6fa8
...@@ -621,7 +621,6 @@ iomap_write_begin(struct inode *inode, loff_t pos, unsigned len, unsigned flags, ...@@ -621,7 +621,6 @@ iomap_write_begin(struct inode *inode, loff_t pos, unsigned len, unsigned flags,
struct page **pagep, struct iomap *iomap) struct page **pagep, struct iomap *iomap)
{ {
const struct iomap_page_ops *page_ops = iomap->page_ops; const struct iomap_page_ops *page_ops = iomap->page_ops;
pgoff_t index = pos >> PAGE_SHIFT;
struct page *page; struct page *page;
int status = 0; int status = 0;
...@@ -636,7 +635,8 @@ iomap_write_begin(struct inode *inode, loff_t pos, unsigned len, unsigned flags, ...@@ -636,7 +635,8 @@ iomap_write_begin(struct inode *inode, loff_t pos, unsigned len, unsigned flags,
return status; return status;
} }
page = grab_cache_page_write_begin(inode->i_mapping, index, flags); page = grab_cache_page_write_begin(inode->i_mapping, pos >> PAGE_SHIFT,
AOP_FLAG_NOFS);
if (!page) { if (!page) {
status = -ENOMEM; status = -ENOMEM;
goto out_no_page; goto out_no_page;
...@@ -778,7 +778,6 @@ iomap_write_actor(struct inode *inode, loff_t pos, loff_t length, void *data, ...@@ -778,7 +778,6 @@ iomap_write_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
struct iov_iter *i = data; struct iov_iter *i = data;
long status = 0; long status = 0;
ssize_t written = 0; ssize_t written = 0;
unsigned int flags = AOP_FLAG_NOFS;
do { do {
struct page *page; struct page *page;
...@@ -808,8 +807,7 @@ iomap_write_actor(struct inode *inode, loff_t pos, loff_t length, void *data, ...@@ -808,8 +807,7 @@ iomap_write_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
break; break;
} }
status = iomap_write_begin(inode, pos, bytes, flags, &page, status = iomap_write_begin(inode, pos, bytes, 0, &page, iomap);
iomap);
if (unlikely(status)) if (unlikely(status))
break; break;
...@@ -907,8 +905,7 @@ iomap_dirty_actor(struct inode *inode, loff_t pos, loff_t length, void *data, ...@@ -907,8 +905,7 @@ iomap_dirty_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
if (IS_ERR(rpage)) if (IS_ERR(rpage))
return PTR_ERR(rpage); return PTR_ERR(rpage);
status = iomap_write_begin(inode, pos, bytes, status = iomap_write_begin(inode, pos, bytes, 0, &page, iomap);
AOP_FLAG_NOFS, &page, iomap);
put_page(rpage); put_page(rpage);
if (unlikely(status)) if (unlikely(status))
return status; return status;
...@@ -959,8 +956,7 @@ static int iomap_zero(struct inode *inode, loff_t pos, unsigned offset, ...@@ -959,8 +956,7 @@ static int iomap_zero(struct inode *inode, loff_t pos, unsigned offset,
struct page *page; struct page *page;
int status; int status;
status = iomap_write_begin(inode, pos, bytes, AOP_FLAG_NOFS, &page, status = iomap_write_begin(inode, pos, bytes, 0, &page, iomap);
iomap);
if (status) if (status)
return status; return status;
......
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