From owner-p4-projects@FreeBSD.ORG Wed Sep 14 06:56:01 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 925C316A421; Wed, 14 Sep 2005 06:56:00 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6E09716A41F for ; Wed, 14 Sep 2005 06:56:00 +0000 (GMT) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 227C543D45 for ; Wed, 14 Sep 2005 06:56:00 +0000 (GMT) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j8E6u0Uu031090 for ; Wed, 14 Sep 2005 06:56:00 GMT (envelope-from scottl@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j8E6txLH031087 for perforce@freebsd.org; Wed, 14 Sep 2005 06:55:59 GMT (envelope-from scottl@freebsd.org) Date: Wed, 14 Sep 2005 06:55:59 GMT Message-Id: <200509140655.j8E6txLH031087@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to scottl@freebsd.org using -f From: Scott Long To: Perforce Change Reviews Cc: Subject: PERFORCE change 83584 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2005 06:56:01 -0000 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 {