[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/gfs-kernel/src/gfs ops_file.c



CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	wcheng sourceware org	2007-06-17 03:35:03

Modified files:
	gfs-kernel/src/gfs: ops_file.c 

Log message:
	bugzilla 244343:
	
	Backport RHEL4 gfs datasync patch to head.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/ops_file.c.diff?cvsroot=cluster&r1=1.34&r2=1.35

--- cluster/gfs-kernel/src/gfs/ops_file.c	2007/06/06 15:11:54	1.34
+++ cluster/gfs-kernel/src/gfs/ops_file.c	2007/06/17 03:35:02	1.35
@@ -24,6 +24,7 @@
 #include <linux/blkdev.h>
 #include <linux/mm.h>
 #include <linux/aio.h>
+#include <linux/writeback.h>
 #include <asm/uaccess.h>
 
 #include "gfs_ioctl.h"
@@ -1528,6 +1529,7 @@
 {
 	struct gfs_inode *ip = get_v2ip(dentry->d_inode);
 	struct gfs_holder i_gh;
+	struct inode *inode = dentry->d_inode;
 	int error;
 
 	atomic_inc(&ip->i_sbd->sd_ops_file);
@@ -1538,8 +1540,15 @@
 
 	if (gfs_is_jdata(ip))
 		gfs_log_flush_glock(ip->i_gl);
-	else
-		i_gh.gh_flags |= GL_SYNC;
+	else {
+		if ((!datasync) || (inode->i_state & I_DIRTY_DATASYNC)) {
+			struct writeback_control wbc = {
+				.sync_mode = WB_SYNC_ALL,
+				.nr_to_write = 0,
+			};
+			error = sync_inode(inode, &wbc);
+		}
+	}
 
 	gfs_glock_dq_uninit(&i_gh);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]