I was missing the following part. Sorry.
Andrew Morton <[email protected]> writes:
> You can use filp->f_mapping here, remove the inode* argument.
Ah, I see. However, it is intended to use as ->release() handler.
So, I updated the patch as following.
+int fs_flush_sync_fdata(struct inode *inode, struct file *filp)
+{
+ int err = 0;
+
+ if (IS_FLUSH(inode) && filp->f_mode & FMODE_WRITE) {
+ current->flags |= PF_SYNCWRITE;
+ err = filemap_write_and_wait(filp->f_mapping);
+ current->flags &= ~PF_SYNCWRITE;
+ }
+ return err;
+}
--
OGAWA Hirofumi <[email protected]>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]