patch-2.4.6 linux/fs/sysv/file.c
Next file: linux/fs/sysv/fsync.c
Previous file: linux/fs/sysv/dir.c
Back to the patch index
Back to the overall index
- Lines: 18
- Date:
Mon Jul 2 14:03:04 2001
- Orig file:
v2.4.5/linux/fs/sysv/file.c
- Orig date:
Sat Feb 26 20:33:43 2000
diff -u --recursive --new-file v2.4.5/linux/fs/sysv/file.c linux/fs/sysv/file.c
@@ -31,3 +31,17 @@
truncate: sysv_truncate,
setattr: sysv_notify_change,
};
+
+int sysv_sync_file(struct file * file, struct dentry *dentry, int datasync)
+{
+ struct inode *inode = dentry->d_inode;
+ int err = fsync_inode_buffers(inode);
+
+ if (!(inode->i_state & I_DIRTY))
+ return err;
+ if (datasync && !(inode->i_state & I_DIRTY_DATASYNC))
+ return err;
+
+ err |= sysv_sync_inode(inode);
+ return err ? -EIO : 0;
+}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)