Re: [EXPERIMENT] Add new "flush" option

From: OGAWA Hirofumi
Date: Sun Dec 25 2005 - 11:02:01 EST


I was missing the following part. Sorry.

Andrew Morton <akpm@xxxxxxxx> 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@xxxxxxxxxxxxxxxxxx>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/