aboutsummaryrefslogtreecommitdiffstats
path: root/fs/buffer.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2010-06-04 05:29:55 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2010-08-09 16:47:31 -0400
commit282dc178849882289d30e58b54be6b2799b351aa (patch)
tree4c6697cdf2d914889e002f32af6bf51bb2750063 /fs/buffer.c
parentea0f04e59543bafb3d2cbe37a0d375acb0bb2c34 (diff)
get rid of cont_write_begin_newtrunc
Move the call to vmtruncate to get rid of accessive blocks to the callers in preparation of the new truncate sequence and rename the non-truncating version to cont_write_begin. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/buffer.c')
-rw-r--r--fs/buffer.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index 559daf76bca4..14529ec759b9 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2351,7 +2351,7 @@ out:
2351 * For moronic filesystems that do not allow holes in file. 2351 * For moronic filesystems that do not allow holes in file.
2352 * We may have to extend the file. 2352 * We may have to extend the file.
2353 */ 2353 */
2354int cont_write_begin_newtrunc(struct file *file, struct address_space *mapping, 2354int cont_write_begin(struct file *file, struct address_space *mapping,
2355 loff_t pos, unsigned len, unsigned flags, 2355 loff_t pos, unsigned len, unsigned flags,
2356 struct page **pagep, void **fsdata, 2356 struct page **pagep, void **fsdata,
2357 get_block_t *get_block, loff_t *bytes) 2357 get_block_t *get_block, loff_t *bytes)
@@ -2377,25 +2377,6 @@ int cont_write_begin_newtrunc(struct file *file, struct address_space *mapping,
2377out: 2377out:
2378 return err; 2378 return err;
2379} 2379}
2380EXPORT_SYMBOL(cont_write_begin_newtrunc);
2381
2382int cont_write_begin(struct file *file, struct address_space *mapping,
2383 loff_t pos, unsigned len, unsigned flags,
2384 struct page **pagep, void **fsdata,
2385 get_block_t *get_block, loff_t *bytes)
2386{
2387 int ret;
2388
2389 ret = cont_write_begin_newtrunc(file, mapping, pos, len, flags,
2390 pagep, fsdata, get_block, bytes);
2391 if (unlikely(ret)) {
2392 loff_t isize = mapping->host->i_size;
2393 if (pos + len > isize)
2394 vmtruncate(mapping->host, isize);
2395 }
2396
2397 return ret;
2398}
2399EXPORT_SYMBOL(cont_write_begin); 2380EXPORT_SYMBOL(cont_write_begin);
2400 2381
2401int block_prepare_write(struct page *page, unsigned from, unsigned to, 2382int block_prepare_write(struct page *page, unsigned from, unsigned to,