mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
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>
This commit is contained in:
parent
d5daaaff24
commit
5f2e354f52
@ -131,6 +131,24 @@ static int hpfs_write_begin(struct file *file, struct address_space *mapping,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int hpfs_write_end(struct file *file, struct address_space *mapping,
|
||||
loff_t pos, unsigned len, unsigned copied,
|
||||
struct page *pagep, void *fsdata)
|
||||
{
|
||||
struct inode *inode = mapping->host;
|
||||
int err;
|
||||
err = generic_write_end(file, mapping, pos, len, copied, pagep, fsdata);
|
||||
if (err < len)
|
||||
hpfs_write_failed(mapping, pos + len);
|
||||
if (!(err < 0)) {
|
||||
/* make sure we write it on close, if not earlier */
|
||||
hpfs_lock(inode->i_sb);
|
||||
hpfs_i(inode)->i_dirty = 1;
|
||||
hpfs_unlock(inode->i_sb);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static sector_t _hpfs_bmap(struct address_space *mapping, sector_t block)
|
||||
{
|
||||
return generic_block_bmap(mapping,block,hpfs_get_block);
|
||||
@ -140,30 +158,16 @@ const struct address_space_operations hpfs_aops = {
|
||||
.readpage = hpfs_readpage,
|
||||
.writepage = hpfs_writepage,
|
||||
.write_begin = hpfs_write_begin,
|
||||
.write_end = generic_write_end,
|
||||
.write_end = hpfs_write_end,
|
||||
.bmap = _hpfs_bmap
|
||||
};
|
||||
|
||||
static ssize_t hpfs_file_write(struct file *file, const char __user *buf,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
ssize_t retval;
|
||||
|
||||
retval = do_sync_write(file, buf, count, ppos);
|
||||
if (retval > 0) {
|
||||
hpfs_lock(file->f_path.dentry->d_sb);
|
||||
hpfs_i(file_inode(file))->i_dirty = 1;
|
||||
hpfs_unlock(file->f_path.dentry->d_sb);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
const struct file_operations hpfs_file_ops =
|
||||
{
|
||||
.llseek = generic_file_llseek,
|
||||
.read = do_sync_read,
|
||||
.aio_read = generic_file_aio_read,
|
||||
.write = hpfs_file_write,
|
||||
.write = do_sync_write,
|
||||
.aio_write = generic_file_aio_write,
|
||||
.mmap = generic_file_mmap,
|
||||
.release = hpfs_file_release,
|
||||
|
Loading…
Reference in New Issue
Block a user