diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-03-19 20:35:00 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-04-09 14:12:55 -0400 |
commit | 5f2e354f5212a49fc639c25de2581cc8ae90d11b (patch) | |
tree | 1f363a92f895e881506da9cf53adb730c8bb6a77 /fs/hpfs/file.c | |
parent | d5daaaff24026d59130e97a406f2999118bafdc3 (diff) |
hpfs: move setting hpfs-private i_dirty to ->write_end()
... so that writev(2) doesn't miss it. Get rid of hpfs_file_write().
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/hpfs/file.c')
-rw-r--r-- | fs/hpfs/file.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/fs/hpfs/file.c b/fs/hpfs/file.c index 9f9dbeceeee7..3027f4dbbab5 100644 --- a/fs/hpfs/file.c +++ b/fs/hpfs/file.c | |||
@@ -131,6 +131,24 @@ static int hpfs_write_begin(struct file *file, struct address_space *mapping, | |||
131 | return ret; | 131 | return ret; |
132 | } | 132 | } |
133 | 133 | ||
134 | static int hpfs_write_end(struct file *file, struct address_space *mapping, | ||
135 | loff_t pos, unsigned len, unsigned copied, | ||
136 | struct page *pagep, void *fsdata) | ||
137 | { | ||
138 | struct inode *inode = mapping->host; | ||
139 | int err; | ||
140 | err = generic_write_end(file, mapping, pos, len, copied, pagep, fsdata); | ||
141 | if (err < len) | ||
142 | hpfs_write_failed(mapping, pos + len); | ||
143 | if (!(err < 0)) { | ||
144 | /* make sure we write it on close, if not earlier */ | ||
145 | hpfs_lock(inode->i_sb); | ||
146 | hpfs_i(inode)->i_dirty = 1; | ||
147 | hpfs_unlock(inode->i_sb); | ||
148 | } | ||
149 | return err; | ||
150 | } | ||
151 | |||
134 | static sector_t _hpfs_bmap(struct address_space *mapping, sector_t block) | 152 | static sector_t _hpfs_bmap(struct address_space *mapping, sector_t block) |
135 | { | 153 | { |
136 | return generic_block_bmap(mapping,block,hpfs_get_block); | 154 | return generic_block_bmap(mapping,block,hpfs_get_block); |
@@ -140,30 +158,16 @@ const struct address_space_operations hpfs_aops = { | |||
140 | .readpage = hpfs_readpage, | 158 | .readpage = hpfs_readpage, |
141 | .writepage = hpfs_writepage, | 159 | .writepage = hpfs_writepage, |
142 | .write_begin = hpfs_write_begin, | 160 | .write_begin = hpfs_write_begin, |
143 | .write_end = generic_write_end, | 161 | .write_end = hpfs_write_end, |
144 | .bmap = _hpfs_bmap | 162 | .bmap = _hpfs_bmap |
145 | }; | 163 | }; |
146 | 164 | ||
147 | static ssize_t hpfs_file_write(struct file *file, const char __user *buf, | ||
148 | size_t count, loff_t *ppos) | ||
149 | { | ||
150 | ssize_t retval; | ||
151 | |||
152 | retval = do_sync_write(file, buf, count, ppos); | ||
153 | if (retval > 0) { | ||
154 | hpfs_lock(file->f_path.dentry->d_sb); | ||
155 | hpfs_i(file_inode(file))->i_dirty = 1; | ||
156 | hpfs_unlock(file->f_path.dentry->d_sb); | ||
157 | } | ||
158 | return retval; | ||
159 | } | ||
160 | |||
161 | const struct file_operations hpfs_file_ops = | 165 | const struct file_operations hpfs_file_ops = |
162 | { | 166 | { |
163 | .llseek = generic_file_llseek, | 167 | .llseek = generic_file_llseek, |
164 | .read = do_sync_read, | 168 | .read = do_sync_read, |
165 | .aio_read = generic_file_aio_read, | 169 | .aio_read = generic_file_aio_read, |
166 | .write = hpfs_file_write, | 170 | .write = do_sync_write, |
167 | .aio_write = generic_file_aio_write, | 171 | .aio_write = generic_file_aio_write, |
168 | .mmap = generic_file_mmap, | 172 | .mmap = generic_file_mmap, |
169 | .release = hpfs_file_release, | 173 | .release = hpfs_file_release, |