diff options
author | Nick Piggin <npiggin@suse.de> | 2007-10-16 04:25:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:42:58 -0400 |
commit | 55144768e100b68447f44c5e5c9deb155ad661bd (patch) | |
tree | 9889682ee3b64627ad9eb504f30672fad844752f /mm/filemap.c | |
parent | 03158cd7eb3374843de68421142ca5900df845d9 (diff) |
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 195339b27e9a..c6049e947cd9 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
@@ -1898,13 +1898,10 @@ again: | |||
1898 | 1898 | ||
1899 | ret = aops->prepare_write(file, page, offset, offset+len); | 1899 | ret = aops->prepare_write(file, page, offset, offset+len); |
1900 | if (ret) { | 1900 | if (ret) { |
1901 | if (ret != AOP_TRUNCATED_PAGE) | 1901 | unlock_page(page); |
1902 | unlock_page(page); | ||
1903 | page_cache_release(page); | 1902 | page_cache_release(page); |
1904 | if (pos + len > inode->i_size) | 1903 | if (pos + len > inode->i_size) |
1905 | vmtruncate(inode, inode->i_size); | 1904 | vmtruncate(inode, inode->i_size); |
1906 | if (ret == AOP_TRUNCATED_PAGE) | ||
1907 | goto again; | ||
1908 | } | 1905 | } |
1909 | return ret; | 1906 | return ret; |
1910 | } | 1907 | } |
@@ -1931,7 +1928,6 @@ int pagecache_write_end(struct file *file, struct address_space *mapping, | |||
1931 | unlock_page(page); | 1928 | unlock_page(page); |
1932 | mark_page_accessed(page); | 1929 | mark_page_accessed(page); |
1933 | page_cache_release(page); | 1930 | page_cache_release(page); |
1934 | BUG_ON(ret == AOP_TRUNCATED_PAGE); /* can't deal with */ | ||
1935 | 1931 | ||
1936 | if (ret < 0) { | 1932 | if (ret < 0) { |
1937 | if (pos + len > inode->i_size) | 1933 | if (pos + len > inode->i_size) |
@@ -2142,7 +2138,7 @@ static ssize_t generic_perform_write_2copy(struct file *file, | |||
2142 | flush_dcache_page(page); | 2138 | flush_dcache_page(page); |
2143 | 2139 | ||
2144 | status = a_ops->commit_write(file, page, offset, offset+bytes); | 2140 | status = a_ops->commit_write(file, page, offset, offset+bytes); |
2145 | if (unlikely(status < 0 || status == AOP_TRUNCATED_PAGE)) | 2141 | if (unlikely(status < 0)) |
2146 | goto fs_write_aop_error; | 2142 | goto fs_write_aop_error; |
2147 | if (unlikely(status > 0)) /* filesystem did partial write */ | 2143 | if (unlikely(status > 0)) /* filesystem did partial write */ |
2148 | copied = min_t(size_t, copied, status); | 2144 | copied = min_t(size_t, copied, status); |
@@ -2162,8 +2158,7 @@ static ssize_t generic_perform_write_2copy(struct file *file, | |||
2162 | continue; | 2158 | continue; |
2163 | 2159 | ||
2164 | fs_write_aop_error: | 2160 | fs_write_aop_error: |
2165 | if (status != AOP_TRUNCATED_PAGE) | 2161 | unlock_page(page); |
2166 | unlock_page(page); | ||
2167 | page_cache_release(page); | 2162 | page_cache_release(page); |
2168 | if (src_page) | 2163 | if (src_page) |
2169 | page_cache_release(src_page); | 2164 | page_cache_release(src_page); |
@@ -2175,10 +2170,7 @@ fs_write_aop_error: | |||
2175 | */ | 2170 | */ |
2176 | if (pos + bytes > inode->i_size) | 2171 | if (pos + bytes > inode->i_size) |
2177 | vmtruncate(inode, inode->i_size); | 2172 | vmtruncate(inode, inode->i_size); |
2178 | if (status == AOP_TRUNCATED_PAGE) | 2173 | break; |
2179 | continue; | ||
2180 | else | ||
2181 | break; | ||
2182 | } while (iov_iter_count(i)); | 2174 | } while (iov_iter_count(i)); |
2183 | 2175 | ||
2184 | return written ? written : status; | 2176 | return written ? written : status; |