[Ocfs2-commits] rev 35 - trunk/src

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Tue Feb 24 20:01:31 CST 2004


Author: manish
Date: 2004-02-24 20:01:29 -0600 (Tue, 24 Feb 2004)
New Revision: 35

Modified:
   trunk/src/file.c
Log:
* Make fsync actually sync up metadata by calling journal_force_commit. This now means our fsync actually works like a real file systems! :)


Modified: trunk/src/file.c
===================================================================
--- trunk/src/file.c	2004-02-24 03:10:35 UTC (rev 34)
+++ trunk/src/file.c	2004-02-25 02:01:29 UTC (rev 35)
@@ -455,12 +455,23 @@
 int ocfs_sync_file (struct file *file, struct dentry *dentry, int datasync)
 {
 	int err = 0;
+	journal_t *journal;
+	struct inode *inode = dentry->d_inode;
+	ocfs_super *osb = (ocfs_super *) OCFS_GENERIC_SB_P(inode->i_sb);
+
 	LOG_ENTRY_ARGS ("(0x%08x, 0x%08x, %d, '%*s')\n", file, dentry, datasync,
                         dentry->d_name.len, dentry->d_name.name);
 #if LINUX_VERSION_CODE >= LinuxVersionCode(2,4,18)
 	fsync_inode_data_buffers(file->f_dentry->d_inode);
 #endif
 	err = fsync_inode_buffers(dentry->d_inode);
+	if (err)
+		goto bail;
+
+	journal = osb->journal.k_journal;
+	err = journal_force_commit(journal);
+
+bail:
 	LOG_EXIT_STATUS (err);
 	return (err < 0) ? -EIO : 0;
 }				/* ocfs_sync_file */



More information about the Ocfs2-commits mailing list