Commit 7ca0643e authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] bdev: generic_osync_inode() conversion

From: viro@parcelfarce.linux.theplanet.co.uk <viro@parcelfarce.linux.theplanet.co.uk>

generic_osync_inode() got an extra argument - mapping and doesn't calculate
inode->i_mapping anymore.  Callers updated and switched to use of
->f_mapping.
parent df6a148f
......@@ -514,7 +514,7 @@ EXPORT_SYMBOL(write_inode_now);
* OSYNC_INODE: the inode itself
*/
int generic_osync_inode(struct inode *inode, int what)
int generic_osync_inode(struct inode *inode, struct address_space *mapping, int what)
{
int err = 0;
int need_write_inode_now = 0;
......@@ -522,14 +522,14 @@ int generic_osync_inode(struct inode *inode, int what)
current->flags |= PF_SYNCWRITE;
if (what & OSYNC_DATA)
err = filemap_fdatawrite(inode->i_mapping);
err = filemap_fdatawrite(mapping);
if (what & (OSYNC_METADATA|OSYNC_DATA)) {
err2 = sync_mapping_buffers(inode->i_mapping);
err2 = sync_mapping_buffers(mapping);
if (!err)
err = err2;
}
if (what & OSYNC_DATA) {
err2 = filemap_fdatawait(inode->i_mapping);
err2 = filemap_fdatawait(mapping);
if (!err)
err = err2;
}
......
......@@ -1179,7 +1179,7 @@ ssize_t reiserfs_file_write( struct file *file, /* the file we are going to writ
}
if ((file->f_flags & O_SYNC) || IS_SYNC(inode))
res = generic_osync_inode(inode, OSYNC_METADATA|OSYNC_DATA);
res = generic_osync_inode(inode, file->f_mapping, OSYNC_METADATA|OSYNC_DATA);
up(&inode->i_sem);
return (already_written != 0)?already_written:res;
......
......@@ -210,7 +210,7 @@ int nobh_truncate_page(struct address_space *, loff_t);
#define OSYNC_METADATA (1<<0)
#define OSYNC_DATA (1<<1)
#define OSYNC_INODE (1<<2)
int generic_osync_inode(struct inode *, int);
int generic_osync_inode(struct inode *, struct address_space *, int);
/*
......
......@@ -1798,7 +1798,7 @@ generic_file_aio_write_nolock(struct kiocb *iocb, const struct iovec *iov,
* of course not the data as we did direct DMA for the IO.
*/
if (written >= 0 && file->f_flags & O_SYNC)
status = generic_osync_inode(inode, OSYNC_METADATA);
status = generic_osync_inode(inode, mapping, OSYNC_METADATA);
if (written >= 0 && !is_sync_kiocb(iocb))
written = -EIOCBQUEUED;
goto out_status;
......@@ -1886,7 +1886,7 @@ generic_file_aio_write_nolock(struct kiocb *iocb, const struct iovec *iov,
*/
if (status >= 0) {
if ((file->f_flags & O_SYNC) || IS_SYNC(inode))
status = generic_osync_inode(inode,
status = generic_osync_inode(inode, mapping,
OSYNC_METADATA|OSYNC_DATA);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment