lkml.org 
[lkml]   [2005]   [Dec]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [EXPERIMENT] Add new "flush" option
From
Date
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/

\
 
 \ /
  Last update: 2005-12-25 17:05    [W:0.045 / U:1.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site