Messages in this thread | | | Subject | Re: [EXPERIMENT] Add new "flush" option | From | OGAWA Hirofumi <> | Date | Mon, 26 Dec 2005 01:02:52 +0900 |
| |
I was missing the following part. Sorry.
Andrew Morton <akpm@osdl.org> 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 <hirofumi@mail.parknet.co.jp> - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |