提交 c718a975 编写于 作者: T Tetsuo Handa 提交者: Linus Torvalds

fs: semove set but not checked AOP_FLAG_UNINTERRUPTIBLE flag

Commit afddba49 ("fs: introduce write_begin, write_end, and
perform_write aops") introduced AOP_FLAG_UNINTERRUPTIBLE flag which was
checked in pagecache_write_begin(), but that check was removed by
4e02ed4b ("fs: remove prepare_write/commit_write").

Between these two commits, commit d9414774 ("cifs: Convert cifs to
new aops.") added a check in cifs_write_begin(), but that check was soon
removed by commit a98ee8c1 ("[CIFS] fix regression in
cifs_write_begin/cifs_write_end").

Therefore, AOP_FLAG_UNINTERRUPTIBLE flag is checked nowhere.  Let's
remove this flag.  This patch has no functionality changes.

Link: http://lkml.kernel.org/r/1489294781-53494-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jpSigned-off-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Reviewed-by: NJeff Layton <jlayton@redhat.com>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Cc: Nick Piggin <npiggin@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 f44a2920
...@@ -694,8 +694,7 @@ struct address_space_operations { ...@@ -694,8 +694,7 @@ struct address_space_operations {
write_end: After a successful write_begin, and data copy, write_end must write_end: After a successful write_begin, and data copy, write_end must
be called. len is the original len passed to write_begin, and copied be called. len is the original len passed to write_begin, and copied
is the amount that was able to be copied (copied == len is always true is the amount that was able to be copied.
if write_begin was called with the AOP_FLAG_UNINTERRUPTIBLE flag).
The filesystem must take care of unlocking the page and releasing it The filesystem must take care of unlocking the page and releasing it
refcount, and updating i_size. refcount, and updating i_size.
......
...@@ -2379,8 +2379,7 @@ int generic_cont_expand_simple(struct inode *inode, loff_t size) ...@@ -2379,8 +2379,7 @@ int generic_cont_expand_simple(struct inode *inode, loff_t size)
goto out; goto out;
err = pagecache_write_begin(NULL, mapping, size, 0, err = pagecache_write_begin(NULL, mapping, size, 0,
AOP_FLAG_UNINTERRUPTIBLE|AOP_FLAG_CONT_EXPAND, AOP_FLAG_CONT_EXPAND, &page, &fsdata);
&page, &fsdata);
if (err) if (err)
goto out; goto out;
...@@ -2415,8 +2414,7 @@ static int cont_expand_zero(struct file *file, struct address_space *mapping, ...@@ -2415,8 +2414,7 @@ static int cont_expand_zero(struct file *file, struct address_space *mapping,
} }
len = PAGE_SIZE - zerofrom; len = PAGE_SIZE - zerofrom;
err = pagecache_write_begin(file, mapping, curpos, len, err = pagecache_write_begin(file, mapping, curpos, len, 0,
AOP_FLAG_UNINTERRUPTIBLE,
&page, &fsdata); &page, &fsdata);
if (err) if (err)
goto out; goto out;
...@@ -2449,8 +2447,7 @@ static int cont_expand_zero(struct file *file, struct address_space *mapping, ...@@ -2449,8 +2447,7 @@ static int cont_expand_zero(struct file *file, struct address_space *mapping,
} }
len = offset - zerofrom; len = offset - zerofrom;
err = pagecache_write_begin(file, mapping, curpos, len, err = pagecache_write_begin(file, mapping, curpos, len, 0,
AOP_FLAG_UNINTERRUPTIBLE,
&page, &fsdata); &page, &fsdata);
if (err) if (err)
goto out; goto out;
......
...@@ -405,8 +405,7 @@ int exofs_set_link(struct inode *dir, struct exofs_dir_entry *de, ...@@ -405,8 +405,7 @@ int exofs_set_link(struct inode *dir, struct exofs_dir_entry *de,
int err; int err;
lock_page(page); lock_page(page);
err = exofs_write_begin(NULL, page->mapping, pos, len, err = exofs_write_begin(NULL, page->mapping, pos, len, 0, &page, NULL);
AOP_FLAG_UNINTERRUPTIBLE, &page, NULL);
if (err) if (err)
EXOFS_ERR("exofs_set_link: exofs_write_begin FAILED => %d\n", EXOFS_ERR("exofs_set_link: exofs_write_begin FAILED => %d\n",
err); err);
......
...@@ -485,8 +485,8 @@ void hfs_file_truncate(struct inode *inode) ...@@ -485,8 +485,8 @@ void hfs_file_truncate(struct inode *inode)
/* XXX: Can use generic_cont_expand? */ /* XXX: Can use generic_cont_expand? */
size = inode->i_size - 1; size = inode->i_size - 1;
res = pagecache_write_begin(NULL, mapping, size+1, 0, res = pagecache_write_begin(NULL, mapping, size+1, 0, 0,
AOP_FLAG_UNINTERRUPTIBLE, &page, &fsdata); &page, &fsdata);
if (!res) { if (!res) {
res = pagecache_write_end(NULL, mapping, size+1, 0, 0, res = pagecache_write_end(NULL, mapping, size+1, 0, 0,
page, fsdata); page, fsdata);
......
...@@ -545,8 +545,7 @@ void hfsplus_file_truncate(struct inode *inode) ...@@ -545,8 +545,7 @@ void hfsplus_file_truncate(struct inode *inode)
void *fsdata; void *fsdata;
loff_t size = inode->i_size; loff_t size = inode->i_size;
res = pagecache_write_begin(NULL, mapping, size, 0, res = pagecache_write_begin(NULL, mapping, size, 0, 0,
AOP_FLAG_UNINTERRUPTIBLE,
&page, &fsdata); &page, &fsdata);
if (res) if (res)
return; return;
......
...@@ -158,12 +158,6 @@ iomap_write_actor(struct inode *inode, loff_t pos, loff_t length, void *data, ...@@ -158,12 +158,6 @@ iomap_write_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
ssize_t written = 0; ssize_t written = 0;
unsigned int flags = AOP_FLAG_NOFS; unsigned int flags = AOP_FLAG_NOFS;
/*
* Copies from kernel address space cannot fail (NFSD is a big user).
*/
if (!iter_is_iovec(i))
flags |= AOP_FLAG_UNINTERRUPTIBLE;
do { do {
struct page *page; struct page *page;
unsigned long offset; /* Offset into pagecache page */ unsigned long offset; /* Offset into pagecache page */
...@@ -291,8 +285,7 @@ iomap_dirty_actor(struct inode *inode, loff_t pos, loff_t length, void *data, ...@@ -291,8 +285,7 @@ iomap_dirty_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
return PTR_ERR(rpage); return PTR_ERR(rpage);
status = iomap_write_begin(inode, pos, bytes, status = iomap_write_begin(inode, pos, bytes,
AOP_FLAG_NOFS | AOP_FLAG_UNINTERRUPTIBLE, AOP_FLAG_NOFS, &page, iomap);
&page, iomap);
put_page(rpage); put_page(rpage);
if (unlikely(status)) if (unlikely(status))
return status; return status;
...@@ -343,8 +336,8 @@ static int iomap_zero(struct inode *inode, loff_t pos, unsigned offset, ...@@ -343,8 +336,8 @@ 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, status = iomap_write_begin(inode, pos, bytes, AOP_FLAG_NOFS, &page,
AOP_FLAG_UNINTERRUPTIBLE | AOP_FLAG_NOFS, &page, iomap); iomap);
if (status) if (status)
return status; return status;
......
...@@ -4766,7 +4766,7 @@ int __page_symlink(struct inode *inode, const char *symname, int len, int nofs) ...@@ -4766,7 +4766,7 @@ int __page_symlink(struct inode *inode, const char *symname, int len, int nofs)
struct page *page; struct page *page;
void *fsdata; void *fsdata;
int err; int err;
unsigned int flags = AOP_FLAG_UNINTERRUPTIBLE; unsigned int flags = 0;
if (nofs) if (nofs)
flags |= AOP_FLAG_NOFS; flags |= AOP_FLAG_NOFS;
......
...@@ -250,9 +250,8 @@ enum positive_aop_returns { ...@@ -250,9 +250,8 @@ enum positive_aop_returns {
AOP_TRUNCATED_PAGE = 0x80001, AOP_TRUNCATED_PAGE = 0x80001,
}; };
#define AOP_FLAG_UNINTERRUPTIBLE 0x0001 /* will not do a short write */ #define AOP_FLAG_CONT_EXPAND 0x0001 /* called from cont_expand */
#define AOP_FLAG_CONT_EXPAND 0x0002 /* called from cont_expand */ #define AOP_FLAG_NOFS 0x0002 /* used by filesystem to direct
#define AOP_FLAG_NOFS 0x0004 /* used by filesystem to direct
* helper code (eg buffer layer) * helper code (eg buffer layer)
* to clear GFP_FS from alloc */ * to clear GFP_FS from alloc */
......
...@@ -2791,12 +2791,6 @@ ssize_t generic_perform_write(struct file *file, ...@@ -2791,12 +2791,6 @@ ssize_t generic_perform_write(struct file *file,
ssize_t written = 0; ssize_t written = 0;
unsigned int flags = 0; unsigned int flags = 0;
/*
* Copies from kernel address space cannot fail (NFSD is a big user).
*/
if (!iter_is_iovec(i))
flags |= AOP_FLAG_UNINTERRUPTIBLE;
do { do {
struct page *page; struct page *page;
unsigned long offset; /* Offset into pagecache page */ unsigned long offset; /* Offset into pagecache page */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册