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

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)