diff options
Diffstat (limited to 'fs/hpfs/file.c')
-rw-r--r-- | fs/hpfs/file.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/fs/hpfs/file.c b/fs/hpfs/file.c index 3efabff00367..c0340887c7ea 100644 --- a/fs/hpfs/file.c +++ b/fs/hpfs/file.c | |||
@@ -19,9 +19,9 @@ static int hpfs_file_release(struct inode *inode, struct file *file) | |||
19 | return 0; | 19 | return 0; |
20 | } | 20 | } |
21 | 21 | ||
22 | int hpfs_file_fsync(struct file *file, struct dentry *dentry, int datasync) | 22 | int hpfs_file_fsync(struct file *file, int datasync) |
23 | { | 23 | { |
24 | /*return file_fsync(file, dentry);*/ | 24 | /*return file_fsync(file, datasync);*/ |
25 | return 0; /* Don't fsync :-) */ | 25 | return 0; /* Don't fsync :-) */ |
26 | } | 26 | } |
27 | 27 | ||
@@ -97,10 +97,19 @@ static int hpfs_write_begin(struct file *file, struct address_space *mapping, | |||
97 | loff_t pos, unsigned len, unsigned flags, | 97 | loff_t pos, unsigned len, unsigned flags, |
98 | struct page **pagep, void **fsdata) | 98 | struct page **pagep, void **fsdata) |
99 | { | 99 | { |
100 | int ret; | ||
101 | |||
100 | *pagep = NULL; | 102 | *pagep = NULL; |
101 | return cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata, | 103 | ret = cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata, |
102 | hpfs_get_block, | 104 | hpfs_get_block, |
103 | &hpfs_i(mapping->host)->mmu_private); | 105 | &hpfs_i(mapping->host)->mmu_private); |
106 | if (unlikely(ret)) { | ||
107 | loff_t isize = mapping->host->i_size; | ||
108 | if (pos + len > isize) | ||
109 | vmtruncate(mapping->host, isize); | ||
110 | } | ||
111 | |||
112 | return ret; | ||
104 | } | 113 | } |
105 | 114 | ||
106 | static sector_t _hpfs_bmap(struct address_space *mapping, sector_t block) | 115 | static sector_t _hpfs_bmap(struct address_space *mapping, sector_t block) |