patch-2.4.10 linux/fs/minix/file.c

Next file: linux/fs/minix/inode.c
Previous file: linux/fs/minix/dir.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.9/linux/fs/minix/file.c linux/fs/minix/file.c
@@ -13,9 +13,10 @@
  * We have mostly NULLs here: the current defaults are OK for
  * the minix filesystem.
  */
-static int minix_sync_file(struct file *, struct dentry *, int);
+int minix_sync_file(struct file *, struct dentry *, int);
 
 struct file_operations minix_file_operations = {
+	llseek:		generic_file_llseek,
 	read:		generic_file_read,
 	write:		generic_file_write,
 	mmap:		generic_file_mmap,
@@ -26,14 +27,16 @@
 	truncate:	minix_truncate,
 };
 
-static int minix_sync_file(struct file * file,
-			   struct dentry *dentry,
-			   int datasync)
+int minix_sync_file(struct file * file, struct dentry *dentry, int datasync)
 {
 	struct inode *inode = dentry->d_inode;
+	int err  = fsync_inode_buffers(inode);
 
-	if (INODE_VERSION(inode) == MINIX_V1)
-		return V1_minix_sync_file(inode);
-	else
-		return V2_minix_sync_file(inode);
+	if (!(inode->i_state & I_DIRTY))
+		return err;
+	if (datasync && !(inode->i_state & I_DIRTY_DATASYNC))
+		return err;
+	
+	err |= minix_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)