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/adfs/inode.c | |
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/adfs/inode.c')
-rw-r--r-- | fs/adfs/inode.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/adfs/inode.c b/fs/adfs/inode.c index 6f850b06ab62..b3dec193036b 100644 --- a/fs/adfs/inode.c +++ b/fs/adfs/inode.c | |||
@@ -50,10 +50,19 @@ static int adfs_write_begin(struct file *file, struct address_space *mapping, | |||
50 | loff_t pos, unsigned len, unsigned flags, | 50 | loff_t pos, unsigned len, unsigned flags, |
51 | struct page **pagep, void **fsdata) | 51 | struct page **pagep, void **fsdata) |
52 | { | 52 | { |
53 | int ret; | ||
54 | |||
53 | *pagep = NULL; | 55 | *pagep = NULL; |
54 | return cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata, | 56 | ret = cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata, |
55 | adfs_get_block, | 57 | adfs_get_block, |
56 | &ADFS_I(mapping->host)->mmu_private); | 58 | &ADFS_I(mapping->host)->mmu_private); |
59 | if (unlikely(ret)) { | ||
60 | loff_t isize = mapping->host->i_size; | ||
61 | if (pos + len > isize) | ||
62 | vmtruncate(mapping->host, isize); | ||
63 | } | ||
64 | |||
65 | return ret; | ||
57 | } | 66 | } |
58 | 67 | ||
59 | static sector_t _adfs_bmap(struct address_space *mapping, sector_t block) | 68 | static sector_t _adfs_bmap(struct address_space *mapping, sector_t block) |