diff options
author | Christoph Hellwig <hch@lst.de> | 2010-06-04 05:29:55 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-08-09 16:47:31 -0400 |
commit | 282dc178849882289d30e58b54be6b2799b351aa (patch) | |
tree | 4c6697cdf2d914889e002f32af6bf51bb2750063 /fs/qnx4 | |
parent | ea0f04e59543bafb3d2cbe37a0d375acb0bb2c34 (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/qnx4')
-rw-r--r-- | fs/qnx4/inode.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/qnx4/inode.c b/fs/qnx4/inode.c index 277575ddc05c..16829722be93 100644 --- a/fs/qnx4/inode.c +++ b/fs/qnx4/inode.c | |||
@@ -320,10 +320,19 @@ static int qnx4_write_begin(struct file *file, struct address_space *mapping, | |||
320 | struct page **pagep, void **fsdata) | 320 | struct page **pagep, void **fsdata) |
321 | { | 321 | { |
322 | struct qnx4_inode_info *qnx4_inode = qnx4_i(mapping->host); | 322 | struct qnx4_inode_info *qnx4_inode = qnx4_i(mapping->host); |
323 | int ret; | ||
324 | |||
323 | *pagep = NULL; | 325 | *pagep = NULL; |
324 | return cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata, | 326 | ret = cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata, |
325 | qnx4_get_block, | 327 | qnx4_get_block, |
326 | &qnx4_inode->mmu_private); | 328 | &qnx4_inode->mmu_private); |
329 | if (unlikely(ret)) { | ||
330 | loff_t isize = mapping->host->i_size; | ||
331 | if (pos + len > isize) | ||
332 | vmtruncate(mapping->host, isize); | ||
333 | } | ||
334 | |||
335 | return ret; | ||
327 | } | 336 | } |
328 | static sector_t qnx4_bmap(struct address_space *mapping, sector_t block) | 337 | static sector_t qnx4_bmap(struct address_space *mapping, sector_t block) |
329 | { | 338 | { |