diff options
author | Nick Piggin <npiggin@suse.de> | 2007-10-16 01:25:26 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 09:42:58 -0700 |
commit | 55144768e100b68447f44c5e5c9deb155ad661bd (patch) | |
tree | 9889682ee3b64627ad9eb504f30672fad844752f /mm/filemap.c | |
parent | 03158cd7eb3374843de68421142ca5900df845d9 (diff) | |
download | kernel_samsung_smdk4412-55144768e100b68447f44c5e5c9deb155ad661bd.tar.gz kernel_samsung_smdk4412-55144768e100b68447f44c5e5c9deb155ad661bd.tar.bz2 kernel_samsung_smdk4412-55144768e100b68447f44c5e5c9deb155ad661bd.zip |
fs: remove some AOP_TRUNCATED_PAGE
prepare/commit_write no longer returns AOP_TRUNCATED_PAGE since OCFS2 and
GFS2 were converted to the new aops, so we can make some simplifications
for that.
[michal.k.k.piotrowski@gmail.com: fix warning]
Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Michael Halcrow <mhalcrow@us.ibm.com>
Cc: Mark Fasheh <mark.fasheh@oracle.com>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: Michal Piotrowski <michal.k.k.piotrowski@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/filemap.c')
-rw-r--r-- | mm/filemap.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/mm/filemap.c b/mm/filemap.c index 195339b27e9..c6049e947cd 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1898,13 +1898,10 @@ again: ret = aops->prepare_write(file, page, offset, offset+len); if (ret) { - if (ret != AOP_TRUNCATED_PAGE) - unlock_page(page); + unlock_page(page); page_cache_release(page); if (pos + len > inode->i_size) vmtruncate(inode, inode->i_size); - if (ret == AOP_TRUNCATED_PAGE) - goto again; } return ret; } @@ -1931,7 +1928,6 @@ int pagecache_write_end(struct file *file, struct address_space *mapping, unlock_page(page); mark_page_accessed(page); page_cache_release(page); - BUG_ON(ret == AOP_TRUNCATED_PAGE); /* can't deal with */ if (ret < 0) { if (pos + len > inode->i_size) @@ -2142,7 +2138,7 @@ static ssize_t generic_perform_write_2copy(struct file *file, flush_dcache_page(page); status = a_ops->commit_write(file, page, offset, offset+bytes); - if (unlikely(status < 0 || status == AOP_TRUNCATED_PAGE)) + if (unlikely(status < 0)) goto fs_write_aop_error; if (unlikely(status > 0)) /* filesystem did partial write */ copied = min_t(size_t, copied, status); @@ -2162,8 +2158,7 @@ static ssize_t generic_perform_write_2copy(struct file *file, continue; fs_write_aop_error: - if (status != AOP_TRUNCATED_PAGE) - unlock_page(page); + unlock_page(page); page_cache_release(page); if (src_page) page_cache_release(src_page); @@ -2175,10 +2170,7 @@ fs_write_aop_error: */ if (pos + bytes > inode->i_size) vmtruncate(inode, inode->i_size); - if (status == AOP_TRUNCATED_PAGE) - continue; - else - break; + break; } while (iov_iter_count(i)); return written ? written : status; |