提交 5f2e354f 编写于 作者: A Al Viro

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: NAl Viro <viro@zeniv.linux.org.uk>
上级 d5daaaff
...@@ -131,6 +131,24 @@ static int hpfs_write_begin(struct file *file, struct address_space *mapping, ...@@ -131,6 +131,24 @@ static int hpfs_write_begin(struct file *file, struct address_space *mapping,
return ret; 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) static sector_t _hpfs_bmap(struct address_space *mapping, sector_t block)
{ {
return generic_block_bmap(mapping,block,hpfs_get_block); return generic_block_bmap(mapping,block,hpfs_get_block);
...@@ -140,30 +158,16 @@ const struct address_space_operations hpfs_aops = { ...@@ -140,30 +158,16 @@ const struct address_space_operations hpfs_aops = {
.readpage = hpfs_readpage, .readpage = hpfs_readpage,
.writepage = hpfs_writepage, .writepage = hpfs_writepage,
.write_begin = hpfs_write_begin, .write_begin = hpfs_write_begin,
.write_end = generic_write_end, .write_end = hpfs_write_end,
.bmap = _hpfs_bmap .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 = const struct file_operations hpfs_file_ops =
{ {
.llseek = generic_file_llseek, .llseek = generic_file_llseek,
.read = do_sync_read, .read = do_sync_read,
.aio_read = generic_file_aio_read, .aio_read = generic_file_aio_read,
.write = hpfs_file_write, .write = do_sync_write,
.aio_write = generic_file_aio_write, .aio_write = generic_file_aio_write,
.mmap = generic_file_mmap, .mmap = generic_file_mmap,
.release = hpfs_file_release, .release = hpfs_file_release,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册