Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Sep 2005 06:55:59 GMT
From:      Scott Long <scottl@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 83584 for review
Message-ID:  <200509140655.j8E6txLH031087@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=83584

Change 83584 by scottl@scottl-junior on 2005/09/14 06:55:09

	Check the MNT_JOURNAL flag instead of the FS_JOURNAL flag when deciding
	whether to journal blocks.  The former is only a hint that the journal
	_should_ be enabled, while the latter is set when the journal actually
	is enabled.  Add DOINGJOURNAL() macro to make the code prettier.

Affected files ...

.. //depot/projects/soc2005/ufsj/src/sys/ufs/ffs/ffs_inode.c#3 edit
.. //depot/projects/soc2005/ufsj/src/sys/ufs/ufs/inode.h#2 edit

Differences ...

==== //depot/projects/soc2005/ufsj/src/sys/ufs/ffs/ffs_inode.c#3 (text+ko) ====

@@ -112,7 +112,7 @@
 
 	/* We only do writes from this point on */
 #ifdef UFS_JOURNAL
-        if (ip->i_ump->um_fs->fs_flags & FS_JOURNAL)
+	if (DOINGJOURNAL(vp))
 		ufsj_start_transaction(ip->i_ump, &jnl, J_TYPE_WRITE);
 #endif
 
@@ -128,7 +128,7 @@
 		    ino_to_fsbo(fs, ip->i_number)) = *ip->i_din2;
 	if (waitfor && !DOINGASYNC(vp)) {
 #ifdef UFS_JOURNAL
-		if (ip->i_ump->um_fs->fs_flags & FS_JOURNAL){
+		if (DOINGJOURNAL(vp)) {
 			ufsj_write_blocks(jnl, bp);
 			ufsj_end_transaction(jnl);
 			return(0); /* BAW: Correct return value? */
@@ -137,7 +137,7 @@
 			return (bwrite(bp));
 	} else if (vm_page_count_severe() || buf_dirty_count_severe()) {
 #ifdef UFS_JOURNAL
-		if (ip->i_ump->um_fs->fs_flags & FS_JOURNAL){
+		if (DOINGJOURNAL(vp)) {
 			ufsj_write_blocks(jnl, bp);
 			ufsj_end_transaction(jnl);
 			return(0); /* BAW: Correct return value? */
@@ -148,7 +148,7 @@
 		if (bp->b_bufsize == fs->fs_bsize)
 			bp->b_flags |= B_CLUSTEROK;
 #ifdef UFS_JOURNAL
-		if (ip->i_ump->um_fs->fs_flags & FS_JOURNAL){
+		if (DOINGJOURNAL(vp)) {
 			ufsj_write_blocks(jnl, bp);
 			ufsj_end_transaction(jnl);
 		} else

==== //depot/projects/soc2005/ufsj/src/sys/ufs/ufs/inode.h#2 (text+ko) ====

@@ -167,6 +167,7 @@
 /* Determine if soft dependencies are being done */
 #define DOINGSOFTDEP(vp)	((vp)->v_mount->mnt_flag & MNT_SOFTDEP)
 #define DOINGASYNC(vp)		((vp)->v_mount->mnt_flag & MNT_ASYNC)
+#define DOINGJOURNAL(vp)	((vp)->v_mount->mnt_flag & MNT_JOURNAL)
 
 /* This overlays the fid structure (see mount.h). */
 struct ufid {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200509140655.j8E6txLH031087>