cluster: STABLE3 - gfs2: remove update_flags everywhere

Bob Peterson rpeterso at fedoraproject.org
Tue Jan 26 21:19:04 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=1b47697dc8905507cd7ad50fd249ca6c86942b82
Commit:        1b47697dc8905507cd7ad50fd249ca6c86942b82
Parent:        7ea0206f2410a56993f6019b9065db95d15a9396
Author:        Bob Peterson <bob at ganesha.peterson>
AuthorDate:    Mon Nov 30 15:16:07 2009 -0600
Committer:     Bob Peterson <rpeterso at redhat.com>
CommitterDate: Tue Jan 26 14:39:27 2010 -0600

gfs2: remove update_flags everywhere

This patch removes the update_flags from all the gfs2-utils code.
This help to untangle the buffer_head mess and helps solve
issues where file systems were being updated even when no errors
are found.

rhbz#455300
---
 gfs2/convert/gfs2_convert.c |   47 ++++++++------
 gfs2/edit/gfs2hex.c         |    2 +-
 gfs2/edit/hexedit.c         |   47 +++++++------
 gfs2/edit/savemeta.c        |   18 +++---
 gfs2/fsck/eattr.c           |   10 +--
 gfs2/fsck/eattr.h           |    9 +--
 gfs2/fsck/fs_recovery.c     |   56 +++++++++-------
 gfs2/fsck/fsck.h            |    2 +-
 gfs2/fsck/main.c            |   22 +++----
 gfs2/fsck/metawalk.c        |  152 ++++++++++++++++---------------------------
 gfs2/fsck/metawalk.h        |   19 ++----
 gfs2/fsck/pass1.c           |  129 +++++++++++++++++--------------------
 gfs2/fsck/pass1b.c          |   37 ++++-------
 gfs2/fsck/pass1c.c          |   34 ++++------
 gfs2/fsck/pass2.c           |   95 ++++++++++++---------------
 gfs2/fsck/pass3.c           |   23 ++++---
 gfs2/fsck/pass4.c           |   25 ++++----
 gfs2/fsck/pass5.c           |   16 ++---
 gfs2/fsck/rgrepair.c        |   16 ++--
 gfs2/libgfs2/buf.c          |    9 ++-
 gfs2/libgfs2/fs_bits.c      |    8 +-
 gfs2/libgfs2/fs_geometry.c  |    3 +-
 gfs2/libgfs2/fs_ops.c       |  117 ++++++++++++++++++++-------------
 gfs2/libgfs2/gfs1.c         |   11 +--
 gfs2/libgfs2/libgfs2.h      |   26 ++------
 gfs2/libgfs2/recovery.c     |   10 ++--
 gfs2/libgfs2/rgrp.c         |    7 +-
 gfs2/libgfs2/structures.c   |   47 +++++++++-----
 gfs2/libgfs2/super.c        |   10 +--
 gfs2/mkfs/main_grow.c       |    4 +-
 gfs2/mkfs/main_mkfs.c       |   12 ++-
 31 files changed, 488 insertions(+), 535 deletions(-)

diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index 020b4e5..49e6058 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -335,7 +335,7 @@ static void fix_metatree(struct gfs2_sbd *sbp, struct gfs2_inode *ip,
 		/* First, build up the metatree */
 		for (h = 0; h < blk->height; h++) {
 			lookup_block(ip, bh, h, &blk->mp, 1, &new, &block);
-			brelse(bh, updated);
+			brelse(bh);
 			if (!block)
 				break;
 
@@ -353,7 +353,8 @@ static void fix_metatree(struct gfs2_sbd *sbp, struct gfs2_inode *ip,
 		memcpy(bh->b_data + hdrsize + ptramt,
 		       (char *)srcptr, amount);
 		srcptr += amount;
-		brelse(bh, updated);
+		bmodified(bh);
+		brelse(bh);
 
 		copied += amount;
 
@@ -516,7 +517,8 @@ static int adjust_indirect_blocks(struct gfs2_sbd *sbp, struct gfs2_buffer_head
 			/* Zero the buffer so we can fill it in later */
 			memset(bh->b_data + sizeof(struct gfs_indirect), 0,
 			       bufsize);
-			brelse(bh, updated);
+			bmodified(bh);
+			brelse(bh);
 			/* Free the metadata block so we can reuse it.
 			   This allows us to convert a "full" file system. */
 			ip->i_di.di_blocks--;
@@ -778,12 +780,13 @@ static int inode_renumber(struct gfs2_sbd *sbp, uint64_t root_inode_addr)
 						break;
 					}
 					bitmap_byte -= (sbp->bsize - buf_offset);
+					bmodified(bh);
 				}
 			}
-			brelse(bh, updated);
+			brelse(bh);
 			first = 0;
 		} /* while 1 */
-		gfs2_rgrp_relse(rgd, updated, rgbh);
+		gfs2_rgrp_relse(rgd, rgbh);
 		free(rgbh);
 	} /* for all rgs */
 	log_notice("\r%" PRIu64" inodes from %d rgs converted.",
@@ -805,7 +808,8 @@ static int fetch_inum(struct gfs2_sbd *sbp, uint64_t iblock,
 	fix_inode = inode_get(sbp, bh_fix);
 	inum->no_formal_ino = fix_inode->i_di.di_num.no_formal_ino;
 	inum->no_addr = fix_inode->i_di.di_num.no_addr;
-	brelse(bh_fix, updated);
+	bmodified(bh_fix);
+	brelse(bh_fix);
 	return 0;
 }/* fetch_inum */
 
@@ -944,7 +948,8 @@ static int fix_one_directory_exhash(struct gfs2_sbd *sbp, struct gfs2_inode *dip
 		}
 		gfs2_leaf_in(&leaf, (char *)bh_leaf->b_data); /* buffer to structure */
 		error = process_dirent_info(dip, sbp, bh_leaf, leaf.lf_entries);
-		brelse(bh_leaf, updated);
+		bmodified(bh_leaf);
+		brelse(bh_leaf);
 	} /* for leaf_num */
 	return 0;
 }/* fix_one_directory_exhash */
@@ -987,18 +992,21 @@ static int fix_directory_info(struct gfs2_sbd *sbp, osi_list_t *dir_to_fix)
 		if (dip->i_di.di_flags & GFS2_DIF_EXHASH) {
 			if (fix_one_directory_exhash(sbp, dip)) {
 				log_crit("Error fixing exhash directory.\n");
-				brelse(bh_dir, updated);
+				bmodified(bh_dir);
+				brelse(bh_dir);
 				return -1;
 			}
 		}
 		else {
 			if (process_dirent_info(dip, sbp, bh_dir, dip->i_di.di_entries)) {
 				log_crit("Error fixing linear directory.\n");
-				brelse(bh_dir, updated);
+				bmodified(bh_dir);
+				brelse(bh_dir);
 				return -1;
 			}
 		}
-		brelse(bh_dir, updated);
+		bmodified(bh_dir);
+		brelse(bh_dir);
 	}
 	/* Free the last entry in memory: */
 	if (tmp) {
@@ -1126,7 +1134,7 @@ static int init(struct gfs2_sbd *sbp)
 	sbp->sd_diptrs = (sbp->bsize - sizeof(struct gfs_dinode)) /
 		sizeof(uint64_t);
 	sbp->sd_jbsize = sbp->bsize - sizeof(struct gfs2_meta_header);
-	brelse(bh, not_updated);
+	brelse(bh);
 	if (compute_heightsize(sbp, sbp->sd_heightsize, &sbp->sd_max_height,
 				sbp->bsize, sbp->sd_diptrs, sbp->sd_inptrs)) {
 		log_crit("Error: Bad constants (1)\n");
@@ -1193,8 +1201,8 @@ static int init(struct gfs2_sbd *sbp)
 	}
 	printf("\n");
 	fflush(stdout);
-	inode_put(sbp->md.riinode, updated);
-	inode_put(sbp->md.jiinode, updated);
+	inode_put(sbp->md.riinode);
+	inode_put(sbp->md.jiinode);
 	log_debug("%d rgs found.\n", rgcount);
 	return 0;
 }/* fill_super_block */
@@ -1508,7 +1516,7 @@ static void conv_build_jindex(struct gfs2_sbd *sdp)
 		ip = createi(jindex, name, S_IFREG | 0600, GFS2_DIF_SYSTEM);
 		write_journal(sdp, ip, j,
 			      sdp->jsize << 20 >> sdp->sd_sb.sb_bsize_shift);
-		inode_put(ip, updated);
+		inode_put(ip);
 		printf("done.\n");
 		fflush(stdout);
 	}
@@ -1518,7 +1526,7 @@ static void conv_build_jindex(struct gfs2_sbd *sdp)
 		gfs2_dinode_print(&jindex->i_di);
 	}
 
-	inode_put(jindex, updated);
+	inode_put(jindex);
 }
 
 /* ------------------------------------------------------------------------- */
@@ -1623,9 +1631,9 @@ int main(int argc, char **argv)
 		update_inode_file(&sb2);
 		write_statfs_file(&sb2);
 
-		inode_put(sb2.master_dir, updated);
-		inode_put(sb2.md.inum, updated);
-		inode_put(sb2.md.statfs, updated);
+		inode_put(sb2.master_dir);
+		inode_put(sb2.md.inum);
+		inode_put(sb2.md.statfs);
 
 		bcommit(&sb2.buf_list); /* write the buffers to disk */
 
@@ -1643,7 +1651,8 @@ int main(int argc, char **argv)
 		sb2.sd_sb.sb_fs_format = GFS2_FORMAT_FS;
 		sb2.sd_sb.sb_multihost_format = GFS2_FORMAT_MULTI;
 		gfs2_sb_out(&sb2.sd_sb, bh->b_data);
-		brelse(bh, updated);
+		bmodified(bh);
+		brelse(bh);
 
 		bsync(&sb2.buf_list); /* write the buffers to disk */
 		error = fsync(sb2.device_fd);
diff --git a/gfs2/edit/gfs2hex.c b/gfs2/edit/gfs2hex.c
index a4ec02c..1d34730 100644
--- a/gfs2/edit/gfs2hex.c
+++ b/gfs2/edit/gfs2hex.c
@@ -347,7 +347,7 @@ void do_dinode_extended(struct gfs2_dinode *dine, char *dinebuf)
 					if (skip <= 0)
 						break;
 				}
-				brelse(tmp_bh, not_updated);
+				brelse(tmp_bh);
 				indirect->ii[indirect_blocks].block = last;
 				indirect_blocks++;
 				last = p;
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 6a052b2..933871a 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -782,7 +782,7 @@ static void rgcount(void)
 {
 	printf("%lld RGs in this file system.\n",
 	       (unsigned long long)sbd.md.riinode->i_di.di_size / risize());
-	inode_put(sbd.md.riinode, not_updated);
+	inode_put(sbd.md.riinode);
 	gfs2_rgrp_free(&sbd.rglist);
 	exit(EXIT_SUCCESS);
 }
@@ -881,7 +881,7 @@ static uint64_t get_rg_addr(int rgnum)
 	else
 		fprintf(stderr, "Error: File system only has %lld RGs.\n",
 			(unsigned long long)riinode->i_di.di_size / risize());
-	inode_put(riinode, not_updated);
+	inode_put(riinode);
 	return rgblk;
 }
 
@@ -916,7 +916,8 @@ static void set_rgrp_flags(int rgnum, uint32_t new_flags, int modify, int full)
 			gfs_rgrp_out(&rg.rg1, bh->b_data);
 		else
 			gfs2_rgrp_out(&rg.rg2, bh->b_data);
-		brelse(bh, updated);
+		bmodified(bh);
+		brelse(bh);
 	} else {
 		if (full) {
 			print_gfs2("RG #%d", rgnum);
@@ -931,7 +932,7 @@ static void set_rgrp_flags(int rgnum, uint32_t new_flags, int modify, int full)
 			printf("RG #%d (block %llu / 0x%llx) rg_flags = 0x%08x\n",
 			       rgnum, (unsigned long long)rgblk,
 			       (unsigned long long)rgblk, rg.rg2.rg_flags);
-		brelse(bh, not_updated);
+		brelse(bh);
 	}
 	if (modify)
 		bsync(&sbd.buf_list);
@@ -996,7 +997,7 @@ static int parse_rindex(struct gfs2_inode *dip, int print_rindex)
 					gfs2_rgrp_in(&rg, tmp_bh->b_data);
 					gfs2_rgrp_print(&rg);
 				}
-				brelse(tmp_bh, not_updated);
+				brelse(tmp_bh);
 			}
 			last_entry_onscreen[dmode] = print_entry_ndx;
 		}
@@ -1602,7 +1603,7 @@ int block_is_in_per_node(void)
 	gfs2_dinode_in(&per_node_di, per_node_bh->b_data);
 
 	do_dinode_extended(&per_node_di, per_node_bh->b_data);
-	brelse(per_node_bh, not_updated);
+	brelse(per_node_bh);
 
 	for (d = 0; d < indirect->ii[0].dirents; d++) {
 		if (block == indirect->ii[0].dirent[d].block)
@@ -1640,7 +1641,7 @@ static int display_extended(void)
 		tmp_bh = bread(&sbd.buf_list, block);
 		tmp_inode = inode_get(&sbd, tmp_bh);
 		parse_rindex(tmp_inode, TRUE);
-		brelse(tmp_bh, not_updated);
+		brelse(tmp_bh);
 	}
 	else if (has_indirect_blocks() && !indirect_blocks &&
 		 !display_leaf(indirect))
@@ -1655,31 +1656,31 @@ static int display_extended(void)
 			tmp_bh = bread(&sbd.buf_list, masterblock("rindex"));
 		tmp_inode = inode_get(&sbd, tmp_bh);
 		parse_rindex(tmp_inode, FALSE);
-		brelse(tmp_bh, not_updated);
+		brelse(tmp_bh);
 	}
 	else if (block_is_jindex()) {
 		tmp_bh = bread(&sbd.buf_list, block);
 		tmp_inode = inode_get(&sbd, tmp_bh);
 		print_jindex(tmp_inode);
-		brelse(tmp_bh, not_updated);
+		brelse(tmp_bh);
 	}
 	else if (block_is_inum_file()) {
 		tmp_bh = bread(&sbd.buf_list, block);
 		tmp_inode = inode_get(&sbd, tmp_bh);
 		print_inum(tmp_inode);
-		brelse(tmp_bh, not_updated);
+		brelse(tmp_bh);
 	}
 	else if (block_is_statfs_file()) {
 		tmp_bh = bread(&sbd.buf_list, block);
 		tmp_inode = inode_get(&sbd, tmp_bh);
 		print_statfs(tmp_inode);
-		brelse(tmp_bh, not_updated);
+		brelse(tmp_bh);
 	}
 	else if (block_is_quota_file()) {
 		tmp_bh = bread(&sbd.buf_list, block);
 		tmp_inode = inode_get(&sbd, tmp_bh);
 		print_quota(tmp_inode);
-		brelse(tmp_bh, not_updated);
+		brelse(tmp_bh);
 	}
 	return 0;
 }
@@ -1968,7 +1969,7 @@ static uint64_t find_journal_block(const char *journal, uint64_t *j_size)
 
 	if (!gfs1)
 		do_dinode_extended(&di, jindex_bh->b_data); /* parse dir. */
-	brelse(jindex_bh, not_updated);
+	brelse(jindex_bh);
 
 	if (gfs1) {
 		struct gfs2_inode *jiinode;
@@ -1991,7 +1992,7 @@ static uint64_t find_journal_block(const char *journal, uint64_t *j_size)
 		j_inode = inode_get(&sbd, j_bh);
 		gfs2_dinode_in(&jdi, j_bh->b_data);/* parse dinode to struct */
 		*j_size = jdi.di_size;
-		brelse(j_bh, not_updated);
+		brelse(j_bh);
 	}
 	return jblock;
 }
@@ -2017,10 +2018,10 @@ static uint64_t find_metablockoftype_slow(uint64_t startblk, int metatype, int p
 		    bh->b_data[4] == 0x00 && bh->b_data[5] == 0x00 &&
 		    bh->b_data[6] == 0x00 && bh->b_data[7] == metatype) {
 			found = 1;
-			brelse(bh, not_updated);
+			brelse(bh);
 			break;
 		}
-		brelse(bh, not_updated);
+		brelse(bh);
 	}
 	if (!found)
 		blk = 0;
@@ -2437,7 +2438,7 @@ static void find_print_block_type(void)
 	bh = bread(&sbd.buf_list, tblock);
 	type = get_block_type(bh->b_data);
 	print_block_type(tblock, type, "");
-	brelse(bh, NOT_UPDATED);
+	brelse(bh);
 	gfs2_rgrp_free(&sbd.rglist);
 	exit(0);
 }
@@ -2595,7 +2596,9 @@ static void process_field(const char *field, uint64_t *newval, int print_field)
 					 " which is not implemented");
 		break;
 	}
-	brelse(bh, newval ? UPDATED : NOT_UPDATED);
+	if (newval)
+		bmodified(bh);
+	brelse(bh);
 	bcommit(&sbd.buf_list);
 }
 
@@ -2975,7 +2978,7 @@ static int fsck_readi(struct gfs2_inode *ip, void *rbuf, uint64_t roffset,
 			amount = sdp->bsize - o;
 		if (!extlen)
 			block_map(ip, lblock, &not_new, &dblock, &extlen,
-				  FALSE, not_updated);
+				  FALSE);
 		if (dblock) {
 			bh = bread(&sdp->buf_list, dblock);
 			if (*abs_block == 0)
@@ -2986,7 +2989,7 @@ static int fsck_readi(struct gfs2_inode *ip, void *rbuf, uint64_t roffset,
 			bh = NULL;
 		if (bh) {
 			memcpy(rbuf, bh->b_data + o, amount);
-			brelse(bh, not_updated);
+			brelse(bh);
 		} else {
 			memset(rbuf, 0, amount);
 		}
@@ -3042,7 +3045,7 @@ static void dump_journal(const char *journal)
 	for (jb = 0; jb < j_size; jb += (gfs1 ? 1:sbd.bsize)) {
 		if (gfs1) {
 			if (j_bh)
-				brelse(j_bh, not_updated);
+				brelse(j_bh);
 			j_bh = bread(&sbd.buf_list, jblock + jb);
 			abs_block = jblock + jb;
 			memcpy(jbuf, j_bh->b_data, sbd.bsize);
@@ -3133,7 +3136,7 @@ static void dump_journal(const char *journal)
 						     start_line);
 		}
 	}
-	brelse(j_bh, not_updated);
+	brelse(j_bh);
 	blockhist = -1; /* So we don't print anything else */
 }
 
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 1bdadbe..46a6522 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -307,13 +307,13 @@ static void save_indirect_blocks(int out_fd, osi_list_t *cur_list,
 		if (blktype == GFS2_METATYPE_EA) {
 			nbh = bread(&sbd.buf_list, indir_block);
 			save_ea_block(out_fd, nbh);
-			brelse(nbh, not_updated);
+			brelse(nbh);
 		}
 		if (height != hgt) { /* If not at max height */
 			nbh = bread(&sbd.buf_list, indir_block);
 			osi_list_add_prev(&nbh->b_altlist,
 					  cur_list);
-			brelse(nbh, not_updated);
+			brelse(nbh);
 		}
 	} /* for all data on the indirect block */
 }
@@ -416,9 +416,9 @@ static void save_inode_data(int out_fd)
 				(unsigned long long)block,
 				(unsigned long long)block);
 		}
-		brelse(metabh, not_updated);
+		brelse(metabh);
 	}
-	inode_put(inode, not_updated);
+	inode_put(inode);
 }
 
 static void get_journal_inode_blocks(void)
@@ -452,7 +452,7 @@ static void get_journal_inode_blocks(void)
 			amt = gfs2_readi(j_inode, (void *)&jbuf,
 					 journal * sizeof(struct gfs_jindex),
 					 sizeof(struct gfs_jindex));
-			brelse(bh, not_updated);
+			brelse(bh);
 			if (!amt)
 				break;
 			gfs_jindex_in(&ji, jbuf);
@@ -465,7 +465,7 @@ static void get_journal_inode_blocks(void)
 			bh = bread(&sbd.buf_list, jblock);
 			j_inode = inode_get(&sbd, bh);
 			gfs2_dinode_in(&jdi, bh->b_data);
-			inode_put(j_inode, not_updated);
+			inode_put(j_inode);
 		}
 		journal_blocks[journals_found++] = jblock;
 	}
@@ -497,7 +497,7 @@ static int next_rg_freemeta(struct gfs2_sbd *sdp, struct rgrp_list *rgd,
 		blk = gfs2_bitfit((unsigned char *)bh->b_data +
 				  bits->bi_offset, bits->bi_len, blk,
 				  GFS2_BLKST_UNLINKED);
-		brelse(bh, not_updated);
+		brelse(bh);
 		if(blk != BFITNOENT){
 			*nrfblock = blk + (bits->bi_start * GFS2_NBBY) +
 				rgd->ri.ri_data0;
@@ -607,7 +607,7 @@ void savemeta(char *out_fn, int saveoption)
 		gfs2_dinode_in(&di, bh->b_data);
 		if (!gfs1)
 			do_dinode_extended(&di, bh->b_data);
-		brelse(bh, not_updated);
+		brelse(bh);
 	}
 	if (!slow) {
 		printf("Reading resource groups...");
@@ -706,7 +706,7 @@ void savemeta(char *out_fn, int saveoption)
 					first = 0;
 				}
 			}
-			gfs2_rgrp_relse(rgd, not_updated, rgbh);
+			gfs2_rgrp_relse(rgd, rgbh);
 			free(rgbh);
 		}
 	}
diff --git a/gfs2/fsck/eattr.c b/gfs2/fsck/eattr.c
index 6489e6d..6194244 100644
--- a/gfs2/fsck/eattr.c
+++ b/gfs2/fsck/eattr.c
@@ -29,17 +29,15 @@ static int clear_blk_nodup(struct gfs2_sbd *sbp, uint64_t block)
 
 int clear_eattr_indir(struct gfs2_inode *ip, uint64_t block,
 		      uint64_t parent, struct gfs2_buffer_head **bh,
-		      enum update_flags *want_updated, void *private)
+		      void *private)
 {
-	*want_updated = not_updated;
 	return clear_blk_nodup(ip->i_sbd, block);
 }
 
 int clear_eattr_leaf(struct gfs2_inode *ip, uint64_t block,
 		     uint64_t parent, struct gfs2_buffer_head **bh,
-		     enum update_flags *want_updated, void *private)
+		     void *private)
 {
-	*want_updated = not_updated;
 	return clear_blk_nodup(ip->i_sbd, block);
 }
 
@@ -91,12 +89,10 @@ int clear_eattr_entry (struct gfs2_inode *ip,
 int clear_eattr_extentry(struct gfs2_inode *ip, uint64_t *ea_data_ptr,
 			 struct gfs2_buffer_head *leaf_bh,
 			 struct gfs2_ea_header *ea_hdr,
-			 struct gfs2_ea_header *ea_hdr_prev,
-			 enum update_flags *want_updated, void *private)
+			 struct gfs2_ea_header *ea_hdr_prev, void *private)
 {
 	uint64_t block = be64_to_cpu(*ea_data_ptr);
 
-	*want_updated = not_updated;
 	return clear_blk_nodup(ip->i_sbd, block);
 
 }
diff --git a/gfs2/fsck/eattr.h b/gfs2/fsck/eattr.h
index b93b50b..f4264b0 100644
--- a/gfs2/fsck/eattr.h
+++ b/gfs2/fsck/eattr.h
@@ -2,11 +2,9 @@
 #define _EATTR_H
 
 int clear_eattr_indir(struct gfs2_inode *ip, uint64_t block, uint64_t parent,
-		      struct gfs2_buffer_head **bh,
-		      enum update_flags *want_updated, void *private);
+		      struct gfs2_buffer_head **bh, void *private);
 int clear_eattr_leaf(struct gfs2_inode *ip, uint64_t block, uint64_t parent,
-		     struct gfs2_buffer_head **bh,
-		     enum update_flags *want_updated, void *private);
+		     struct gfs2_buffer_head **bh, void *private);
 int clear_eattr_entry (struct gfs2_inode *ip,
 					   struct gfs2_buffer_head *leaf_bh,
 					   struct gfs2_ea_header *ea_hdr,
@@ -15,7 +13,6 @@ int clear_eattr_entry (struct gfs2_inode *ip,
 int clear_eattr_extentry(struct gfs2_inode *ip, uint64_t *ea_data_ptr,
 			 struct gfs2_buffer_head *leaf_bh,
 			 struct gfs2_ea_header *ea_hdr,
-			 struct gfs2_ea_header *ea_hdr_prev,
-			 enum update_flags *want_updated, void *private);
+			 struct gfs2_ea_header *ea_hdr_prev, void *private);
 
 #endif /* _EATTR_H */
diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c
index 763190e..9eff8ec 100644
--- a/gfs2/fsck/fs_recovery.c
+++ b/gfs2/fsck/fs_recovery.c
@@ -98,7 +98,6 @@ static int buf_lo_scan_elements(struct gfs2_inode *ip, unsigned int start,
 	struct gfs2_buffer_head *bh_log, *bh_ip;
 	uint64_t blkno;
 	int error = 0;
-	enum update_flags if_modified;
 
 	if (pass != 1 || be32_to_cpu(ld->ld_type) != GFS2_LOG_DESC_METADATA)
 		return 0;
@@ -125,14 +124,13 @@ static int buf_lo_scan_elements(struct gfs2_inode *ip, unsigned int start,
 		check_magic = ((struct gfs2_meta_header *)
 			       (bh_ip->b_data))->mh_magic;
 		check_magic = be32_to_cpu(check_magic);
-		if (check_magic != GFS2_MAGIC) {
-			if_modified = not_updated;
+		if (check_magic != GFS2_MAGIC)
 			error = -EIO;
-		} else
-			if_modified = updated;
+		else
+			bmodified(bh_ip);
 
-		brelse(bh_log, not_updated);
-		brelse(bh_ip, if_modified);
+		brelse(bh_log);
+		brelse(bh_ip);
 		if (error)
 			break;
 
@@ -181,7 +179,8 @@ static int revoke_lo_scan_elements(struct gfs2_inode *ip, unsigned int start,
 			offset += sizeof(uint64_t);
 		}
 
-		brelse(bh, updated);
+		bmodified(bh);
+		brelse(bh);
 		offset = sizeof(struct gfs2_meta_header);
 		first = 0;
 	}
@@ -227,8 +226,9 @@ static int databuf_lo_scan_elements(struct gfs2_inode *ip, unsigned int start,
 			*eptr = cpu_to_be32(GFS2_MAGIC);
 		}
 
-		brelse(bh_log, not_updated);
-		brelse(bh_ip, updated);
+		brelse(bh_log);
+		bmodified(bh_ip);
+		brelse(bh_ip);
 
 		sd_replayed_jblocks++;
 	}
@@ -269,7 +269,8 @@ static int foreach_descriptor(struct gfs2_inode *ip, unsigned int start,
 			       (bh->b_data))->mh_magic;
 		check_magic = be32_to_cpu(check_magic);
 		if (check_magic != GFS2_MAGIC) {
-			brelse(bh, updated);
+			bmodified(bh);
+			brelse(bh);
 			return -EIO;
 		}
 		ld = (struct gfs2_log_descriptor *)bh->b_data;
@@ -281,38 +282,45 @@ static int foreach_descriptor(struct gfs2_inode *ip, unsigned int start,
 			error = get_log_header(ip, start, &lh);
 			if (!error) {
 				gfs2_replay_incr_blk(ip, &start);
-				brelse(bh, updated);
+				bmodified(bh);
+				brelse(bh);
 				continue;
 			}
 			if (error == 1)
 				error = -EIO;
-			brelse(bh, updated);
+			bmodified(bh);
+			brelse(bh);
 			return error;
 		} else if (gfs2_check_meta(bh, GFS2_METATYPE_LD)) {
-			brelse(bh, updated);
+			bmodified(bh);
+			brelse(bh);
 			return -EIO;
 		}
 		ptr = (__be64 *)(bh->b_data + offset);
 		error = databuf_lo_scan_elements(ip, start, ld, ptr, pass);
 		if (error) {
-			brelse(bh, updated);
+			bmodified(bh);
+			brelse(bh);
 			return error;
 		}
 		error = buf_lo_scan_elements(ip, start, ld, ptr, pass);
 		if (error) {
-			brelse(bh, updated);
+			bmodified(bh);
+			brelse(bh);
 			return error;
 		}
 		error = revoke_lo_scan_elements(ip, start, ld, ptr, pass);
 		if (error) {
-			brelse(bh, updated);
+			bmodified(bh);
+			brelse(bh);
 			return error;
 		}
 
 		while (length--)
 			gfs2_replay_incr_blk(ip, &start);
 
-		brelse(bh, updated);
+		bmodified(bh);
+		brelse(bh);
 	}
 
 	return 0;
@@ -363,10 +371,11 @@ static int fix_journal_seq_no(struct gfs2_inode *ip)
 		lh.lh_sequence = highest_seq;
 		prev_seq = lh.lh_sequence;
 		log_warn( _("Renumbering it as 0x%llx\n"), lh.lh_sequence);
-		block_map(ip, blk, &new, &dblock, &extlen, FALSE, not_updated);
+		block_map(ip, blk, &new, &dblock, &extlen, FALSE);
 		bh = bread(&ip->i_sbd->buf_list, dblock);
 		gfs2_log_header_out(&lh, bh->b_data);
-		brelse(bh, updated);
+		bmodified(bh);
+		brelse(bh);
 	}
 	return 0;
 }
@@ -569,11 +578,10 @@ int replay_journals(struct gfs2_sbd *sdp, int preen, int force_check,
 			}
 			*clean_journals += clean;
 		}
-		inode_put(sdp->md.journal[i],
-			  (opts.no ? not_updated : updated));
+		inode_put(sdp->md.journal[i]);
 	}
-	inode_put(sdp->master_dir, not_updated);
-	inode_put(sdp->md.jiinode, not_updated);
+	inode_put(sdp->master_dir);
+	inode_put(sdp->md.jiinode);
 	/* Sync the buffers to disk so we get a fresh start. */
 	bsync(&sdp->buf_list);
 	return error;
diff --git a/gfs2/fsck/fsck.h b/gfs2/fsck/fsck.h
index dae785c..9c9a3fe 100644
--- a/gfs2/fsck/fsck.h
+++ b/gfs2/fsck/fsck.h
@@ -62,7 +62,7 @@ enum rgindex_trust_level { /* how far can we trust our RG index? */
 struct gfs2_inode *fsck_load_inode(struct gfs2_sbd *sbp, uint64_t block);
 struct gfs2_inode *fsck_inode_get(struct gfs2_sbd *sdp,
 				  struct gfs2_buffer_head *bh);
-void fsck_inode_put(struct gfs2_inode *ip, enum update_flags update);
+void fsck_inode_put(struct gfs2_inode *ip);
 
 int initialize(struct gfs2_sbd *sbp, int force_check, int preen,
 	       int *all_clean);
diff --git a/gfs2/fsck/main.c b/gfs2/fsck/main.c
index aa14f98..1ef2cba 100644
--- a/gfs2/fsck/main.c
+++ b/gfs2/fsck/main.c
@@ -328,7 +328,6 @@ int main(int argc, char **argv)
 	struct gfs2_sbd sb;
 	struct gfs2_sbd *sbp = &sb;
 	int j;
-	enum update_flags update_sys_files;
 	int error = 0;
 	int all_clean = 0;
 
@@ -447,23 +446,22 @@ int main(int argc, char **argv)
 	} else {
 		error = FSCK_CANCELED;
 	}
-	update_sys_files = (opts.no ? not_updated : updated);
 
 	check_statfs(sbp);
 
 	/* Free up our system inodes */
-	inode_put(sbp->md.inum, update_sys_files);
-	inode_put(sbp->md.statfs, update_sys_files);
+	inode_put(sbp->md.inum);
+	inode_put(sbp->md.statfs);
 	for (j = 0; j < sbp->md.journals; j++)
-		inode_put(sbp->md.journal[j], update_sys_files);
-	inode_put(sbp->md.jiinode, update_sys_files);
-	inode_put(sbp->md.riinode, update_sys_files);
-	inode_put(sbp->md.qinode, update_sys_files);
-	inode_put(sbp->md.pinode, update_sys_files);
-	inode_put(sbp->md.rooti, update_sys_files);
-	inode_put(sbp->master_dir, update_sys_files);
+		inode_put(sbp->md.journal[j]);
+	inode_put(sbp->md.jiinode);
+	inode_put(sbp->md.riinode);
+	inode_put(sbp->md.qinode);
+	inode_put(sbp->md.pinode);
+	inode_put(sbp->md.rooti);
+	inode_put(sbp->master_dir);
 	if (lf_dip)
-		inode_put(lf_dip, update_sys_files);
+		inode_put(lf_dip);
 
 	if (!opts.no && errors_corrected)
 		log_notice( _("Writing changes to disk\n"));
diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index 8db0274..42235be 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -83,17 +83,17 @@ struct gfs2_inode *fsck_inode_get(struct gfs2_sbd *sdp,
 
 /* fsck_inode_put - same as inode_put() in libgfs2 but system inodes
    get special treatment. */
-void fsck_inode_put(struct gfs2_inode *ip, enum update_flags update)
+void fsck_inode_put(struct gfs2_inode *ip)
 {
 	struct gfs2_inode *sysip;
 
 	sysip = get_system_inode(ip->i_sbd, ip->i_di.di_num.no_addr);
 	if (sysip) {
-		if (update)
+		if (ip->i_bh->b_changed)
 			gfs2_dinode_out(&ip->i_di, ip->i_bh->b_data);
-		brelse(ip->i_bh, update);
+		brelse(ip->i_bh);
 	} else {
-		inode_put(ip, update);
+		inode_put(ip);
 	}
 }
 
@@ -163,6 +163,7 @@ static void dirblk_truncate(struct gfs2_inode *ip, struct gfs2_dirent *fixb,
 	old_rec_len = de.de_rec_len;
 	de.de_rec_len = bh_end - (char *)fixb;
 	gfs2_dirent_out(&de, (char *)fixb);
+	bmodified(bh);
 }
 
 /*
@@ -171,7 +172,6 @@ static void dirblk_truncate(struct gfs2_inode *ip, struct gfs2_dirent *fixb,
  * @ip - dinode associated with this leaf block
  * bh - buffer for the leaf block
  * type - type of block this is (linear or exhash)
- * @update - set to 1 if the block was updated
  * @count - set to the count entries
  * @pass - structure pointing to pass-specific functions
  *
@@ -179,8 +179,7 @@ static void dirblk_truncate(struct gfs2_inode *ip, struct gfs2_dirent *fixb,
  *         -1 - error occurred
  */
 static int check_entries(struct gfs2_inode *ip, struct gfs2_buffer_head *bh,
-		  int type, enum update_flags *update,
-		  uint16_t *count, struct metawalk_fxns *pass)
+		  int type, uint16_t *count, struct metawalk_fxns *pass)
 {
 	struct gfs2_leaf *leaf = NULL;
 	struct gfs2_dirent *dent;
@@ -236,7 +235,6 @@ static int check_entries(struct gfs2_inode *ip, struct gfs2_buffer_head *bh,
 						dirblk_truncate(ip, dent, bh);
 					else
 						dirblk_truncate(ip, prev, bh);
-					*update = updated;
 					log_err( _("Unable to repair corrupt "
 						   "directory entry; the "
 						   "entry was removed "
@@ -246,7 +244,7 @@ static int check_entries(struct gfs2_inode *ip, struct gfs2_buffer_head *bh,
 					log_err( _("Corrupt directory entry "
 						   "repaired.\n"));
 					errors_corrected++;
-					*update = updated;
+					bmodified(bh);
 					/* keep looping through dentries */
 				}
 			} else {
@@ -272,7 +270,6 @@ static int check_entries(struct gfs2_inode *ip, struct gfs2_buffer_head *bh,
 				if (query(&opts,
 					  _("Attempt to remove it? (y/n) "))) {
 					dirblk_truncate(ip, prev, bh);
-					*update = 1;
 					log_err(_("The corrupt directory "
 						  "entry was removed.\n"));
 				} else {
@@ -290,14 +287,13 @@ static int check_entries(struct gfs2_inode *ip, struct gfs2_buffer_head *bh,
 				de.de_inum.no_addr = de.de_inum.no_formal_ino;
 				de.de_inum.no_formal_ino = 0;
 				gfs2_dirent_out(&de, (char *)dent);
-				*update = (opts.no ? not_updated : updated);
+				bmodified(bh);
 				/* Mark dirent buffer as modified */
 				first = 0;
 			}
 			else {
 				error = pass->check_dentry(ip, dent, prev, bh,
-							   filename, update,
-							   count,
+							   filename, count,
 							   pass->private);
 				if(error < 0) {
 					stack;
@@ -357,8 +353,7 @@ static void warn_and_patch(struct gfs2_inode *ip, uint64_t *leaf_no,
 }
 
 /* Checks exhash directory entries */
-static int check_leaf_blks(struct gfs2_inode *ip, enum update_flags *update,
-			   struct metawalk_fxns *pass)
+static int check_leaf_blks(struct gfs2_inode *ip, struct metawalk_fxns *pass)
 {
 	int error;
 	struct gfs2_leaf leaf, oldleaf;
@@ -382,10 +377,10 @@ static int check_leaf_blks(struct gfs2_inode *ip, enum update_flags *update,
 			lbh = bread(&sbp->buf_list, first_ok_leaf);
 			/* Make sure it's really a valid leaf block. */
 			if (gfs2_check_meta(lbh, GFS2_METATYPE_LF) == 0) {
-				brelse(lbh, not_updated);
+				brelse(lbh);
 				break;
 			}
-			brelse(lbh, not_updated);
+			brelse(lbh);
 		}
 	}
 	old_leaf = -1;
@@ -433,7 +428,8 @@ static int check_leaf_blks(struct gfs2_inode *ip, enum update_flags *update,
 				gfs2_leaf_in(&oldleaf, lbh->b_data);
 				oldleaf.lf_depth = ip->i_di.di_depth - factor;
 				gfs2_leaf_out(&oldleaf, lbh->b_data);
-				brelse(lbh, updated);
+				bmodified(lbh);
+				brelse(lbh);
 			}
 			else
 				return 1;
@@ -461,7 +457,6 @@ static int check_leaf_blks(struct gfs2_inode *ip, enum update_flags *update,
 				break;
 			}
 
-			*update = not_updated;
 			/* Try to read in the leaf block. */
 			lbh = bread(&sbp->buf_list, leaf_no);
 			/* Make sure it's really a valid leaf block. */
@@ -470,7 +465,8 @@ static int check_leaf_blks(struct gfs2_inode *ip, enum update_flags *update,
 					       old_leaf, first_ok_leaf, lindex,
 					       _("that is not really a leaf"));
 				memcpy(&leaf, &oldleaf, sizeof(oldleaf));
-				brelse(lbh, not_updated);
+				bmodified(lbh);
+				brelse(lbh);
 				break;
 			}
 			gfs2_leaf_in(&leaf, lbh->b_data);
@@ -491,7 +487,7 @@ static int check_leaf_blks(struct gfs2_inode *ip, enum update_flags *update,
 				leaf.lf_dirent_format = GFS2_FORMAT_DE;
 				gfs2_leaf_out(&leaf, lbh->b_data);
 				log_debug( _("Fixing lf_dirent_format.\n"));
-				*update = (opts.no ? not_updated : updated);
+				bmodified(lbh);
 			}
 
 			/* Make sure it's really a leaf. */
@@ -505,7 +501,7 @@ static int check_leaf_blks(struct gfs2_inode *ip, enum update_flags *update,
 					ip->i_di.di_num.no_addr,
 					(unsigned long long)leaf_no,
 					(unsigned long long)leaf_no);
-				brelse(lbh, *update);
+				brelse(lbh);
 				break;
 			}
 			exp_count = (1 << (ip->i_di.di_depth - leaf.lf_depth));
@@ -515,22 +511,20 @@ static int check_leaf_blks(struct gfs2_inode *ip, enum update_flags *update,
 			if(pass->check_dentry &&
 			   S_ISDIR(ip->i_di.di_mode)) {
 				error = check_entries(ip, lbh, DIR_EXHASH,
-						      update, &count, pass);
+						      &count, pass);
 
 				/* Since the buffer possibly got
 				 * updated directly, release it now,
 				 * and grab it again later if we need it. */
 
-				brelse(lbh, *update);
+				brelse(lbh);
 
 				if(error < 0) {
 					stack;
 					return -1;
 				}
 
-				if(update && (count != leaf.lf_entries)) {
-					enum update_flags f = not_updated;
-
+				if(count != leaf.lf_entries) {
 					lbh = bread(&sbp->buf_list, leaf_no);
 					gfs2_leaf_in(&leaf, lbh->b_data);
 
@@ -552,16 +546,16 @@ static int check_leaf_blks(struct gfs2_inode *ip, enum update_flags *update,
 						leaf.lf_entries = count;
 						gfs2_leaf_out(&leaf, lbh->b_data);
 						log_warn( _("Leaf entry count updated\n"));
-						f = updated;
+						bmodified(lbh);
 					} else
 						log_err( _("Leaf entry count left in inconsistant state\n"));
-					brelse(lbh, f);
+					brelse(lbh);
 				}
 				/* FIXME: Need to get entry count and
 				 * compare it against leaf->lf_entries */
 				break; /* not a chain; go back to outer loop */
 			} else {
-				brelse(lbh, *update);
+				brelse(lbh);
 				if(!leaf.lf_next)
 					break;
 				leaf_no = leaf.lf_next;
@@ -576,8 +570,7 @@ static int check_leaf_blks(struct gfs2_inode *ip, enum update_flags *update,
 
 static int check_eattr_entries(struct gfs2_inode *ip,
 			       struct gfs2_buffer_head *bh,
-			       struct metawalk_fxns *pass,
-			       enum update_flags *update_it)
+			       struct metawalk_fxns *pass)
 {
 	struct gfs2_ea_header *ea_hdr, *ea_hdr_prev = NULL;
 	uint64_t *ea_data_ptr = NULL;
@@ -585,7 +578,6 @@ static int check_eattr_entries(struct gfs2_inode *ip,
 	int error = 0;
 	uint32_t offset = (uint32_t)sizeof(struct gfs2_meta_header);
 
-	*update_it = 0;
 	if(!pass->check_eattr_entry) {
 		return 0;
 	}
@@ -604,8 +596,6 @@ static int check_eattr_entries(struct gfs2_inode *ip,
 			stack;
 			return -1;
 		}
-		if (error > 0)
-			*update_it = updated;
 		if(error == 0 && pass->check_eattr_extentry &&
 		   ea_hdr->ea_num_ptrs) {
 			uint32_t tot_ealen = 0;
@@ -627,7 +617,6 @@ static int check_eattr_entries(struct gfs2_inode *ip,
 							      ea_data_ptr,
 							      bh, ea_hdr,
 							      ea_hdr_prev,
-							      update_it,
 							      pass->private)) {
 					errors_found++;
 					if (query(&opts, _("Repair the bad "
@@ -638,7 +627,7 @@ static int check_eattr_entries(struct gfs2_inode *ip,
 						ea_hdr->ea_data_len =
 							cpu_to_be32(tot_ealen);
 						*ea_data_ptr = 0;
-						*update_it = 1;
+						bmodified(bh);
 						/* Endianness doesn't matter
 						   in this case because it's
 						   a single byte. */
@@ -680,38 +669,29 @@ static int check_eattr_entries(struct gfs2_inode *ip,
  * Returns: 0 on success, 1 if removal is needed, -1 on error
  */
 static int check_leaf_eattr(struct gfs2_inode *ip, uint64_t block,
-			    uint64_t parent, enum update_flags *want_updated,
-			    struct metawalk_fxns *pass)
+			    uint64_t parent, struct metawalk_fxns *pass)
 {
 	struct gfs2_buffer_head *bh = NULL;
 	int error = 0;
-	enum update_flags updated_this_leaf = not_updated;
 
 	log_debug( _("Checking EA leaf block #%"PRIu64" (0x%" PRIx64 ").\n"),
 			  block, block);
 
 	if(pass->check_eattr_leaf) {
 		error = pass->check_eattr_leaf(ip, block, parent, &bh,
-					       &updated_this_leaf,
 					       pass->private);
-		if (updated_this_leaf) /* if this leaf was updated */
-			*want_updated = updated; /* signal it for the parent */
 		if(error < 0) {
 			stack;
 			return -1;
 		}
 		if(error > 0) {
 			if (bh)
-				brelse(bh, updated_this_leaf);
+				brelse(bh);
 			return 1;
 		}
 		if (bh) {
-			error = check_eattr_entries(ip, bh, pass,
-						    &updated_this_leaf);
-			brelse(bh, updated_this_leaf);
-			if (updated_this_leaf) /* if this leaf was updated */
-				*want_updated = updated; /* signal it for
-							    the parent */
+			error = check_eattr_entries(ip, bh, pass);
+			brelse(bh);
 		}
 		return error;
 	}
@@ -727,7 +707,6 @@ static int check_leaf_eattr(struct gfs2_inode *ip, uint64_t block,
  * Returns: 0 on success -1 on error
  */
 static int check_indirect_eattr(struct gfs2_inode *ip, uint64_t indirect,
-				enum update_flags *want_updated,
 				struct metawalk_fxns *pass)
 {
 	int error = 0;
@@ -735,19 +714,16 @@ static int check_indirect_eattr(struct gfs2_inode *ip, uint64_t indirect,
 	uint64_t block;
 	struct gfs2_buffer_head *indirect_buf = NULL;
 	struct gfs2_sbd *sdp = ip->i_sbd;
-	enum update_flags update_indir_block = not_updated;
 	int first_ea_is_bad = 0;
 	uint64_t di_eattr_save = ip->i_di.di_eattr;
 
-	*want_updated = not_updated;
 	log_debug( _("Checking EA indirect block #%"PRIu64" (0x%" PRIx64 ").\n"),
 			  indirect, indirect);
 
 	if (!pass->check_eattr_indir)
 		return 0;
 	error = pass->check_eattr_indir(ip, indirect, ip->i_di.di_num.no_addr,
-					&indirect_buf, want_updated,
-					pass->private);
+					&indirect_buf, pass->private);
 	if (!error) {
 		int leaf_pointers = 0, leaf_pointer_errors = 0;
 
@@ -759,20 +735,16 @@ static int check_indirect_eattr(struct gfs2_inode *ip, uint64_t indirect,
 		while(*ea_leaf_ptr && (ea_leaf_ptr < end)){
 			block = be64_to_cpu(*ea_leaf_ptr);
 			leaf_pointers++;
-			error = check_leaf_eattr(ip, block, indirect,
-						 want_updated, pass);
+			error = check_leaf_eattr(ip, block, indirect, pass);
 			if (error) {
 				leaf_pointer_errors++;
-				if (update_indir_block == not_updated) {
-					errors_found++;
-					if (query(&opts, _("Fix the indirect "
-						"block too? (y/n) "))) {
-						update_indir_block = updated;
-						errors_corrected++;
-						*ea_leaf_ptr = 0;
-					}
-				} else
+				errors_found++;
+				if (query(&opts, _("Fix the indirect "
+						   "block too? (y/n) "))) {
+					bmodified(indirect_buf);
+					errors_corrected++;
 					*ea_leaf_ptr = 0;
+				}
 			}
 			/* If the first eattr lead is bad, we can't have
 			   a hole, so we have to treat this as an unrecoverable
@@ -788,7 +760,6 @@ static int check_indirect_eattr(struct gfs2_inode *ip, uint64_t indirect,
 					pass->finish_eattr_indir(ip,
 							leaf_pointers,
 							leaf_pointer_errors,
-							want_updated,
 							pass->private);
 			} else if (leaf_pointer_errors) {
 				/* This is a bit tricky.  We can't have eattr
@@ -811,11 +782,10 @@ static int check_indirect_eattr(struct gfs2_inode *ip, uint64_t indirect,
 					ip->i_di.di_eattr = di_eattr_save;
 				pass->finish_eattr_indir(ip, leaf_pointers,
 							 leaf_pointer_errors,
-							 want_updated,
 							 pass->private);
 			}
 			if (leaf_pointer_errors == leaf_pointers) {
-				if (*want_updated)
+				if (indirect_buf->b_changed)
 					gfs2_set_bitmap(sdp, indirect,
 							GFS2_BLKST_FREE);
 				gfs2_block_set(sdp, bl, indirect,
@@ -825,7 +795,7 @@ static int check_indirect_eattr(struct gfs2_inode *ip, uint64_t indirect,
 		}
 	}
 	if (indirect_buf)
-		brelse(indirect_buf, update_indir_block);
+		brelse(indirect_buf);
 
 	return error;
 }
@@ -836,8 +806,7 @@ static int check_indirect_eattr(struct gfs2_inode *ip, uint64_t indirect,
  *
  * Returns: 0 on success, -1 on error
  */
-int check_inode_eattr(struct gfs2_inode *ip, enum update_flags *want_updated,
-		      struct metawalk_fxns *pass)
+int check_inode_eattr(struct gfs2_inode *ip, struct metawalk_fxns *pass)
 {
 	int error = 0;
 
@@ -850,12 +819,11 @@ int check_inode_eattr(struct gfs2_inode *ip, enum update_flags *want_updated,
 
 	if(ip->i_di.di_flags & GFS2_DIF_EA_INDIRECT){
 		if((error = check_indirect_eattr(ip, ip->i_di.di_eattr,
-						 want_updated, pass)))
+						 pass)))
 			stack;
 	} else {
 		error = check_leaf_eattr(ip, ip->i_di.di_eattr,
-					 ip->i_di.di_num.no_addr,
-					 want_updated, pass);
+					 ip->i_di.di_num.no_addr, pass);
 		if (error)
 			stack;
 	}
@@ -946,12 +914,12 @@ fail:
 		while (!osi_list_empty(list)) {
 			nbh = osi_list_entry(list->next,
 					     struct gfs2_buffer_head, b_altlist);
-			brelse(nbh, not_updated);
+			brelse(nbh);
 			osi_list_del(&nbh->b_altlist);
 		}
 	}
 	/* This is an error path, so we need to release the buffer here: */
-	brelse(metabh, not_updated);
+	brelse(metabh);
 	return -1;
 }
 
@@ -969,7 +937,6 @@ int check_metatree(struct gfs2_inode *ip, struct metawalk_fxns *pass)
 	uint64_t block, *ptr;
 	uint32_t height = ip->i_di.di_height;
 	int  i, head_size;
-	enum update_flags update = not_updated;
 	int error = 0;
 
 	if (!height)
@@ -1032,7 +999,7 @@ int check_metatree(struct gfs2_inode *ip, struct metawalk_fxns *pass)
 		{
 			bh = osi_list_entry(list->next,
 					    struct gfs2_buffer_head, b_altlist);
-			brelse(bh, not_updated);
+			brelse(bh);
 			osi_list_del(&bh->b_altlist);
 		}
 	}
@@ -1041,7 +1008,7 @@ end:
         if (S_ISDIR(ip->i_di.di_mode)) {
 		/* check validity of leaf blocks and leaf chains */
 		if (ip->i_di.di_flags & GFS2_DIF_EXHASH) {
-			error = check_leaf_blks(ip, &update, pass);
+			error = check_leaf_blks(ip, pass);
 			if(error < 0)
 				return -1;
 			if(error > 0)
@@ -1054,12 +1021,12 @@ end:
 
 /* Checks stuffed inode directories */
 static int check_linear_dir(struct gfs2_inode *ip, struct gfs2_buffer_head *bh,
-		     enum update_flags *update, struct metawalk_fxns *pass)
+			    struct metawalk_fxns *pass)
 {
 	int error = 0;
 	uint16_t count = 0;
 
-	error = check_entries(ip, bh, DIR_LINEAR, update, &count, pass);
+	error = check_entries(ip, bh, DIR_LINEAR, &count, pass);
 	if(error < 0) {
 		stack;
 		return -1;
@@ -1073,38 +1040,36 @@ int check_dir(struct gfs2_sbd *sbp, uint64_t block, struct metawalk_fxns *pass)
 {
 	struct gfs2_buffer_head *bh;
 	struct gfs2_inode *ip;
-	enum update_flags update = not_updated;
 	int error = 0;
 
 	bh = bread(&sbp->buf_list, block);
 	ip = fsck_inode_get(sbp, bh);
 
 	if(ip->i_di.di_flags & GFS2_DIF_EXHASH) {
-		error = check_leaf_blks(ip, &update, pass);
+		error = check_leaf_blks(ip, pass);
 		if(error < 0) {
 			stack;
-			fsck_inode_put(ip, not_updated); /* does brelse(bh); */
+			fsck_inode_put(ip); /* does brelse(bh); */
 			return -1;
 		}
 	}
 	else {
-		error = check_linear_dir(ip, bh, &update, pass);
+		error = check_linear_dir(ip, bh, pass);
 		if(error < 0) {
 			stack;
-			fsck_inode_put(ip, not_updated); /* does brelse(bh); */
+			fsck_inode_put(ip); /* does brelse(bh); */
 			return -1;
 		}
 	}
 
-	fsck_inode_put(ip, opts.no ? not_updated : update); /* does a brelse */
+	fsck_inode_put(ip); /* does a brelse */
 	return error;
 }
 
 static int remove_dentry(struct gfs2_inode *ip, struct gfs2_dirent *dent,
 			 struct gfs2_dirent *prev_de,
 			 struct gfs2_buffer_head *bh,
-			 char *filename, enum update_flags *update,
-			 uint16_t *count, void *private)
+			 char *filename, uint16_t *count, void *private)
 {
 	/* the metawalk_fxn's private field must be set to the dentry
 	 * block we want to clear */
@@ -1114,7 +1079,6 @@ static int remove_dentry(struct gfs2_inode *ip, struct gfs2_dirent *dent,
 	memset(&dentry, 0, sizeof(struct gfs2_dirent));
 	gfs2_dirent_in(&dentry, (char *)dent);
 	de = &dentry;
-	*update = (opts.no ? not_updated : updated);
 
 	if(de->de_inum.no_addr == *dentryblock)
 		dirent2_del(ip, bh, prev_de, dent);
@@ -1267,16 +1231,14 @@ int delete_data(struct gfs2_inode *ip, uint64_t block, void *private)
 }
 
 int delete_eattr_indir(struct gfs2_inode *ip, uint64_t block, uint64_t parent,
-		       struct gfs2_buffer_head **bh,
-		       enum update_flags *want_updated, void *private)
+		       struct gfs2_buffer_head **bh, void *private)
 {
 	return delete_blocks(ip, block, NULL, _("indirect extended attribute"),
 			     private);
 }
 
 int delete_eattr_leaf(struct gfs2_inode *ip, uint64_t block, uint64_t parent,
-		      struct gfs2_buffer_head **bh,
-		      enum update_flags *want_updated, void *private)
+		      struct gfs2_buffer_head **bh, void *private)
 {
 	return delete_blocks(ip, block, NULL, _("extended attribute"),
 			     private);
diff --git a/gfs2/fsck/metawalk.h b/gfs2/fsck/metawalk.h
index 0721ed1..b720516 100644
--- a/gfs2/fsck/metawalk.h
+++ b/gfs2/fsck/metawalk.h
@@ -6,8 +6,7 @@
 
 struct metawalk_fxns;
 
-int check_inode_eattr(struct gfs2_inode *ip, enum update_flags *want_updated,
-		      struct metawalk_fxns *pass);
+int check_inode_eattr(struct gfs2_inode *ip, struct metawalk_fxns *pass);
 int check_metatree(struct gfs2_inode *ip, struct metawalk_fxns *pass);
 int check_dir(struct gfs2_sbd *sbp, uint64_t block,
 			  struct metawalk_fxns *pass);
@@ -23,11 +22,9 @@ int delete_metadata(struct gfs2_inode *ip, uint64_t block,
 		    struct gfs2_buffer_head **bh, void *private);
 int delete_data(struct gfs2_inode *ip, uint64_t block, void *private);
 int delete_eattr_indir(struct gfs2_inode *ip, uint64_t block, uint64_t parent,
-		       struct gfs2_buffer_head **bh,
-		       enum update_flags *want_updated, void *private);
+		       struct gfs2_buffer_head **bh, void *private);
 int delete_eattr_leaf(struct gfs2_inode *ip, uint64_t block, uint64_t parent,
-		      struct gfs2_buffer_head **bh,
-		      enum update_flags *want_updated, void *private);
+		      struct gfs2_buffer_head **bh, void *private);
 
 /* metawalk_fxns: function pointers to check various parts of the fs
  *
@@ -54,18 +51,14 @@ struct metawalk_fxns {
 			   void *private);
 	int (*check_eattr_indir) (struct gfs2_inode *ip, uint64_t block,
 				  uint64_t parent,
-				  struct gfs2_buffer_head **bh,
-				  enum update_flags *want_updated,
-				  void *private);
+				  struct gfs2_buffer_head **bh, void *private);
 	int (*check_eattr_leaf) (struct gfs2_inode *ip, uint64_t block,
 				 uint64_t parent, struct gfs2_buffer_head **bh,
-				 enum update_flags *want_updated,
 				 void *private);
 	int (*check_dentry) (struct gfs2_inode *ip, struct gfs2_dirent *de,
 			     struct gfs2_dirent *prev,
 			     struct gfs2_buffer_head *bh,
-			     char *filename, enum update_flags *update,
-			     uint16_t *count, void *private);
+			     char *filename, uint16_t *count, void *private);
 	int (*check_eattr_entry) (struct gfs2_inode *ip,
 				  struct gfs2_buffer_head *leaf_bh,
 				  struct gfs2_ea_header *ea_hdr,
@@ -76,11 +69,9 @@ struct metawalk_fxns {
 				     struct gfs2_buffer_head *leaf_bh,
 				     struct gfs2_ea_header *ea_hdr,
 				     struct gfs2_ea_header *ea_hdr_prev,
-				     enum update_flags *want_updated,
 				     void *private);
 	int (*finish_eattr_indir) (struct gfs2_inode *ip, int leaf_pointers,
 				   int leaf_pointer_errors,
-				   enum update_flags *want_updated,
 				   void *private);
 };
 
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index 139daa8..7b0651b 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -38,10 +38,10 @@ static int check_metalist(struct gfs2_inode *ip, uint64_t block,
 static int check_data(struct gfs2_inode *ip, uint64_t block, void *private);
 static int check_eattr_indir(struct gfs2_inode *ip, uint64_t indirect,
 			     uint64_t parent, struct gfs2_buffer_head **bh,
-			     enum update_flags *want_updated, void *private);
+			     void *private);
 static int check_eattr_leaf(struct gfs2_inode *ip, uint64_t block,
 			    uint64_t parent, struct gfs2_buffer_head **bh,
-			    enum update_flags *want_updated, void *private);
+			    void *private);
 static int check_eattr_entries(struct gfs2_inode *ip,
 			       struct gfs2_buffer_head *leaf_bh,
 			       struct gfs2_ea_header *ea_hdr,
@@ -51,11 +51,9 @@ static int check_extended_leaf_eattr(struct gfs2_inode *ip, uint64_t *data_ptr,
 				     struct gfs2_buffer_head *leaf_bh,
 				     struct gfs2_ea_header *ea_hdr,
 				     struct gfs2_ea_header *ea_hdr_prev,
-				     enum update_flags *want_updated,
 				     void *private);
 static int finish_eattr_indir(struct gfs2_inode *ip, int leaf_pointers,
-			      int leaf_pointer_errors,
-			      enum update_flags *want_updated, void *private);
+			      int leaf_pointer_errors, void *private);
 
 struct metawalk_fxns pass1_fxns = {
 	.private = NULL,
@@ -116,10 +114,10 @@ static int check_metalist(struct gfs2_inode *ip, uint64_t block,
 			     "something that is not an indirect block).\n"));
 		if(!found_dup) {
 			gfs2_block_set(ip->i_sbd, bl, block, gfs2_meta_inval);
-			brelse(nbh, not_updated);
+			brelse(nbh);
 			return 1;
 		}
-		brelse(nbh, not_updated);
+		brelse(nbh);
 	} else /* blk check ok */
 		*bh = nbh;
 
@@ -224,7 +222,7 @@ static int check_data(struct gfs2_inode *ip, uint64_t block, void *private)
 }
 
 static int remove_inode_eattr(struct gfs2_inode *ip, struct block_count *bc,
-			      int duplicate, enum update_flags *want_updated)
+			      int duplicate)
 {
 	if (!duplicate) {
 		gfs2_set_bitmap(ip->i_sbd, ip->i_di.di_eattr,
@@ -236,13 +234,12 @@ static int remove_inode_eattr(struct gfs2_inode *ip, struct block_count *bc,
 	bc->ea_count = 0;
 	ip->i_di.di_blocks = 1 + bc->indir_count + bc->data_count;
 	ip->i_di.di_flags &= ~GFS2_DIF_EA_INDIRECT;
-	*want_updated = updated;
+	bmodified(ip->i_bh);
 	return 0;
 }
 
 static int ask_remove_inode_eattr(struct gfs2_inode *ip,
-				  struct block_count *bc,
-				  enum update_flags *want_updated)
+				  struct block_count *bc)
 {
 	log_err( _("Inode %lld (0x%llx) has unrecoverable Extended Attribute "
 		   "errors.\n"), (unsigned long long)ip->i_di.di_num.no_addr,
@@ -257,7 +254,7 @@ static int ask_remove_inode_eattr(struct gfs2_inode *ip,
 			stack;
 			return -1;
 		}
-		if (!remove_inode_eattr(ip, bc, q.dup_block, want_updated))
+		if (!remove_inode_eattr(ip, bc, q.dup_block))
 			log_err( _("Extended attributes were removed.\n"));
 		else
 			log_err( _("Unable to remove inode eattr pointer; "
@@ -278,12 +275,10 @@ static int ask_remove_inode_eattr(struct gfs2_inode *ip,
  * Returns: 1 if the EA is fixed, else 0 if it was not fixed.
  */
 static int clear_eas(struct gfs2_inode *ip, struct block_count *bc,
-		     uint64_t block, int duplicate,
-		     enum update_flags *want_updated, const char *emsg)
+		     uint64_t block, int duplicate, const char *emsg)
 {
 	struct gfs2_sbd *sdp = ip->i_sbd;
 
-	*want_updated = not_updated;
 	log_err( _("Inode #%llu (0x%llx): %s"),
 		(unsigned long long)ip->i_di.di_num.no_addr,
 		(unsigned long long)ip->i_di.di_num.no_addr, emsg);
@@ -293,7 +288,7 @@ static int clear_eas(struct gfs2_inode *ip, struct block_count *bc,
 	if (query(&opts, _("Clear the bad Extended Attribute? (y/n) "))) {
 		errors_corrected++;
 		if (block == ip->i_di.di_eattr) {
-			remove_inode_eattr(ip, bc, duplicate, want_updated);
+			remove_inode_eattr(ip, bc, duplicate);
 			log_err( _("The bad extended attribute was "
 				   "removed.\n"));
 		} else if (!duplicate) {
@@ -302,7 +297,6 @@ static int clear_eas(struct gfs2_inode *ip, struct block_count *bc,
 			log_err( _("The bad Extended Attribute was "
 				   "removed.\n"));
 		}
-		*want_updated = updated;
 		return 1;
 	} else {
 		log_err( _("The bad Extended Attribute was not fixed.\n"));
@@ -313,7 +307,7 @@ static int clear_eas(struct gfs2_inode *ip, struct block_count *bc,
 
 static int check_eattr_indir(struct gfs2_inode *ip, uint64_t indirect,
 			     uint64_t parent, struct gfs2_buffer_head **bh,
-			     enum update_flags *want_updated, void *private)
+			     void *private)
 {
 	struct gfs2_sbd *sdp = ip->i_sbd;
 	int ret = 0;
@@ -342,7 +336,7 @@ static int check_eattr_indir(struct gfs2_inode *ip, uint64_t indirect,
 	*bh = bread(&sdp->buf_list, indirect);
 	if(gfs2_check_meta(*bh, GFS2_METATYPE_IN)) {
 		if(q.block_type != gfs2_block_free) { /* Duplicate? */
-			if (!clear_eas(ip, bc, indirect, 1, want_updated,
+			if (!clear_eas(ip, bc, indirect, 1,
 				       _("Bad indirect Extended Attribute "
 					 "duplicate found"))) {
 				gfs2_block_mark(sdp, bl, indirect,
@@ -351,7 +345,7 @@ static int check_eattr_indir(struct gfs2_inode *ip, uint64_t indirect,
 			}
 			return 1;
 		}
-		clear_eas(ip, bc, indirect, 0, want_updated,
+		clear_eas(ip, bc, indirect, 0,
 			  _("Extended Attribute indirect block has incorrect "
 			    "type"));
 		return 1;
@@ -378,13 +372,12 @@ static int check_eattr_indir(struct gfs2_inode *ip, uint64_t indirect,
 }
 
 static int finish_eattr_indir(struct gfs2_inode *ip, int leaf_pointers,
-			      int leaf_pointer_errors,
-			      enum update_flags *want_updated, void *private)
+			      int leaf_pointer_errors, void *private)
 {
 	struct block_count *bc = (struct block_count *) private;
 
 	if (leaf_pointer_errors == leaf_pointers) /* All eas were bad */
-		return ask_remove_inode_eattr(ip, bc, want_updated);
+		return ask_remove_inode_eattr(ip, bc);
 	log_debug( _("Marking inode #%llu (0x%llx) with extended "
 		     "attribute block\n"),
 		   (unsigned long long)ip->i_di.di_num.no_addr,
@@ -404,7 +397,7 @@ static int finish_eattr_indir(struct gfs2_inode *ip, int leaf_pointers,
 		errors_corrected++;
 		ip->i_di.di_blocks = 1 + bc->indir_count +
 			bc->data_count + bc->ea_count;
-		*want_updated = updated;
+		bmodified(ip->i_bh);
 		log_err( _("Block count fixed.\n"));
 		return 1;
 	}
@@ -413,8 +406,7 @@ static int finish_eattr_indir(struct gfs2_inode *ip, int leaf_pointers,
 }
 
 static int check_leaf_block(struct gfs2_inode *ip, uint64_t block, int btype,
-			    struct gfs2_buffer_head **bh,
-			    enum update_flags *want_updated, void *private)
+			    struct gfs2_buffer_head **bh, void *private)
 {
 	struct gfs2_buffer_head *leaf_bh = NULL;
 	struct gfs2_sbd *sdp = ip->i_sbd;
@@ -431,14 +423,15 @@ static int check_leaf_block(struct gfs2_inode *ip, uint64_t block, int btype,
 	leaf_bh = bread(&sdp->buf_list, block);
 	if(gfs2_check_meta(leaf_bh, btype)) {
 		if(q.block_type != gfs2_block_free) { /* Duplicate? */
-			clear_eas(ip, bc, block, 1, want_updated,
+			clear_eas(ip, bc, block, 1,
 				  _("Bad Extended Attribute duplicate found"));
 		} else {
-			clear_eas(ip, bc, block, 0, want_updated,
+			clear_eas(ip, bc, block, 0,
 				  _("Extended Attribute leaf block "
 				    "has incorrect type"));
 		}
-		brelse(leaf_bh, *want_updated);
+		bmodified(leaf_bh);
+		brelse(leaf_bh);
 		return 1;
 	}
 	if(q.block_type != gfs2_block_free) { /* Duplicate? */
@@ -447,17 +440,18 @@ static int check_leaf_block(struct gfs2_inode *ip, uint64_t block, int btype,
 			   (unsigned long long)block);
 		gfs2_block_mark(sdp, bl, block, gfs2_dup_block);
 		bc->ea_count++;
-		brelse(leaf_bh, not_updated);
+		brelse(leaf_bh);
 		return 1;
 	}
 	if (ip->i_di.di_eattr == 0) {
 		/* Can only get in here if there were unrecoverable ea
 		   errors that caused clear_eas to be called.  What we
 		   need to do here is remove the subsequent ea blocks. */
-		clear_eas(ip, bc, block, 0, want_updated,
+		clear_eas(ip, bc, block, 0,
 			  _("Extended Attribute block removed due to "
 			    "previous errors.\n"));
-		brelse(leaf_bh, *want_updated);
+		bmodified(leaf_bh);
+		brelse(leaf_bh);
 		return 1;
 	}
 	log_debug( _("Setting block #%lld (0x%llx) to eattr block\n"),
@@ -486,7 +480,6 @@ static int check_extended_leaf_eattr(struct gfs2_inode *ip, uint64_t *data_ptr,
 				     struct gfs2_buffer_head *leaf_bh,
 				     struct gfs2_ea_header *ea_hdr,
 				     struct gfs2_ea_header *ea_hdr_prev,
-				     enum update_flags *want_updated,
 				     void *private)
 {
 	uint64_t el_blk = be64_to_cpu(*data_ptr);
@@ -507,16 +500,15 @@ static int check_extended_leaf_eattr(struct gfs2_inode *ip, uint64_t *data_ptr,
 		gfs2_block_set(sdp, bl, ip->i_di.di_eattr, gfs2_bad_block);
 		return 1;
 	}
-	error = check_leaf_block(ip, el_blk, GFS2_METATYPE_ED, &bh,
-				 want_updated, private);
+	error = check_leaf_block(ip, el_blk, GFS2_METATYPE_ED, &bh, private);
 	if (bh)
-		brelse(bh, not_updated);
+		brelse(bh);
 	return error;
 }
 
 static int check_eattr_leaf(struct gfs2_inode *ip, uint64_t block,
 			    uint64_t parent, struct gfs2_buffer_head **bh,
-			    enum update_flags *want_updated, void *private)
+			    void *private)
 {
 	struct gfs2_sbd *sdp = ip->i_sbd;
 
@@ -539,8 +531,7 @@ static int check_eattr_leaf(struct gfs2_inode *ip, uint64_t block,
 		gfs2_block_set(sdp, bl, ip->i_di.di_eattr, gfs2_bad_block);
 		return 1;
 	}
-	return check_leaf_block(ip, block, GFS2_METATYPE_EA, bh, want_updated,
-				private);
+	return check_leaf_block(ip, block, GFS2_METATYPE_EA, bh, private);
 }
 
 static int check_eattr_entries(struct gfs2_inode *ip,
@@ -680,9 +671,7 @@ static int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh,
 	int error;
 	struct block_count bc = {0};
 	struct metawalk_fxns invalidate_metatree = {0};
-	enum update_flags f;
 
-	f = not_updated;
 	invalidate_metatree.check_metalist = clear_metalist;
 	invalidate_metatree.check_data = clear_data;
 	invalidate_metatree.check_leaf = clear_leaf;
@@ -701,7 +690,7 @@ static int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh,
 			errors_corrected++;
 			ip->i_di.di_num.no_addr = ip->i_di.di_num.no_formal_ino = block;
 			gfs2_dinode_out(&ip->i_di, ip->i_bh->b_data);
-			f = updated;
+			bmodified(ip->i_bh);
 		} else
 			log_err( _("Address in inode at block #%" PRIu64
 				 " (0x%" PRIx64 ") not fixed\n"), block, block);
@@ -709,7 +698,7 @@ static int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh,
 
 	if(gfs2_block_check(sdp, bl, block, &q)) {
 		stack;
-		fsck_inode_put(ip, f);
+		fsck_inode_put(ip);
 		return -1;
 	}
 	if(q.block_type != gfs2_block_free) {
@@ -717,10 +706,10 @@ static int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh,
 			   "#%" PRIu64 " (0x%" PRIx64 ")\n"), block, block);
 		if(gfs2_block_mark(sdp, bl, block, gfs2_dup_block)) {
 			stack;
-			fsck_inode_put(ip, f);
+			fsck_inode_put(ip);
 			return -1;
 		}
-		fsck_inode_put(ip, f);
+		fsck_inode_put(ip);
 		return 0;
 	}
 
@@ -731,12 +720,12 @@ static int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh,
 				  block, block);
 		if(gfs2_block_set(sdp, bl, block, gfs2_inode_dir)) {
 			stack;
-			fsck_inode_put(ip, f);
+			fsck_inode_put(ip);
 			return -1;
 		}
 		if(add_to_dir_list(sdp, block)) {
 			stack;
-			fsck_inode_put(ip, f);
+			fsck_inode_put(ip);
 			return -1;
 		}
 		break;
@@ -745,7 +734,7 @@ static int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh,
 				  block, block);
 		if(gfs2_block_set(sdp, bl, block, gfs2_inode_file)) {
 			stack;
-			fsck_inode_put(ip, f);
+			fsck_inode_put(ip);
 			return -1;
 		}
 		break;
@@ -754,7 +743,7 @@ static int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh,
 				  block, block);
 		if(gfs2_block_set(sdp, bl, block, gfs2_inode_lnk)) {
 			stack;
-			fsck_inode_put(ip, f);
+			fsck_inode_put(ip);
 			return -1;
 		}
 		break;
@@ -763,7 +752,7 @@ static int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh,
 				  block, block);
 		if(gfs2_block_set(sdp, bl, block, gfs2_inode_blk)) {
 			stack;
-			fsck_inode_put(ip, f);
+			fsck_inode_put(ip);
 			return -1;
 		}
 		break;
@@ -772,7 +761,7 @@ static int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh,
 				  block, block);
 		if(gfs2_block_set(sdp, bl, block, gfs2_inode_chr)) {
 			stack;
-			fsck_inode_put(ip, f);
+			fsck_inode_put(ip);
 			return -1;
 		}
 		break;
@@ -781,7 +770,7 @@ static int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh,
 				  block, block);
 		if(gfs2_block_set(sdp, bl, block, gfs2_inode_fifo)) {
 			stack;
-			fsck_inode_put(ip, f);
+			fsck_inode_put(ip);
 			return -1;
 		}
 		break;
@@ -790,7 +779,7 @@ static int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh,
 				  block, block);
 		if(gfs2_block_set(sdp, bl, block, gfs2_inode_sock)) {
 			stack;
-			fsck_inode_put(ip, f);
+			fsck_inode_put(ip);
 			return -1;
 		}
 		break;
@@ -799,16 +788,16 @@ static int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh,
 				  block, block);
 		if(gfs2_block_set(sdp, bl, block, gfs2_meta_inval)) {
 			stack;
-			fsck_inode_put(ip, f);
+			fsck_inode_put(ip);
 			return -1;
 		}
 		gfs2_set_bitmap(sdp, block, GFS2_BLKST_FREE);
-		fsck_inode_put(ip, f);
+		fsck_inode_put(ip);
 		return 0;
 	}
 	if(set_link_count(ip->i_sbd, ip->i_di.di_num.no_addr, ip->i_di.di_nlink)) {
 		stack;
-		fsck_inode_put(ip, f);
+		fsck_inode_put(ip);
 		return -1;
 	}
 
@@ -825,11 +814,11 @@ static int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh,
 			log_warn( _("Marking inode invalid\n"));
 			if(gfs2_block_set(sdp, bl, block, gfs2_meta_inval)) {
 				stack;
-				fsck_inode_put(ip, f);
+				fsck_inode_put(ip);
 				return -1;
 			}
 			gfs2_set_bitmap(sdp, block, GFS2_BLKST_FREE);
-			fsck_inode_put(ip, f);
+			fsck_inode_put(ip);
 			return 0;
 		}
 	}
@@ -838,7 +827,7 @@ static int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh,
 
 	error = check_metatree(ip, &pass1_fxns);
 	if (fsck_abort || error < 0) {
-		fsck_inode_put(ip, f);
+		fsck_inode_put(ip);
 		return 0;
 	}
 	if(error > 0) {
@@ -850,15 +839,15 @@ static int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh,
 		gfs2_block_set(sdp, bl, ip->i_di.di_num.no_addr,
 			       gfs2_meta_inval);
 		gfs2_set_bitmap(sdp, ip->i_di.di_num.no_addr, GFS2_BLKST_FREE);
-		fsck_inode_put(ip, f);
+		fsck_inode_put(ip);
 		return 0;
 	}
 
-	error = check_inode_eattr(ip, &f, &pass1_fxns);
+	error = check_inode_eattr(ip, &pass1_fxns);
 
-	if (error && f == updated &&
+	if (error &&
 	    !(ip->i_di.di_flags & GFS2_DIF_EA_INDIRECT))
-		ask_remove_inode_eattr(ip, &bc, &f);
+		ask_remove_inode_eattr(ip, &bc);
 
 	if (ip->i_di.di_blocks != 
 		(1 + bc.indir_count + bc.data_count + bc.ea_count)) {
@@ -880,8 +869,8 @@ static int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh,
 			errors_corrected++;
 			ip->i_di.di_blocks = 1 + bc.indir_count + bc.data_count +
 				bc.ea_count;
+			bmodified(ip->i_bh);
 			gfs2_dinode_out(&ip->i_di, ip->i_bh->b_data);
-			f = updated;
 		} else
 			log_err( _("Bad block count for #%llu (0x%llx"
 				") not fixed\n"),
@@ -889,7 +878,7 @@ static int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh,
 				(unsigned long long)ip->i_di.di_num.no_addr);
 	}
 
-	fsck_inode_put(ip, f);
+	fsck_inode_put(ip);
 	return 0;
 }
 
@@ -1022,7 +1011,7 @@ int pass1(struct gfs2_sbd *sbp)
 				break;
 			warm_fuzzy_stuff(block);
 			if (fsck_abort) { /* if asked to abort */
-				gfs2_rgrp_relse(rgd, not_updated, rgbh);
+				gfs2_rgrp_relse(rgd, rgbh);
 				free(rgbh);
 				return FSCK_OK;
 			}
@@ -1035,15 +1024,15 @@ int pass1(struct gfs2_sbd *sbp)
 
 			if (scan_meta(sbp, bh, block)) {
 				stack;
-				brelse(bh, not_updated);
-				gfs2_rgrp_relse(rgd, not_updated, rgbh);
+				brelse(bh);
+				gfs2_rgrp_relse(rgd, rgbh);
 				free(rgbh);
 				return FSCK_ERROR;
 			}
-			brelse(bh, not_updated);
+			brelse(bh);
 			first = 0;
 		}
-		gfs2_rgrp_relse(rgd, not_updated, rgbh);
+		gfs2_rgrp_relse(rgd, rgbh);
 		free(rgbh);
 	}
 	return FSCK_OK;
diff --git a/gfs2/fsck/pass1b.c b/gfs2/fsck/pass1b.c
index 3cf102b..04b4226 100644
--- a/gfs2/fsck/pass1b.c
+++ b/gfs2/fsck/pass1b.c
@@ -60,12 +60,11 @@ static int check_data(struct gfs2_inode *ip, uint64_t block, void *private)
 
 static int check_eattr_indir(struct gfs2_inode *ip, uint64_t block,
 			     uint64_t parent, struct gfs2_buffer_head **bh,
-			     enum update_flags *want_updated, void *private)
+			     void *private)
 {
 	struct gfs2_sbd *sbp = ip->i_sbd;
 	struct gfs2_buffer_head *indir_bh = NULL;
 
-	*want_updated = not_updated;
 	inc_if_found(block, 0, private);
 	indir_bh = bread(&sbp->buf_list, block);
 	*bh = indir_bh;
@@ -75,12 +74,11 @@ static int check_eattr_indir(struct gfs2_inode *ip, uint64_t block,
 
 static int check_eattr_leaf(struct gfs2_inode *ip, uint64_t block,
 			    uint64_t parent, struct gfs2_buffer_head **bh,
-			    enum update_flags *want_updated, void *private)
+			    void *private)
 {
 	struct gfs2_sbd *sbp = ip->i_sbd;
 	struct gfs2_buffer_head *leaf_bh = NULL;
 
-	*want_updated = not_updated;
 	inc_if_found(block, 0, private);
 	leaf_bh = bread(&sbp->buf_list, block);
 
@@ -100,11 +98,10 @@ static int check_eattr_extentry(struct gfs2_inode *ip, uint64_t *ea_data_ptr,
 				struct gfs2_buffer_head *leaf_bh,
 				struct gfs2_ea_header *ea_hdr,
 				struct gfs2_ea_header *ea_hdr_prev,
-				enum update_flags *want_updated, void *private)
+				void *private)
 {
 	uint64_t block = be64_to_cpu(*ea_data_ptr);
 
-	*want_updated = not_updated;
 	inc_if_found(block, 0, private);
 
 	return 0;
@@ -113,7 +110,7 @@ static int check_eattr_extentry(struct gfs2_inode *ip, uint64_t *ea_data_ptr,
 static int find_dentry(struct gfs2_inode *ip, struct gfs2_dirent *de,
 		       struct gfs2_dirent *prev,
 		       struct gfs2_buffer_head *bh, char *filename,
-		       enum update_flags *update, uint16_t *count, void *priv)
+		       uint16_t *count, void *priv)
 {
 	osi_list_t *tmp1, *tmp2;
 	struct dup_blocks *b;
@@ -190,14 +187,12 @@ static int clear_dup_data(struct gfs2_inode *ip, uint64_t block, void *private)
 
 static int clear_dup_eattr_indir(struct gfs2_inode *ip, uint64_t block,
 				 uint64_t parent, struct gfs2_buffer_head **bh,
-				 enum update_flags *want_updated,
 				 void *private)
 {
 	struct dup_handler *dh = (struct dup_handler *) private;
 	/* Can't use fxns from eattr.c since we need to check the ref
 	 * count */
 	*bh = NULL;
-	*want_updated = not_updated;
 	if(dh->ref_count == 1)
 		return 1;
 	if(block == dh->b->block_no) {
@@ -220,11 +215,10 @@ static int clear_dup_eattr_indir(struct gfs2_inode *ip, uint64_t block,
 
 static int clear_dup_eattr_leaf(struct gfs2_inode *ip, uint64_t block,
 				uint64_t parent, struct gfs2_buffer_head **bh,
-				enum update_flags *want_updated, void *private)
+				void *private)
 {
 	struct dup_handler *dh = (struct dup_handler *) private;
 
-	*want_updated = not_updated;
 	if(dh->ref_count == 1)
 		return 1;
 	if(block == dh->b->block_no) {
@@ -292,13 +286,11 @@ static int clear_eattr_extentry(struct gfs2_inode *ip, uint64_t *ea_data_ptr,
 				struct gfs2_buffer_head *leaf_bh,
 				struct gfs2_ea_header *ea_hdr,
 				struct gfs2_ea_header *ea_hdr_prev,
-				enum update_flags *want_updated,
 				void *private)
 {
 	uint64_t block = be64_to_cpu(*ea_data_ptr);
 	struct dup_handler *dh = (struct dup_handler *) private;
 
-	*want_updated = not_updated;
 	if(dh->ref_count == 1)
 		return 1;
 	if(block == dh->b->block_no) {
@@ -337,7 +329,6 @@ static int find_block_ref(struct gfs2_sbd *sbp, uint64_t inode, struct dup_block
 		.check_eattr_entry = check_eattr_entry,
 		.check_eattr_extentry = check_eattr_extentry,
 	};
-	enum update_flags update;
 
 	ip = fsck_load_inode(sbp, inode); /* bread, inode_get */
 	log_debug( _("Checking inode %" PRIu64 " (0x%" PRIx64 ")'s "
@@ -345,14 +336,14 @@ static int find_block_ref(struct gfs2_sbd *sbp, uint64_t inode, struct dup_block
 		     ")\n"), inode, inode, b->block_no, b->block_no);
 	if(check_metatree(ip, &find_refs)) {
 		stack;
-		fsck_inode_put(ip, not_updated); /* out, brelse, free */
+		fsck_inode_put(ip); /* out, brelse, free */
 		return -1;
 	}
 	log_debug( _("Done checking metatree\n"));
 	/* Check for ea references in the inode */
-	if(check_inode_eattr(ip, &update, &find_refs) < 0){
+	if(check_inode_eattr(ip, &find_refs) < 0){
 		stack;
-		fsck_inode_put(ip, not_updated); /* out, brelse, free */
+		fsck_inode_put(ip); /* out, brelse, free */
 		return -1;
 	}
 	if (myfi.found) {
@@ -372,7 +363,7 @@ static int find_block_ref(struct gfs2_sbd *sbp, uint64_t inode, struct dup_block
 		id->ea_only = myfi.ea_only;
 		osi_list_add_prev(&id->list, &b->ref_inode_list);
 	}
-	fsck_inode_put(ip, (opts.no ? not_updated : updated)); /* out, brelse, free */
+	fsck_inode_put(ip); /* out, brelse, free */
 	return 0;
 }
 
@@ -393,7 +384,6 @@ static int handle_dup_blk(struct gfs2_sbd *sbp, struct dup_blocks *b)
 	};
 	struct gfs2_inode *ip;
 	struct dup_handler dh = {0};
-	enum update_flags update;
 
 	osi_list_foreach(tmp, &b->ref_inode_list) {
 		id = osi_list_entry(tmp, struct inode_with_dups, list);
@@ -414,7 +404,7 @@ static int handle_dup_blk(struct gfs2_sbd *sbp, struct dup_blocks *b)
 
 		bh = bread(&sbp->buf_list, b->block_no);
 		cmagic = ((struct gfs2_meta_header *)(bh->b_data))->mh_magic;
-		brelse(bh, not_updated);
+		brelse(bh);
 		if (be32_to_cpu(cmagic) == GFS2_MAGIC) {
 			tmp = b->ref_inode_list.next;
 			id = osi_list_entry(tmp, struct inode_with_dups, list);
@@ -439,7 +429,8 @@ static int handle_dup_blk(struct gfs2_sbd *sbp, struct dup_blocks *b)
 				gfs2_block_set(ip->i_sbd, bl,
 					       ip->i_di.di_num.no_addr,
 					       gfs2_meta_inval);
-				fsck_inode_put(ip, updated);
+				bmodified(ip->i_bh);
+				fsck_inode_put(ip);
 			} else {
 				log_warn( _("The bad inode was not cleared."));
 			}
@@ -481,14 +472,14 @@ static int handle_dup_blk(struct gfs2_sbd *sbp, struct dup_blocks *b)
 		dh.id = id;
 		clear_dup_fxns.private = (void *) &dh;
 		/* Clear the EAs for the inode first */
-		check_inode_eattr(ip, &update, &clear_dup_fxns);
+		check_inode_eattr(ip, &clear_dup_fxns);
 		/* If the dup wasn't only in the EA, clear the inode */
 		if(!id->ea_only)
 			check_metatree(ip, &clear_dup_fxns);
 
 		gfs2_block_set(ip->i_sbd, bl, ip->i_di.di_num.no_addr,
 			       gfs2_meta_inval);
-		fsck_inode_put(ip, updated); /* out, brelse, free */
+		fsck_inode_put(ip); /* out, brelse, free */
 		dh.ref_inode_count--;
 		if(dh.ref_inode_count == 1)
 			break;
diff --git a/gfs2/fsck/pass1c.c b/gfs2/fsck/pass1c.c
index c8b05b1..6d06d83 100644
--- a/gfs2/fsck/pass1c.c
+++ b/gfs2/fsck/pass1c.c
@@ -27,6 +27,7 @@ static int remove_eattr_entry(struct gfs2_sbd *sdp,
 	log_err( _("Bad Extended Attribute at block #%"PRIu64
 		   " (0x%" PRIx64 ") removed.\n"),
 		 leaf_bh->b_blocknr, leaf_bh->b_blocknr);
+	bmodified(leaf_bh);
 	return 0;
 }
 
@@ -58,14 +59,13 @@ static int ask_remove_eattr_entry(struct gfs2_sbd *sdp,
 	return 1;
 }
 
-static int ask_remove_eattr(struct gfs2_inode *ip,
-			    enum update_flags *need_update)
+static int ask_remove_eattr(struct gfs2_inode *ip)
 {
 	errors_found++;
 	if (query(&opts, _("Remove the bad Extended Attribute? (y/n) "))) {
 		errors_corrected++;
 		ip->i_di.di_eattr = 0;
-		*need_update = updated;
+		bmodified(ip->i_bh);
 		log_err( _("Bad Extended Attribute removed.\n"));
 	} else
 		log_err( _("Bad Extended Attribute not removed.\n"));
@@ -74,13 +74,12 @@ static int ask_remove_eattr(struct gfs2_inode *ip,
 
 static int check_eattr_indir(struct gfs2_inode *ip, uint64_t block,
 		      uint64_t parent, struct gfs2_buffer_head **bh,
-		      enum update_flags *need_update, void *private)
+		      void *private)
 {
 	struct gfs2_sbd *sbp = ip->i_sbd;
 	struct gfs2_block_query q;
 	struct gfs2_buffer_head *indir_bh = NULL;
 
-	*need_update = not_updated;
 	if(gfs2_check_range(sbp, block)) {
 		log_err( _("Extended attributes indirect block #%llu"
 			" (0x%llx) for inode #%llu"
@@ -89,7 +88,7 @@ static int check_eattr_indir(struct gfs2_inode *ip, uint64_t block,
 			(unsigned long long)block,
 			(unsigned long long)ip->i_di.di_num.no_addr,
 			(unsigned long long)ip->i_di.di_num.no_addr);
-		return ask_remove_eattr(ip, need_update);
+		return ask_remove_eattr(ip);
 	}
 	else if (gfs2_block_check(sbp, bl, block, &q)) {
 		stack;
@@ -103,7 +102,7 @@ static int check_eattr_indir(struct gfs2_inode *ip, uint64_t block,
 			(unsigned long long)block,
 			(unsigned long long)ip->i_di.di_num.no_addr,
 			(unsigned long long)ip->i_di.di_num.no_addr);
-		return ask_remove_eattr(ip, need_update);
+		return ask_remove_eattr(ip);
 	}
 	else
 		indir_bh = bread(&sbp->buf_list, block);
@@ -114,7 +113,7 @@ static int check_eattr_indir(struct gfs2_inode *ip, uint64_t block,
 
 static int check_eattr_leaf(struct gfs2_inode *ip, uint64_t block,
 		     uint64_t parent, struct gfs2_buffer_head **bh,
-		     enum update_flags *need_update, void *private)
+		     void *private)
 {
 	struct gfs2_sbd *sbp = ip->i_sbd;
 	struct gfs2_block_query q;
@@ -124,7 +123,7 @@ static int check_eattr_leaf(struct gfs2_inode *ip, uint64_t block,
 			" (0x%llx) out of range.\n"),
 			(unsigned long long)ip->i_di.di_num.no_addr,
 			(unsigned long long)ip->i_di.di_num.no_addr);
-		return ask_remove_eattr(ip, need_update);
+		return ask_remove_eattr(ip);
 	}
 	else if (gfs2_block_check(sbp, bl, block, &q)) {
 		stack;
@@ -135,7 +134,7 @@ static int check_eattr_leaf(struct gfs2_inode *ip, uint64_t block,
 			   " (0x%llx) invalid.\n"),
 			 (unsigned long long)ip->i_di.di_num.no_addr,
 			 (unsigned long long)ip->i_di.di_num.no_addr);
-		return ask_remove_eattr(ip, need_update);
+		return ask_remove_eattr(ip);
 	}
 	else 
 		*bh = bread(&sbp->buf_list, block);
@@ -213,8 +212,7 @@ static int check_eattr_entry(struct gfs2_inode *ip,
 static int check_eattr_extentry(struct gfs2_inode *ip, uint64_t *ea_ptr,
 			 struct gfs2_buffer_head *leaf_bh,
 			 struct gfs2_ea_header *ea_hdr,
-			 struct gfs2_ea_header *ea_hdr_prev,
-			 enum update_flags *want_updated, void *private)
+			 struct gfs2_ea_header *ea_hdr_prev, void *private)
 {
 	struct gfs2_block_query q;
 	struct gfs2_sbd *sbp = ip->i_sbd;
@@ -244,7 +242,6 @@ int pass1c(struct gfs2_sbd *sbp)
 	int error = 0;
 	osi_list_t *tmp, *x;
 	struct special_blocks *ea_block;
-	enum update_flags want_updated = not_updated;
 
 	pass1c_fxns.check_eattr_indir = &check_eattr_indir;
 	pass1c_fxns.check_eattr_leaf = &check_eattr_leaf;
@@ -271,18 +268,15 @@ int pass1c(struct gfs2_sbd *sbp)
 				  (unsigned long long)ip->i_di.di_eattr,
 				  (unsigned long long)ip->i_di.di_eattr);
 			/* FIXME: Handle walking the eattr here */
-			error = check_inode_eattr(ip, &want_updated,
-						  &pass1c_fxns);
+			error = check_inode_eattr(ip, &pass1c_fxns);
 			if(error < 0) {
 				stack;
-				brelse(bh, not_updated);
+				brelse(bh);
 				return FSCK_ERROR;
 			}
-
-			fsck_inode_put(ip, want_updated); /* dinode_out,
-							     brelse, free */
+			fsck_inode_put(ip); /* dinode_out, brelse, free */
 		} else {
-			brelse(bh, want_updated);
+			brelse(bh);
 		}
 	}
 	return FSCK_OK;
diff --git a/gfs2/fsck/pass2.c b/gfs2/fsck/pass2.c
index 15b7594..0a3f63d 100644
--- a/gfs2/fsck/pass2.c
+++ b/gfs2/fsck/pass2.c
@@ -76,18 +76,16 @@ static int set_dotdot_dir(struct gfs2_sbd *sbp, uint64_t childblock,
 }
 
 static int check_eattr_indir(struct gfs2_inode *ip, uint64_t block,
-			    uint64_t parent, struct gfs2_buffer_head **bh,
-			     enum update_flags *want_updated, void *private)
+			     uint64_t parent, struct gfs2_buffer_head **bh,
+			     void *private)
 {
-	*want_updated = not_updated;
 	*bh = bread(&ip->i_sbd->buf_list, block);
 	return 0;
 }
 static int check_eattr_leaf(struct gfs2_inode *ip, uint64_t block,
 			    uint64_t parent, struct gfs2_buffer_head **bh,
-			    enum update_flags *want_updated, void *private)
+			    void *private)
 {
-	*want_updated = not_updated;
 	*bh = bread(&ip->i_sbd->buf_list, block);
 	return 0;
 }
@@ -155,7 +153,7 @@ struct metawalk_fxns pass2_fxns_delete = {
 static int check_dentry(struct gfs2_inode *ip, struct gfs2_dirent *dent,
 		 struct gfs2_dirent *prev_de,
 		 struct gfs2_buffer_head *bh, char *filename,
-		 enum update_flags *update, uint16_t *count, void *priv)
+		 uint16_t *count, void *priv)
 {
 	struct gfs2_sbd *sbp = ip->i_sbd;
 	struct gfs2_block_query q = {0};
@@ -232,7 +230,7 @@ static int check_dentry(struct gfs2_inode *ip, struct gfs2_dirent *dent,
 			errors_corrected++;
 			log_err( _("Clearing %s\n"), tmp_name);
 			dirent2_del(ip, bh, prev_de, dent);
-			*update = updated;
+			bmodified(bh);
 			return 1;
 		} else {
 			log_err( _("Directory entry to out of range block remains\n"));
@@ -256,14 +254,14 @@ static int check_dentry(struct gfs2_inode *ip, struct gfs2_dirent *dent,
 		if(query(&opts, _("Delete inode containing bad blocks? (y/n)"))) {
 			errors_corrected++;
 			entry_ip = fsck_load_inode(sbp, de->de_inum.no_addr);
-			check_inode_eattr(entry_ip, update,
-					  &pass2_fxns_delete);
+			check_inode_eattr(entry_ip, &pass2_fxns_delete);
 			check_metatree(entry_ip, &pass2_fxns_delete);
-			fsck_inode_put(entry_ip, updated);
+			bmodified(entry_ip->i_bh);
+			fsck_inode_put(entry_ip);
 			dirent2_del(ip, bh, prev_de, dent);
 			gfs2_block_set(sbp, bl, de->de_inum.no_addr,
 				       gfs2_block_free);
-			*update = updated;
+			bmodified(bh);
 			log_warn( _("The inode containing bad blocks was "
 				    "deleted.\n"));
 			return 1;
@@ -297,7 +295,7 @@ static int check_dentry(struct gfs2_inode *ip, struct gfs2_dirent *dent,
 
 			errors_corrected++;
 			dirent2_del(ip, bh, prev_de, dent);
-			*update = updated;
+			bmodified(bh);
 			log_warn( _("Directory entry '%s' cleared\n"), tmp_name);
 			/* If it was previously marked invalid (i.e. known
 			   to be bad, not just a free block, etc.) then
@@ -308,15 +306,16 @@ static int check_dentry(struct gfs2_inode *ip, struct gfs2_dirent *dent,
 			/* Now try to clear the dinode, if it is an dinode */
 			bhi = bread(&sbp->buf_list, de->de_inum.no_addr);
 			error = gfs2_check_meta(bhi, GFS2_METATYPE_DI);
-			brelse(bhi, updated);
+			bmodified(bhi);
+			brelse(bhi);
 			if (error)
 				return 1; /* not a dinode: nothing to delete */
 
 			entry_ip = fsck_load_inode(sbp, de->de_inum.no_addr);
-			check_inode_eattr(entry_ip, update,
-					  &pass2_fxns_delete);
+			check_inode_eattr(entry_ip, &pass2_fxns_delete);
 			check_metatree(entry_ip, &pass2_fxns_delete);
-			fsck_inode_put(entry_ip, updated);
+			bmodified(entry_ip->i_bh);
+			fsck_inode_put(entry_ip);
 			gfs2_block_set(sbp, bl, de->de_inum.no_addr,
 				       gfs2_block_free);
 
@@ -345,11 +344,11 @@ static int check_dentry(struct gfs2_inode *ip, struct gfs2_dirent *dent,
 		if(query(&opts, _("Clear stale directory entry? (y/n) "))) {
 			errors_corrected++;
 			entry_ip = fsck_load_inode(sbp, de->de_inum.no_addr);
-			check_inode_eattr(entry_ip, update, &clear_eattrs);
-			fsck_inode_put(entry_ip, not_updated);
+			check_inode_eattr(entry_ip, &clear_eattrs);
+			fsck_inode_put(entry_ip);
 
 			dirent2_del(ip, bh, prev_de, dent);
-			*update = updated;
+			bmodified(bh);
 			log_err( _("Stale directory entry deleted\n"));
 			return 1;
 		} else {
@@ -373,12 +372,11 @@ static int check_dentry(struct gfs2_inode *ip, struct gfs2_dirent *dent,
 
 				errors_corrected++;
 				entry_ip = fsck_load_inode(sbp, de->de_inum.no_addr);
-				check_inode_eattr(entry_ip, update,
-						  &clear_eattrs);
-				fsck_inode_put(entry_ip, not_updated);
+				check_inode_eattr(entry_ip, &clear_eattrs);
+				fsck_inode_put(entry_ip);
 
 				dirent2_del(ip, bh, prev_de, dent);
-				*update = updated;
+				bmodified(bh);
 				return 1;
 			} else {
 				log_err( _("Duplicate '.' entry remains\n"));
@@ -411,12 +409,11 @@ static int check_dentry(struct gfs2_inode *ip, struct gfs2_dirent *dent,
 			if(query(&opts, _("Remove '.' reference? (y/n) "))) {
 				errors_corrected++;
 				entry_ip = fsck_load_inode(sbp, de->de_inum.no_addr);
-				check_inode_eattr(entry_ip, update,
-						  &clear_eattrs);
-				fsck_inode_put(entry_ip, not_updated);
+				check_inode_eattr(entry_ip, &clear_eattrs);
+				fsck_inode_put(entry_ip);
 
 				dirent2_del(ip, bh, prev_de, dent);
-				*update = updated;
+				bmodified(bh);
 				return 1;
 
 			} else {
@@ -449,12 +446,11 @@ static int check_dentry(struct gfs2_inode *ip, struct gfs2_dirent *dent,
 
 				errors_corrected++;
 				entry_ip = fsck_load_inode(sbp, de->de_inum.no_addr);
-				check_inode_eattr(entry_ip, update,
-						  &clear_eattrs);
-				fsck_inode_put(entry_ip, not_updated);
+				check_inode_eattr(entry_ip, &clear_eattrs);
+				fsck_inode_put(entry_ip);
 
 				dirent2_del(ip, bh, prev_de, dent);
-				*update = 1;
+				bmodified(bh);
 				return 1;
 			} else {
 				log_err( _("Duplicate '..' entry remains\n"));
@@ -477,12 +473,11 @@ static int check_dentry(struct gfs2_inode *ip, struct gfs2_dirent *dent,
 			if(query(&opts, _("Clear bad '..' directory entry? (y/n) "))) {
 				errors_corrected++;
 				entry_ip = fsck_load_inode(sbp, de->de_inum.no_addr);
-				check_inode_eattr(entry_ip, update,
-						  &clear_eattrs);
-				fsck_inode_put(entry_ip, not_updated);
+				check_inode_eattr(entry_ip, &clear_eattrs);
+				fsck_inode_put(entry_ip);
 
 				dirent2_del(ip, bh, prev_de, dent);
-				*update = 1;
+				bmodified(bh);
 				return 1;
 			} else {
 				log_err( _("Bad '..' directory entry remains\n"));
@@ -505,7 +500,6 @@ static int check_dentry(struct gfs2_inode *ip, struct gfs2_dirent *dent,
 
 		ds->dotdotdir = 1;
 		increment_link(sbp, de->de_inum.no_addr);
-		*update = (opts.no ? not_updated : updated);
 		(*count)++;
 		ds->entry_count++;
 		return 0;
@@ -516,7 +510,6 @@ static int check_dentry(struct gfs2_inode *ip, struct gfs2_dirent *dent,
 	if(q.block_type != gfs2_inode_dir) {
 		log_debug( _("Found non-dir inode dentry\n"));
 		increment_link(sbp, de->de_inum.no_addr);
-		*update = (opts.no ? not_updated : updated);
 		(*count)++;
 		ds->entry_count++;
 		return 0;
@@ -531,8 +524,7 @@ static int check_dentry(struct gfs2_inode *ip, struct gfs2_dirent *dent,
 		errors_found++;
 		if(query(&opts, _("Clear hard link to directory? (y/n) "))) {
 			errors_corrected++;
-			*update = 1;
-
+			bmodified(bh);
 			dirent2_del(ip, bh, prev_de, dent);
 			log_warn( _("Directory entry %s cleared\n"), filename);
 
@@ -549,7 +541,6 @@ static int check_dentry(struct gfs2_inode *ip, struct gfs2_dirent *dent,
 		return -1;
 	}
 	increment_link(sbp, de->de_inum.no_addr);
-	*update = (opts.no ? not_updated : updated);
 	(*count)++;
 	ds->entry_count++;
 	/* End of checks */
@@ -579,7 +570,6 @@ static int check_system_dir(struct gfs2_inode *sysinode, const char *dirname,
 	char *filename;
 	int filename_len;
 	char tmp_name[256];
-	enum update_flags update = not_updated;
 	int error = 0;
 
 	log_info( _("Checking system directory inode '%s'\n"), dirname);
@@ -607,7 +597,7 @@ static int check_system_dir(struct gfs2_inode *sysinode, const char *dirname,
 		gfs2_block_set(sysinode->i_sbd, bl, iblock, gfs2_meta_inval);
 
 	bh = bhold(sysinode->i_bh);
-	if(check_inode_eattr(sysinode, &update, &pass2_fxns)) {
+	if(check_inode_eattr(sysinode, &pass2_fxns)) {
 		stack;
 		return -1;
 	}
@@ -637,7 +627,7 @@ static int check_system_dir(struct gfs2_inode *sysinode, const char *dirname,
 				       sysinode->i_di.di_num.no_addr);
 			ds.entry_count++;
 			free(filename);
-			update = 1;
+			bmodified(sysinode->i_bh);
 		} else
 			log_err( _("The directory was not fixed.\n"));
 	}
@@ -654,8 +644,8 @@ static int check_system_dir(struct gfs2_inode *sysinode, const char *dirname,
 			 (unsigned long long)sysinode->i_di.di_num.no_addr)) {
 			errors_corrected++;
 			sysinode->i_di.di_entries = ds.entry_count;
+			bmodified(sysinode->i_bh);
 			log_warn( _("Entries updated\n"));
-			update = 1;
 		} else {
 			log_err( _("Entries for inode %llu (0x%llx"
 				") left out of sync\n"),
@@ -666,7 +656,9 @@ static int check_system_dir(struct gfs2_inode *sysinode, const char *dirname,
 		}
 	}
 
-	brelse(bh, opts.no ? not_updated : update);
+	if (!opts.no)
+		bmodified(bh);
+	brelse(bh);
 	return 0;
 }
 
@@ -705,7 +697,6 @@ int pass2(struct gfs2_sbd *sbp)
 	int filename_len;
 	char tmp_name[256];
 	int error = 0;
-	enum update_flags need_update = NOT_UPDATED;
 	struct dup_blocks *b;
 
 	/* Check all the system directory inodes. */
@@ -728,7 +719,6 @@ int pass2(struct gfs2_sbd *sbp)
 	log_info( _("Checking directory inodes.\n"));
 	/* Grab each directory inode, and run checks on it */
 	for(i = 0; i < last_fs_block; i++) {
-		need_update = 0;
 		warm_fuzzy_stuff(i);
 		if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
 			return FSCK_OK;
@@ -756,11 +746,11 @@ int pass2(struct gfs2_sbd *sbp)
 			 * is valid */
 			ip = fsck_load_inode(sbp, i);
 			if(check_metatree(ip, &pass2_fxns)) {
-				fsck_inode_put(ip, not_updated);
+				fsck_inode_put(ip);
 				stack;
 				return FSCK_ERROR;
 			}
-			fsck_inode_put(ip, not_updated);
+			fsck_inode_put(ip);
 		}
 		error = check_dir(sbp, i, &pass2_fxns);
 		if(error < 0) {
@@ -834,7 +824,7 @@ int pass2(struct gfs2_sbd *sbp)
 				ds.entry_count++;
 				free(filename);
 				log_err( _("The directory was fixed.\n"));
-				need_update = UPDATED;
+				bmodified(ip->i_bh);
 			} else {
 				log_err( _("The directory was not fixed.\n"));
 			}
@@ -851,13 +841,12 @@ int pass2(struct gfs2_sbd *sbp)
 				  _("Fix the entry count? (y/n) "))) {
 				errors_corrected++;
 				ip->i_di.di_entries = ds.entry_count;
-				need_update = UPDATED;
+				bmodified(ip->i_bh);
 			} else {
 				log_err( _("The entry count was not fixed.\n"));
 			}
 		}
-		fsck_inode_put(ip, need_update); /* does a gfs2_dinode_out,
-						    brelse */
+		fsck_inode_put(ip); /* does a gfs2_dinode_out, brelse */
 	}
 	/* Now that we've deleted the inodes marked "bad" we can safely
 	   get rid of the duplicate block list.  If we do it any sooner,
diff --git a/gfs2/fsck/pass3.c b/gfs2/fsck/pass3.c
index d119915..14c25a7 100644
--- a/gfs2/fsck/pass3.c
+++ b/gfs2/fsck/pass3.c
@@ -32,15 +32,15 @@ static int attach_dotdot_to(struct gfs2_sbd *sbp, uint64_t newdotdot,
 	filename_len = strlen("..");
 	if(!(filename = malloc((sizeof(char) * filename_len) + 1))) {
 		log_err( _("Unable to allocate name\n"));
-		fsck_inode_put(ip, not_updated);
-		fsck_inode_put(pip, not_updated);
+		fsck_inode_put(ip);
+		fsck_inode_put(pip);
 		stack;
 		return -1;
 	}
 	if(!memset(filename, 0, (sizeof(char) * filename_len) + 1)) {
 		log_err( _("Unable to zero name\n"));
-		fsck_inode_put(ip, not_updated);
-		fsck_inode_put(pip, not_updated);
+		fsck_inode_put(ip);
+		fsck_inode_put(pip);
 		stack;
 		return -1;
 	}
@@ -51,8 +51,10 @@ static int attach_dotdot_to(struct gfs2_sbd *sbp, uint64_t newdotdot,
 		decrement_link(sbp, olddotdot);
 	dir_add(ip, filename, filename_len, &pip->i_di.di_num, DT_DIR);
 	increment_link(sbp, newdotdot);
-	fsck_inode_put(ip, updated);
-	fsck_inode_put(pip, updated);
+	bmodified(ip->i_bh);
+	fsck_inode_put(ip);
+	bmodified(pip->i_bh);
+	fsck_inode_put(pip);
 	return 0;
 }
 
@@ -257,7 +259,7 @@ int pass3(struct gfs2_sbd *sbp)
 						gfs2_block_set(sbp, bl,
 							       di->dinode,
 							       gfs2_block_free);
-						fsck_inode_put(ip, not_updated);
+						fsck_inode_put(ip);
 						break;
 					} else {
 						log_err( _("Zero-size unlinked directory remains\n"));
@@ -267,15 +269,16 @@ int pass3(struct gfs2_sbd *sbp)
 				if(query(&opts, _("Add unlinked directory to lost+found? (y/n) "))) {
 					errors_corrected++;
 					if(add_inode_to_lf(ip)) {
-						fsck_inode_put(ip, not_updated);
+						fsck_inode_put(ip);
 						stack;
 						return FSCK_ERROR;
 					}
 					log_warn( _("Directory relinked to lost+found\n"));
-					fsck_inode_put(ip, updated);
+					bmodified(ip->i_bh);
+					fsck_inode_put(ip);
 				} else {
 					log_err( _("Unlinked directory remains unlinked\n"));
-					fsck_inode_put(ip, not_updated);
+					fsck_inode_put(ip);
 				}
 				break;
 			}
diff --git a/gfs2/fsck/pass4.c b/gfs2/fsck/pass4.c
index 09a11a6..503d297 100644
--- a/gfs2/fsck/pass4.c
+++ b/gfs2/fsck/pass4.c
@@ -29,6 +29,7 @@ static int fix_inode_count(struct gfs2_sbd *sbp, struct inode_info *ii,
 	if(ip->i_di.di_nlink == ii->counted_links)
 		return 0;
 	ip->i_di.di_nlink = ii->counted_links;
+	bmodified(ip->i_bh);
 
 	log_debug( _("Changing inode %llu (0x%llx) to have %u links\n"),
 		  (unsigned long long)ip->i_di.di_num.no_addr,
@@ -43,14 +44,12 @@ static int scan_inode_list(struct gfs2_sbd *sbp, osi_list_t *list) {
 	struct gfs2_inode *ip;
 	int lf_addition = 0;
 	struct gfs2_block_query q;
-	enum update_flags f;
 
 	/* FIXME: should probably factor this out into a generic
 	 * scanning fxn */
 	osi_list_foreach(tmp, list) {
 		if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
 			return 0;
-		f = not_updated;
 		if(!(ii = osi_list_entry(tmp, struct inode_info, list))) {
 			log_crit( _("osi_list_foreach broken in scan_info_list!!\n"));
 			exit(FSCK_ERROR);
@@ -74,10 +73,11 @@ static int scan_inode_list(struct gfs2_sbd *sbp, osi_list_t *list) {
 						 _("Delete unlinked inode with bad blocks? (y/n) "))) {
 					errors_corrected++;
 					ip = fsck_load_inode(sbp, ii->inode);
-					check_inode_eattr(ip, &f,
+					check_inode_eattr(ip,
 							  &pass4_fxns_delete);
 					check_metatree(ip, &pass4_fxns_delete);
-					fsck_inode_put(ip, updated);
+					bmodified(ip->i_bh);
+					fsck_inode_put(ip);
 					gfs2_block_set(sbp, bl, ii->inode,
 						       gfs2_block_free);
 					continue;
@@ -97,17 +97,17 @@ static int scan_inode_list(struct gfs2_sbd *sbp, osi_list_t *list) {
 				ip = fsck_load_inode(sbp, ii->inode);
 				if(query(&opts, _("Delete unlinked inode "
 						  "? (y/n) "))) {
-					check_inode_eattr(ip, &f,
+					check_inode_eattr(ip,
 							  &pass4_fxns_delete);
 					check_metatree(ip, &pass4_fxns_delete);
-					fsck_inode_put(ip, updated);
+					bmodified(ip->i_bh);
 					gfs2_block_set(sbp, bl, ii->inode,
 						       gfs2_block_free);
 					log_err( _("The inode was deleted\n"));
 				} else {
 					log_err( _("The inode was not "
 						   "deleted\n"));
-					fsck_inode_put(ip, not_updated);
+					fsck_inode_put(ip);
 				}
 				continue;
 			}
@@ -123,7 +123,7 @@ static int scan_inode_list(struct gfs2_sbd *sbp, osi_list_t *list) {
 					errors_corrected++;
 					gfs2_block_set(sbp, bl, ii->inode,
 						       gfs2_block_free);
-					fsck_inode_put(ip, not_updated);
+					fsck_inode_put(ip);
 					continue;
 				}
 
@@ -131,10 +131,10 @@ static int scan_inode_list(struct gfs2_sbd *sbp, osi_list_t *list) {
 			errors_found++;
 			if(query(&opts, _("Add unlinked inode to lost+found? (y/n)"))) {
 				errors_corrected++;
-				f = updated;
+				bmodified(ip->i_bh);
 				if(add_inode_to_lf(ip)) {
 					stack;
-					fsck_inode_put(ip, not_updated);
+					fsck_inode_put(ip);
 					return -1;
 				}
 				else {
@@ -143,7 +143,7 @@ static int scan_inode_list(struct gfs2_sbd *sbp, osi_list_t *list) {
 				}
 			} else
 				log_err( _("Unlinked inode left unlinked\n"));
-			fsck_inode_put(ip, f);
+			fsck_inode_put(ip);
 		} /* if(ii->counted_links == 0) */
 		else if(ii->link_count != ii->counted_links) {
 			log_err( _("Link count inconsistent for inode %" PRIu64
@@ -157,7 +157,8 @@ static int scan_inode_list(struct gfs2_sbd *sbp, osi_list_t *list) {
 				errors_corrected++;
 				ip = fsck_load_inode(sbp, ii->inode); /* bread, inode_get */
 				fix_inode_count(sbp, ii, ip);
-				fsck_inode_put(ip, updated); /* out, brelse, free */
+				bmodified(ip->i_bh);
+				fsck_inode_put(ip); /* out, brelse, free */
 				log_warn( _("Link count updated for inode %"
 						 PRIu64 " (0x%" PRIx64 ") \n"), ii->inode, ii->inode);
 			} else {
diff --git a/gfs2/fsck/pass5.c b/gfs2/fsck/pass5.c
index fd09562..0479301 100644
--- a/gfs2/fsck/pass5.c
+++ b/gfs2/fsck/pass5.c
@@ -148,9 +148,9 @@ static int check_block_status(struct gfs2_sbd *sbp, char *buffer, unsigned int b
 	return 0;
 }
 
-static enum update_flags update_rgrp(struct gfs2_sbd *sbp, struct rgrp_list *rgp,
-			      uint32_t *count, struct gfs2_buffer_head **rgbh,
-			      struct gfs2_rgrp *rg)
+static void update_rgrp(struct gfs2_sbd *sbp, struct rgrp_list *rgp,
+			uint32_t *count, struct gfs2_buffer_head **rgbh,
+			struct gfs2_rgrp *rg)
 {
 	uint32_t i;
 	struct gfs2_bitmap *bits;
@@ -164,7 +164,7 @@ static enum update_flags update_rgrp(struct gfs2_sbd *sbp, struct rgrp_list *rgp
 		check_block_status(sbp, rgbh[i]->b_data + bits->bi_offset,
 						   bits->bi_len, &rg_block, rgp->ri.ri_data0, count);
 		if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
-			return 0;
+			return;
 	}
 
 	/* actually adjust counters and write out to disk */
@@ -197,11 +197,9 @@ static enum update_flags update_rgrp(struct gfs2_sbd *sbp, struct rgrp_list *rgp
 			log_warn( _("Resource group counts updated\n"));
 			/* write out the rgrp */
 			gfs2_rgrp_out(rg, rgbh[0]->b_data);
-			return updated;
 		} else
 			log_err( _("Resource group counts left inconsistent\n"));
 	}
-	return not_updated;
 }
 
 /**
@@ -221,8 +219,6 @@ int pass5(struct gfs2_sbd *sbp)
 
 	/* Reconcile RG bitmaps with fsck bitmap */
 	for(tmp = sbp->rglist.next; tmp != &sbp->rglist; tmp = tmp->next){
-		enum update_flags f;
-
 		if (skip_this_pass || fsck_abort) /* if asked to skip the rest */
 			return FSCK_OK;
 		log_info( _("Verifying Resource Group #%" PRIu64 "\n"), rg_count);
@@ -245,8 +241,8 @@ int pass5(struct gfs2_sbd *sbp)
 		}
 		rg_count++;
 		/* Compare the bitmaps and report the differences */
-		f = update_rgrp(sbp, rgd, count, rgbh, &rg);
-		gfs2_rgrp_relse(rgd, f, rgbh);
+		update_rgrp(sbp, rgd, count, rgbh, &rg);
+		gfs2_rgrp_relse(rgd, rgbh);
 		free(rgbh);
 	}
 	/* Fix up superblock info based on this - don't think there's
diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c
index a4c8cf7..169cf19 100644
--- a/gfs2/fsck/rgrepair.c
+++ b/gfs2/fsck/rgrepair.c
@@ -51,8 +51,7 @@ static void find_journaled_rgs(struct gfs2_sbd *sdp)
 		ip = sdp->md.journal[j];
 		jblocks = ip->i_di.di_size / sdp->sd_sb.sb_bsize;
 		for (b = 0; b < jblocks; b++) {
-			block_map(ip, b, &new, &dblock, &extlen, 0,
-				  not_updated);
+			block_map(ip, b, &new, &dblock, &extlen, 0);
 			if (!dblock)
 				break;
 			bh = bread(&sdp->buf_list, dblock);
@@ -61,7 +60,7 @@ static void find_journaled_rgs(struct gfs2_sbd *sdp)
 					  "0x%" PRIx64 "\n"), dblock);
 				gfs2_special_set(&false_rgrps, dblock);
 			}
-			brelse(bh, not_updated);
+			brelse(bh);
 		}
 	}
 }
@@ -163,7 +162,7 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
 			number_of_rgs++;
 			blk += 250; /* skip ahead for performance */
 		}
-		brelse(bh, not_updated);
+		brelse(bh);
 	}
 	number_of_rgs = 0;
 	gfs2_special_free(&false_rgrps);
@@ -209,7 +208,7 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
 		log_debug( _("Block 0x%" PRIx64 "\n"), blk);
 		bh = bread(&sdp->buf_list, blk);
 		rg_was_fnd = (!gfs2_check_meta(bh, GFS2_METATYPE_RG));
-		brelse(bh, not_updated);
+		brelse(bh);
 		/* Allocate a new RG and index. */
 		calc_rgd = malloc(sizeof(struct rgrp_list));
 		if (!calc_rgd) {
@@ -244,7 +243,7 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, osi_list_t *ret_list,
 			bh = bread(&sdp->buf_list, fwd_block);
 			bitmap_was_fnd =
 				(!gfs2_check_meta(bh, GFS2_METATYPE_RB));
-			brelse(bh, not_updated);
+			brelse(bh);
 			if (bitmap_was_fnd) /* if a bitmap */
 				calc_rgd->ri.ri_length++;
 			else
@@ -405,7 +404,8 @@ static int rewrite_rg_block(struct gfs2_sbd *sdp, struct rgrp_list *rgd,
 			rg->rg_free = rgd->ri.ri_data;
 			gfs2_rgrp_out(rg, rgbh[x]->b_data);
 		}
-		brelse(rgbh[x], updated);
+		bmodified(rgbh[x]);
+		brelse(rgbh[x]);
 		return 0;
 	}
 	return 1;
@@ -584,7 +584,7 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count)
 						 &rgrp);
 			}
 			else {
-				gfs2_rgrp_relse(rgd, not_updated, rgbh);
+				gfs2_rgrp_relse(rgd, rgbh);
 				free(rgbh);
 				break;
 			}
diff --git a/gfs2/libgfs2/buf.c b/gfs2/libgfs2/buf.c
index a12c19c..8997503 100644
--- a/gfs2/libgfs2/buf.c
+++ b/gfs2/libgfs2/buf.c
@@ -176,12 +176,15 @@ struct gfs2_buffer_head *bhold(struct gfs2_buffer_head *bh)
 	return bh;
 }
 
-void brelse(struct gfs2_buffer_head *bh, enum update_flags is_updated)
+void bmodified(struct gfs2_buffer_head *bh)
+{
+	bh->b_changed = 1;
+}
+
+void brelse(struct gfs2_buffer_head *bh)
 {
     /* We can't just say b_changed = updated because we don't want to     */
 	/* set it FALSE if it's TRUE until we write the changed data to disk. */
-	if (is_updated)
-		bh->b_changed = TRUE;
 	if (!bh->b_count) {
 		fprintf(stderr, "buffer count underflow for block %" PRIu64
 			" (0x%" PRIx64")\n", bh->b_blocknr, bh->b_blocknr);
diff --git a/gfs2/libgfs2/fs_bits.c b/gfs2/libgfs2/fs_bits.c
index 1f197b1..7c874ad 100644
--- a/gfs2/libgfs2/fs_bits.c
+++ b/gfs2/libgfs2/fs_bits.c
@@ -154,7 +154,8 @@ int gfs2_set_bitmap(struct gfs2_sbd *sdp, uint64_t blkno, int state)
 	*byte ^= cur_state << bit;
 	*byte |= state << bit;
 
-	gfs2_rgrp_relse(rgd, updated, rgbh);
+	bmodified(rgbh[buf]);
+	gfs2_rgrp_relse(rgd, rgbh);
 	free(rgbh);
 	return 0;
 }
@@ -217,7 +218,7 @@ int gfs2_get_bitmap(struct gfs2_sbd *sdp, uint64_t blkno,
 	}
 
 	if(i >= rgd->ri.ri_length){
-		gfs2_rgrp_relse(rgd, not_updated, rgbh);
+		gfs2_rgrp_relse(rgd, rgbh);
 		return -1;
 	}
 
@@ -227,7 +228,6 @@ int gfs2_get_bitmap(struct gfs2_sbd *sdp, uint64_t blkno,
 
 	val = ((*byte >> bit) & GFS2_BIT_MASK);
 	if(local_rgd)
-		gfs2_rgrp_relse(rgd, not_updated, rgbh);
-
+		gfs2_rgrp_relse(rgd, rgbh);
 	return val;
 }
diff --git a/gfs2/libgfs2/fs_geometry.c b/gfs2/libgfs2/fs_geometry.c
index dfdd7e7..f666459 100644
--- a/gfs2/libgfs2/fs_geometry.c
+++ b/gfs2/libgfs2/fs_geometry.c
@@ -220,7 +220,8 @@ void build_rgrps(struct gfs2_sbd *sdp, int do_write)
 					gfs2_meta_header_out(&mh, bh->b_data);
 				else
 					gfs2_rgrp_out(&rg, bh->b_data);
-				brelse(bh, updated);
+				bmodified(bh);
+				brelse(bh);
 			}
 		}
 
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index 7c44a8c..cef5d21 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -43,11 +43,11 @@ struct gfs2_inode *inode_get(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh)
 	return ip;
 }
 
-void inode_put(struct gfs2_inode *ip, enum update_flags is_updated)
+void inode_put(struct gfs2_inode *ip)
 {
-	if (is_updated)
+	if (ip->i_bh->b_changed)
 		gfs2_dinode_out(&ip->i_di, ip->i_bh->b_data);
-	brelse(ip->i_bh, is_updated);
+	brelse(ip->i_bh);
 	free(ip);
 }
 
@@ -100,7 +100,7 @@ static uint64_t blk_alloc_i(struct gfs2_sbd *sdp, unsigned int type)
 				bn++;
 			}
 
-		brelse(rgbh[block], FALSE);
+		brelse(rgbh[block]);
 	}
 
 	die("allocation is broken (1): %"PRIu64" %u\n",
@@ -130,11 +130,13 @@ found:
 	rg.rg_free--;
 	rl->rg_free--;
 
-	brelse(rgbh[block], updated);
+	bmodified(rgbh[block]);
+	brelse(rgbh[block]);
 
 	rgbh[0] = bread(&sdp->buf_list, ri->ri_addr);
 	gfs2_rgrp_out(&rg, rgbh[0]->b_data);
-	brelse(rgbh[0], updated);
+	bmodified(rgbh[0]);
+	brelse(rgbh[0]);
 
 	sdp->blks_alloced++;
 	free(rgbh);
@@ -167,6 +169,7 @@ static __inline__ void buffer_clear_tail(struct gfs2_sbd *sdp,
 					 struct gfs2_buffer_head *bh, int head)
 {
 	memset(bh->b_data + head, 0, sdp->bsize - head);
+	bmodified(bh);
 }
 
 static __inline__ void
@@ -178,6 +181,7 @@ buffer_copy_tail(struct gfs2_sbd *sdp,
 	       sdp->bsize - from_head);
 	memset(to_bh->b_data + sdp->bsize + to_head - from_head, 0,
 	       from_head - to_head);
+	bmodified(to_bh);
 }
 
 void unstuff_dinode(struct gfs2_inode *ip)
@@ -203,7 +207,8 @@ void unstuff_dinode(struct gfs2_inode *ip)
 					 sizeof(struct gfs2_meta_header),
 					 ip->i_bh, sizeof(struct gfs2_dinode));
 
-			brelse(bh, updated);
+			bmodified(bh);
+			brelse(bh);
 		} else {
 			block = data_alloc(ip);
 			bh = bget(&sdp->buf_list, block);
@@ -211,7 +216,8 @@ void unstuff_dinode(struct gfs2_inode *ip)
 			buffer_copy_tail(sdp, bh, 0,
 					 ip->i_bh, sizeof(struct gfs2_dinode));
 
-			brelse(bh, updated);
+			bmodified(bh);
+			brelse(bh);
 		}
 	}
 
@@ -280,7 +286,8 @@ void build_height(struct gfs2_inode *ip, int height)
 					 sizeof(struct gfs2_meta_header),
 					 ip->i_bh, sizeof(struct gfs2_dinode));
 
-			brelse(bh, updated);
+			bmodified(bh);
+			brelse(bh);
 		}
 
 		buffer_clear_tail(sdp, ip->i_bh, sizeof(struct gfs2_dinode));
@@ -337,14 +344,14 @@ void lookup_block(struct gfs2_inode *ip, struct gfs2_buffer_head *bh,
 		*block = meta_alloc(ip);
 
 	*ptr = cpu_to_be64(*block);
+	bmodified(bh);
 	ip->i_di.di_blocks++;
 
 	*new = 1;
 }
 
 void block_map(struct gfs2_inode *ip, uint64_t lblock, int *new,
-	       uint64_t *dblock, uint32_t *extlen, int prealloc,
-	       enum update_flags if_changed)
+	       uint64_t *dblock, uint32_t *extlen, int prealloc)
 {
 	struct gfs2_sbd *sdp = ip->i_sbd;
 	struct gfs2_buffer_head *bh;
@@ -386,7 +393,7 @@ void block_map(struct gfs2_inode *ip, uint64_t lblock, int *new,
 
 	for (x = 0; x < end_of_metadata; x++) {
 		lookup_block(ip, bh, x, mp, create, new, dblock);
-		brelse(bh, if_changed);
+		brelse(bh);
 		if (!*dblock)
 			goto out;
 
@@ -396,6 +403,7 @@ void block_map(struct gfs2_inode *ip, uint64_t lblock, int *new,
 			mh.mh_magic = GFS2_MAGIC;
 			mh.mh_type = GFS2_METATYPE_IN;
 			mh.mh_format = GFS2_FORMAT_IN;
+			bmodified(bh);
 			gfs2_meta_header_out(&mh, bh->b_data);
 		} else
 			bh = bread(&sdp->buf_list, *dblock);
@@ -426,7 +434,7 @@ void block_map(struct gfs2_inode *ip, uint64_t lblock, int *new,
 		}
 	}
 
-	brelse(bh, if_changed);
+	brelse(bh);
 
  out:
 	free(mp);
@@ -489,7 +497,7 @@ int gfs2_readi(struct gfs2_inode *ip, void *buf,
 
 		if (!extlen)
 			block_map(ip, lblock, &not_new, &dblock, &extlen,
-				  FALSE, not_updated);
+				  FALSE);
 
 		if (dblock) {
 			bh = bread(&sdp->buf_list, dblock);
@@ -500,7 +508,7 @@ int gfs2_readi(struct gfs2_inode *ip, void *buf,
 
 		copy2mem(bh, &buf, o, amount);
 		if (bh)
-			brelse(bh, not_updated);
+			brelse(bh);
 
 		copied += amount;
 		lblock++;
@@ -517,6 +525,7 @@ static void copy_from_mem(struct gfs2_buffer_head *bh, void **buf,
 	char **p = (char **)buf;
 
 	memcpy(bh->b_data + offset, *p, size);
+	bmodified(bh);
 	*p += size;
 }
 
@@ -562,8 +571,7 @@ int gfs2_writei(struct gfs2_inode *ip, void *buf,
 
 		if (!extlen) {
 			new = TRUE;
-			block_map(ip, lblock, &new, &dblock, &extlen, FALSE,
-				  updated);
+			block_map(ip, lblock, &new, &dblock, &extlen, FALSE);
 		}
 
 		if (new) {
@@ -578,7 +586,8 @@ int gfs2_writei(struct gfs2_inode *ip, void *buf,
 		} else
 			bh = bread(&sdp->buf_list, dblock);
 		copy_from_mem(bh, &buf, o, amount);
-		brelse(bh, updated);
+		bmodified(bh);
+		brelse(bh);
 
 		copied += amount;
 		lblock++;
@@ -604,7 +613,7 @@ struct gfs2_buffer_head *get_file_buf(struct gfs2_inode *ip, uint64_t lbn,
 	if (inode_is_stuffed(ip))
 		unstuff_dinode(ip);
 
-	block_map(ip, lbn, &new, &dbn, NULL, prealloc, updated);
+	block_map(ip, lbn, &new, &dbn, NULL, prealloc);
 	if (!dbn)
 		die("get_file_buf\n");
 
@@ -672,7 +681,7 @@ static int dirent_alloc(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
 	if (!entries) {
 		dent->de_rec_len = cpu_to_be16(dip->i_sbd->bsize - offset);
 		dent->de_name_len = cpu_to_be16(name_len);
-
+		bmodified(bh);
 		*dent_out = dent;
 		return 0;
 	}
@@ -701,12 +710,14 @@ static int dirent_alloc(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
 				dent->de_rec_len = cpu_to_be16(cur_rec_len - new_rec_len);
 
 				*dent_out = new;
+				bmodified(bh);
 				return 0;
 			}
 
 			dent->de_name_len = cpu_to_be16(name_len);
 
 			*dent_out = dent;
+			bmodified(bh);
 			return 0;
 		}
 	} while (gfs2_dirent_next(dip, bh, &dent) == 0);
@@ -719,6 +730,8 @@ void dirent2_del(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
 {
 	uint16_t cur_rec_len, prev_rec_len;
 
+	bmodified(bh);
+	bmodified(dip->i_bh);
 	if (dip->i_di.di_entries)
 		dip->i_di.di_entries--;
 	if (!prev) {
@@ -861,8 +874,9 @@ static void dir_split_leaf(struct gfs2_inode *dip, uint32_t lindex, uint64_t lea
 
 	dip->i_di.di_blocks++;
 
-	brelse(obh, not_updated);
-	brelse(nbh, updated);
+	brelse(obh);
+	bmodified(nbh);
+	brelse(nbh);
 }
 
 static void dir_double_exhash(struct gfs2_inode *dip)
@@ -926,7 +940,7 @@ int gfs2_get_leaf(struct gfs2_inode *dip, uint64_t leaf_no,
 		return error;
 	error = gfs2_check_meta(*bhp, GFS2_METATYPE_LF);
 	if(error)
-		brelse(*bhp, not_updated);
+		brelse(*bhp);
 	return error;
 }
 
@@ -998,18 +1012,18 @@ static void dir_e_add(struct gfs2_inode *dip, const char *filename, int len,
 		if (dirent_alloc(dip, bh, len, &dent)) {
 
 			if (be16_to_cpu(leaf->lf_depth) < dip->i_di.di_depth) {
-				brelse(bh, not_updated);
+				brelse(bh);
 				dir_split_leaf(dip, lindex, leaf_no);
 				goto restart;
 
 			} else if (dip->i_di.di_depth < GFS2_DIR_MAX_DEPTH) {
-				brelse(bh, not_updated);
+				brelse(bh);
 				dir_double_exhash(dip);
 				goto restart;
 
 			} else if (leaf->lf_next) {
 				leaf_no = be64_to_cpu(leaf->lf_next);
-				brelse(bh, not_updated);
+				brelse(bh);
 				continue;
 
 			} else {
@@ -1031,7 +1045,8 @@ static void dir_e_add(struct gfs2_inode *dip, const char *filename, int len,
 
 				dirent_alloc(dip, nbh, len, &dent);
 				dip->i_di.di_blocks++;
-				brelse(bh, updated);
+				bmodified(bh);
+				brelse(bh);
 				bh = nbh;
 				leaf = nleaf;
 			}
@@ -1045,10 +1060,11 @@ static void dir_e_add(struct gfs2_inode *dip, const char *filename, int len,
 		leaf->lf_entries = be16_to_cpu(leaf->lf_entries) + 1;
 		leaf->lf_entries = cpu_to_be16(leaf->lf_entries);
 
-		brelse(bh, updated);
+		bmodified(bh);
+		brelse(bh);
 
 		dip->i_di.di_entries++;
-
+		bmodified(dip->i_bh);
 		return;
 	}
 }
@@ -1094,7 +1110,8 @@ static void dir_make_exhash(struct gfs2_inode *dip)
 	dent->de_rec_len = cpu_to_be16(dent->de_rec_len +
 		sizeof(struct gfs2_dinode) - sizeof(struct gfs2_leaf));
 
-	brelse(bh, updated);
+	/* no need to: bmodified(bh); (buffer_copy_tail does it) */
+	brelse(bh);
 
 	buffer_clear_tail(sdp, dip->i_bh, sizeof(struct gfs2_dinode));
 
@@ -1107,6 +1124,7 @@ static void dir_make_exhash(struct gfs2_inode *dip)
 	dip->i_di.di_blocks++;
 	dip->i_di.di_flags |= GFS2_DIF_EXHASH;
 	dip->i_di.di_payload_format = 0;
+	/* no need: bmodified(dip->i_bh); buffer_clear_tail does it. */
 
 	for (x = sdp->sd_hash_ptrs, y = -1; x; x >>= 1, y++) ;
 	dip->i_di.di_depth = y;
@@ -1130,6 +1148,7 @@ static void dir_l_add(struct gfs2_inode *dip, const char *filename, int len,
 	memcpy((char *)(dent + 1), filename, len);
 
 	dip->i_di.di_entries++;
+	bmodified(dip->i_bh);
 }
 
 void dir_add(struct gfs2_inode *dip, const char *filename, int len,
@@ -1226,6 +1245,7 @@ struct gfs2_inode *createi(struct gfs2_inode *dip, const char *filename,
 
 		bh = init_dinode(sdp, &inum, mode, flags, &dip->i_di.di_num);
 		ip = inode_get(sdp, bh);
+		bmodified(bh);
 	}
 	return ip;
 }
@@ -1343,7 +1363,7 @@ static int linked_leaf_search(struct gfs2_inode *dip, const char *filename,
 	/*  Find the entry  */
 	do{
 		if (bh)
-			brelse(bh, not_updated);
+			brelse(bh);
 
 		bh = bh_next;
 		
@@ -1357,14 +1377,14 @@ static int linked_leaf_search(struct gfs2_inode *dip, const char *filename,
 			break;
 			
 		default:
-			brelse(bh, not_updated);
+			brelse(bh);
 			return error;
 		}
 		
 		error = get_next_leaf(dip, bh, &bh_next);
 	} while (!error);
 	
-	brelse(bh, not_updated);
+	brelse(bh);
 	
 	return error;
 }
@@ -1392,7 +1412,7 @@ static int dir_e_search(struct gfs2_inode *dip, const char *filename,
 	if (type)
 		*type = be16_to_cpu(dent->de_type);
 
-	brelse(bh, not_updated);
+	brelse(bh);
 
 	return 0;
 }
@@ -1423,7 +1443,7 @@ static int dir_l_search(struct gfs2_inode *dip, const char *filename,
 		if(type)
 			*type = be16_to_cpu(dent->de_type);
 	}
-	brelse(dibh, not_updated);
+	brelse(dibh);
 	return error;
 }
 
@@ -1475,11 +1495,11 @@ static int dir_e_del(struct gfs2_inode *dip, const char *filename, int len)
 			error = leaf_search(dip, bh, filename, len, &cur, &prev);
 			if (error) {
 				if(error != -ENOENT){
-					brelse(bh, updated);
+					brelse(bh);
 					return -1;
 				}
 				leaf_no = be64_to_cpu(((struct gfs2_leaf *)bh->b_data)->lf_next);
-				brelse(bh, updated);
+				brelse(bh);
 			} else
 				found = 1;
 		}
@@ -1490,7 +1510,7 @@ static int dir_e_del(struct gfs2_inode *dip, const char *filename, int len)
 
 	if (bh) {
 		dirent2_del(dip, bh, prev, cur);
-		brelse(bh, updated);
+		brelse(bh);
 	}
 	return 0;
 }
@@ -1514,7 +1534,7 @@ static int dir_l_del(struct gfs2_inode *dip, struct gfs2_buffer_head *dibh,
 	error = leaf_search(dip, dibh, filename, len, &cur, &prev);
 	if (error) {
 		if (got_buf)
-			brelse(dibh, not_updated);
+			brelse(dibh);
 		if (error == -ENOENT)
 			return 1;
 		else
@@ -1522,8 +1542,10 @@ static int dir_l_del(struct gfs2_inode *dip, struct gfs2_buffer_head *dibh,
 	}
 
 	dirent2_del(dip, dibh, prev, cur);
-	if (got_buf)
-		brelse(dibh, updated);
+	if (got_buf) {
+		bmodified(dibh);
+		brelse(dibh);
+	}
 	return 0;
 }
 
@@ -1550,7 +1572,7 @@ int gfs2_dirent_del(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
 		error = dir_e_del(dip, filename, len);
 	else
 		error = dir_l_del(dip, bh, filename, len);
-
+	bmodified(dip->i_bh);
 	return error;
 }
 
@@ -1605,7 +1627,8 @@ void gfs2_free_block(struct gfs2_sbd *sdp, uint64_t block)
 	rg.rg_free++; /* adjust the free count */
 	rgd->rg_free++;
 	gfs2_rgrp_out(&rg, bh->b_data); /* back to the buffer */
-	brelse(bh, updated); /* release the buffer */
+	bmodified(bh);
+	brelse(bh); /* release the buffer */
 }
 
 /**
@@ -1654,13 +1677,14 @@ int gfs2_freedi(struct gfs2_sbd *sdp, uint64_t diblock)
 				/* Read the next metadata block in the chain */
 				nbh = bread(&sdp->buf_list, block);
 				osi_list_add(&nbh->b_altlist, next_list);
-				brelse(nbh, not_updated);
+				brelse(nbh);
 			}
 		}
 	}
 	/* Set the bitmap type for inode to free space: */
 	gfs2_set_bitmap(sdp, ip->i_di.di_num.no_addr, GFS2_BLKST_FREE);
-	inode_put(ip, updated);
+	bmodified(ip->i_bh);
+	inode_put(ip);
 	/* Now we have to adjust the rg freespace count and inode count: */
 	rgd = gfs2_blk2rgrpd(sdp, diblock);
 	bh = bread(&sdp->buf_list, rgd->ri.ri_addr); /* get the buffer */
@@ -1669,6 +1693,7 @@ int gfs2_freedi(struct gfs2_sbd *sdp, uint64_t diblock)
 	rgd->rg_free++;
 	rg.rg_dinodes--; /* one less inode in use */
 	gfs2_rgrp_out(&rg, bh->b_data);
-	brelse(bh, updated); /* release the buffer */
+	bmodified(bh);
+	brelse(bh); /* release the buffer */
 	return 0;
 }
diff --git a/gfs2/libgfs2/gfs1.c b/gfs2/libgfs2/gfs1.c
index eb266a5..2b0dd8d 100644
--- a/gfs2/libgfs2/gfs1.c
+++ b/gfs2/libgfs2/gfs1.c
@@ -70,9 +70,7 @@ void gfs1_block_map(struct gfs2_inode *ip, uint64_t lblock, int *new,
 	unsigned int height;
 	unsigned int end_of_metadata;
 	unsigned int x;
-	enum update_flags f;
 
-	f = not_updated;
 	*new = 0;
 	*dblock = 0;
 	if (extlen)
@@ -104,7 +102,7 @@ void gfs1_block_map(struct gfs2_inode *ip, uint64_t lblock, int *new,
 
 	for (x = 0; x < end_of_metadata; x++) {
 		gfs1_lookup_block(ip, bh, x, mp, create, new, dblock);
-		brelse(bh, f);
+		brelse(bh);
 		if (!*dblock)
 			goto out;
 
@@ -116,10 +114,9 @@ void gfs1_block_map(struct gfs2_inode *ip, uint64_t lblock, int *new,
 			mh.mh_type = GFS2_METATYPE_IN;
 			mh.mh_format = GFS2_FORMAT_IN;
 			gfs2_meta_header_out(&mh, bh->b_data);
-			f = updated;
+			bmodified(bh);
 		} else {
 			bh = bread(&sdp->buf_list, *dblock);
-			f = not_updated;
 		}
 	}
 
@@ -150,7 +147,7 @@ void gfs1_block_map(struct gfs2_inode *ip, uint64_t lblock, int *new,
 		}
 	}
 
-	brelse(bh, f);
+	brelse(bh);
 
  out:
 	free(mp);
@@ -210,7 +207,7 @@ int gfs1_readi(struct gfs2_inode *ip, void *bufin,
 
 		if (bh) {
 			memcpy(buf+copied, bh->b_data + offset, amount);
-			brelse(bh, not_updated);
+			brelse(bh);
 		} else
 			memset(buf+copied, 0, amount);
 		copied += amount;
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 524c10b..0428481 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -271,20 +271,6 @@ struct metapath {
 #define META (2)
 #define DINODE (3)
 
-#define NOT_UPDATED (0)
-#define UPDATED (1)
-
-/* A bit of explanation is in order: */
-/* updated flag means the buffer was updated from THIS function before */
-/*         brelse was called. */
-/* not_updated flag means the buffer may or may not have been updated  */
-/*         by a function called within this one, but it wasn't updated */
-/*         by this function. */
-enum update_flags {
-	not_updated = NOT_UPDATED,
-	updated = UPDATED
-};
-
 /* bitmap.c */
 struct gfs2_bmap {
         uint64_t size;
@@ -369,7 +355,8 @@ extern struct gfs2_buffer_head *__bget(struct buf_list *bl, uint64_t num,
 extern struct gfs2_buffer_head *__bread(struct buf_list *bl, uint64_t num,
 					int line, const char *caller);
 extern struct gfs2_buffer_head *bhold(struct gfs2_buffer_head *bh);
-extern void brelse(struct gfs2_buffer_head *bh, enum update_flags is_updated);
+extern void bmodified(struct gfs2_buffer_head *bh);
+extern void brelse(struct gfs2_buffer_head *bh);
 extern void __bsync(struct buf_list *bl, int line, const char *caller);
 extern void __bcommit(struct buf_list *bl, int line, const char *caller);
 
@@ -421,7 +408,7 @@ extern void lookup_block(struct gfs2_inode *ip, struct gfs2_buffer_head *bh,
 			 int create, int *new, uint64_t *block);
 extern struct gfs2_inode *inode_get(struct gfs2_sbd *sdp,
 				    struct gfs2_buffer_head *bh);
-extern void inode_put(struct gfs2_inode *ip, enum update_flags updated);
+extern void inode_put(struct gfs2_inode *ip);
 extern uint64_t data_alloc(struct gfs2_inode *ip);
 extern uint64_t meta_alloc(struct gfs2_inode *ip);
 extern uint64_t dinode_alloc(struct gfs2_sbd *sdp);
@@ -447,8 +434,7 @@ extern void dir_add(struct gfs2_inode *dip, const char *filename, int len,
 extern int gfs2_dirent_del(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
 			   const char *filename, int filename_len);
 extern void block_map(struct gfs2_inode *ip, uint64_t lblock, int *new,
-		      uint64_t *dblock, uint32_t *extlen, int prealloc,
-		      enum update_flags if_changed);
+		      uint64_t *dblock, uint32_t *extlen, int prealloc);
 extern void gfs2_get_leaf_nr(struct gfs2_inode *dip, uint32_t index,
 			     uint64_t *leaf_out);
 extern void gfs2_put_leaf_nr(struct gfs2_inode *dip, uint32_t inx, uint64_t leaf_out);
@@ -651,8 +637,8 @@ extern struct rgrp_list *gfs2_blk2rgrpd(struct gfs2_sbd *sdp, uint64_t blk);
 extern uint64_t gfs2_rgrp_read(struct gfs2_sbd *sdp, struct rgrp_list *rgd,
 			       struct gfs2_buffer_head **bh,
 			       struct gfs2_rgrp *rg);
-extern void gfs2_rgrp_relse(struct rgrp_list *rgd, enum update_flags updated,
-		     struct gfs2_buffer_head **bh);
+extern void gfs2_rgrp_relse(struct rgrp_list *rgd,
+			    struct gfs2_buffer_head **bh);
 extern void gfs2_rgrp_free(osi_list_t *rglist);
 
 /* structures.c */
diff --git a/gfs2/libgfs2/recovery.c b/gfs2/libgfs2/recovery.c
index b10fe77..03c1703 100644
--- a/gfs2/libgfs2/recovery.c
+++ b/gfs2/libgfs2/recovery.c
@@ -27,7 +27,7 @@ int gfs2_replay_read_block(struct gfs2_inode *ip, unsigned int blk,
 	uint64_t dblock;
 	uint32_t extlen;
 
-	block_map(ip, blk, &new, &dblock, &extlen, FALSE, not_updated);
+	block_map(ip, blk, &new, &dblock, &extlen, FALSE);
 	if (!dblock)
 		return -EIO;
 
@@ -67,7 +67,7 @@ int get_log_header(struct gfs2_inode *ip, unsigned int blk,
 	hash = gfs2_disk_hash(bh->b_data, sizeof(struct gfs2_log_header));
 	tmp->lh_hash = saved_hash;
 	gfs2_log_header_in(&lh, bh->b_data);
-	brelse(bh, not_updated);
+	brelse(bh);
 
 	if (error || lh.lh_blkno != blk || lh.lh_hash != hash)
 		return 1;
@@ -219,7 +219,7 @@ int clean_journal(struct gfs2_inode *ip, struct gfs2_log_header *head)
 
 	lblock = head->lh_blkno;
 	gfs2_replay_incr_blk(ip, &lblock);
-	block_map(ip, lblock, &new, &dblock, &extlen, 0, not_updated);
+	block_map(ip, lblock, &new, &dblock, &extlen, 0);
 	if (!dblock)
 		return -EIO;
 
@@ -236,8 +236,8 @@ int clean_journal(struct gfs2_inode *ip, struct gfs2_log_header *head)
 	lh->lh_blkno = cpu_to_be32(lblock);
 	hash = gfs2_disk_hash((const char *)lh, sizeof(struct gfs2_log_header));
 	lh->lh_hash = cpu_to_be32(hash);
-
-	brelse(bh, updated);
+	bmodified(bh);
+	brelse(bh);
 
 	return 0;
 }
diff --git a/gfs2/libgfs2/rgrp.c b/gfs2/libgfs2/rgrp.c
index 21c7033..1e10200 100644
--- a/gfs2/libgfs2/rgrp.c
+++ b/gfs2/libgfs2/rgrp.c
@@ -120,7 +120,7 @@ uint64_t gfs2_rgrp_read(struct gfs2_sbd *sdp, struct rgrp_list *rgd,
 
 			error = rgd->ri.ri_addr + x;
 			for (; x >= 0; x--)
-				brelse(bh[x], not_updated);
+				brelse(bh[x]);
 			return error;
 		}
 	}
@@ -130,13 +130,12 @@ uint64_t gfs2_rgrp_read(struct gfs2_sbd *sdp, struct rgrp_list *rgd,
 	return 0;
 }
 
-void gfs2_rgrp_relse(struct rgrp_list *rgd, enum update_flags is_updated,
-		     struct gfs2_buffer_head **bh)
+void gfs2_rgrp_relse(struct rgrp_list *rgd, struct gfs2_buffer_head **bh)
 {
 	int x, length = rgd->ri.ri_length;
 
 	for (x = 0; x < length; x++)
-		brelse(bh[x], is_updated);
+		brelse(bh[x]);
 }
 
 void gfs2_rgrp_free(osi_list_t *rglist)
diff --git a/gfs2/libgfs2/structures.c b/gfs2/libgfs2/structures.c
index 97c56b8..02a512e 100644
--- a/gfs2/libgfs2/structures.c
+++ b/gfs2/libgfs2/structures.c
@@ -43,7 +43,8 @@ void build_sb(struct gfs2_sbd *sdp, const unsigned char *uuid)
 	for (x = 0; x < sdp->sb_addr; x++) {
 		bh = bget(&sdp->buf_list, x);
 		memset(bh->b_data, 0, sdp->bsize);
-		brelse(bh, updated);
+		bmodified(bh);
+		brelse(bh);
 	}
 
 	memset(&sb, 0, sizeof(struct gfs2_sb));
@@ -63,7 +64,8 @@ void build_sb(struct gfs2_sbd *sdp, const unsigned char *uuid)
 #endif
 	bh = bget(&sdp->buf_list, sdp->sb_addr);
 	gfs2_sb_out(&sb, bh->b_data);
-	brelse(bh, updated);
+	bmodified(bh);
+	brelse(bh);
 
 	if (sdp->debug) {
 		printf("\nSuper Block:\n");
@@ -95,7 +97,8 @@ int write_journal(struct gfs2_sbd *sdp, struct gfs2_inode *ip, unsigned int j,
 		struct gfs2_buffer_head *bh = get_file_buf(ip, x, TRUE);
 		if (!bh)
 			return -1;
-		brelse(bh, updated);
+		bmodified(bh);
+		brelse(bh);
 	}
 	for (x = 0; x < blocks; x++) {
 		struct gfs2_buffer_head *bh = get_file_buf(ip, x, FALSE);
@@ -108,7 +111,8 @@ int write_journal(struct gfs2_sbd *sdp, struct gfs2_inode *ip, unsigned int j,
 		hash = gfs2_disk_hash(bh->b_data, sizeof(struct gfs2_log_header));
 		((struct gfs2_log_header *)bh->b_data)->lh_hash = cpu_to_be32(hash);
 
-		brelse(bh, updated);
+		bmodified(bh);
+		brelse(bh);
 
 		if (++seq == blocks)
 			seq = 0;
@@ -140,7 +144,8 @@ int build_jindex(struct gfs2_sbd *sdp)
 			      sdp->jsize << 20 >> sdp->sd_sb.sb_bsize_shift);
 		if (ret)
 			return ret;
-		inode_put(ip, updated);
+		bmodified(ip->i_bh);
+		inode_put(ip);
 	}
 
 	if (sdp->debug) {
@@ -148,7 +153,8 @@ int build_jindex(struct gfs2_sbd *sdp)
 		gfs2_dinode_print(&jindex->i_di);
 	}
 
-	inode_put(jindex, updated);
+	bmodified(jindex->i_bh);
+	inode_put(jindex);
 	return 0;
 }
 
@@ -168,7 +174,8 @@ static int build_inum_range(struct gfs2_inode *per_node, unsigned int j)
 		gfs2_dinode_print(&ip->i_di);
 	}
 
-	inode_put(ip, updated);
+	bmodified(ip->i_bh);
+	inode_put(ip);
 	return 0;
 }
 
@@ -188,7 +195,8 @@ static void build_statfs_change(struct gfs2_inode *per_node, unsigned int j)
 		gfs2_dinode_print(&ip->i_di);
 	}
 
-	inode_put(ip, updated);
+	bmodified(ip->i_bh);
+	inode_put(ip);
 }
 
 static int build_quota_change(struct gfs2_inode *per_node, unsigned int j)
@@ -216,7 +224,8 @@ static int build_quota_change(struct gfs2_inode *per_node, unsigned int j)
 
 		gfs2_meta_header_out(&mh, bh->b_data);
 
-		brelse(bh, updated);
+		bmodified(bh);
+		brelse(bh);
 	}
 
 	if (sdp->debug) {
@@ -224,7 +233,8 @@ static int build_quota_change(struct gfs2_inode *per_node, unsigned int j)
 		gfs2_dinode_print(&ip->i_di);
 	}
 
-	inode_put(ip, updated);
+	bmodified(ip->i_bh);
+	inode_put(ip);
 	return 0;
 }
 
@@ -247,7 +257,8 @@ int build_per_node(struct gfs2_sbd *sdp)
 		gfs2_dinode_print(&per_node->i_di);
 	}
 
-	inode_put(per_node, updated);
+	bmodified(per_node->i_bh);
+	inode_put(per_node);
 	return 0;
 }
 
@@ -313,7 +324,8 @@ int build_rindex(struct gfs2_sbd *sdp)
 		gfs2_dinode_print(&ip->i_di);
 	}
 
-	inode_put(ip, updated);
+	bmodified(ip->i_bh);
+	inode_put(ip);
 	return 0;
 }
 
@@ -344,7 +356,8 @@ int build_quota(struct gfs2_sbd *sdp)
 		gfs2_quota_print(&qu);
 	}
 
-	inode_put(ip, updated);
+	bmodified(ip->i_bh);
+	inode_put(ip);
 	return 0;
 }
 
@@ -468,11 +481,11 @@ int gfs2_next_rg_meta(struct gfs2_sbd *sdp, struct rgrp_list *rgd,
 				  GFS2_BLKST_DINODE);
 		if(blk != BFITNOENT){
 			*block = blk + (bits->bi_start * GFS2_NBBY) + rgd->ri.ri_data0;
-			brelse(bh, not_updated);
+			brelse(bh);
 			break;
 		}
 		blk=0;
-		brelse(bh, not_updated);
+		brelse(bh);
 	}
 	if(i == length)
 		return -1;
@@ -495,12 +508,12 @@ int gfs2_next_rg_metatype(struct gfs2_sbd *sdp, struct rgrp_list *rgd,
 
 	do{
 		if (bh)
-			brelse(bh, not_updated);
+			brelse(bh);
 		if (gfs2_next_rg_meta(sdp, rgd, block, first))
 			return -1;
 		bh = bread(&sdp->buf_list, *block);
 		first = 0;
 	} while(gfs2_check_meta(bh, type));
-	brelse(bh, not_updated);
+	brelse(bh);
 	return 0;
 }
diff --git a/gfs2/libgfs2/super.c b/gfs2/libgfs2/super.c
index 7aeeaa7..67eb77a 100644
--- a/gfs2/libgfs2/super.c
+++ b/gfs2/libgfs2/super.c
@@ -60,7 +60,7 @@ int read_sb(struct gfs2_sbd *sdp)
 
 	bh = bread(&sdp->buf_list, GFS2_SB_ADDR >> sdp->sd_fsb2bb_shift);
 	gfs2_sb_in(&sdp->sd_sb, bh->b_data);
-	brelse(bh, not_updated);
+	brelse(bh);
 
 	error = check_sb(&sdp->sd_sb);
 	if (error)
@@ -248,16 +248,13 @@ int ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount)
 	}
 
 	for (tmp = sdp->rglist.next; tmp != &sdp->rglist; tmp = tmp->next) {
-		enum update_flags f;
-
-		f = not_updated;
 		rgd = osi_list_entry(tmp, struct rgrp_list, list);
 		errblock = gfs2_rgrp_read(sdp, rgd, rgbh, &rg);
 		if (errblock) {
 			free(rgbh);
 			return errblock;
 		} else
-			gfs2_rgrp_relse(rgd, f, rgbh);
+			gfs2_rgrp_relse(rgd, rgbh);
 		count2++;
 	}
 
@@ -280,7 +277,8 @@ int write_sb(struct gfs2_sbd *sbp)
 
 	bh = bread(&sbp->buf_list, GFS2_SB_ADDR >> sbp->sd_fsb2bb_shift);
 	gfs2_sb_out(&sbp->sd_sb, bh->b_data);
-	brelse(bh, updated);
+	bmodified(bh);
+	brelse(bh);
 	bcommit(&sbp->buf_list); /* make sure the change gets to disk ASAP */
 	return 0;
 }
diff --git a/gfs2/mkfs/main_grow.c b/gfs2/mkfs/main_grow.c
index 10d9731..52b8c38 100644
--- a/gfs2/mkfs/main_grow.c
+++ b/gfs2/mkfs/main_grow.c
@@ -170,8 +170,8 @@ static void initialize_new_portion(struct gfs2_sbd *sdp, int *old_rg_count)
 	/* Note: We do inode_put with not_updated because we only updated */
 	/* the new RGs/bitmaps themselves on disk.  The rindex file must  */
 	/* be updated through the meta_fs so the gfs2 kernel is informed. */
-	inode_put(sdp->md.riinode, not_updated);
-	inode_put(sdp->master_dir, not_updated);
+	inode_put(sdp->md.riinode);
+	inode_put(sdp->master_dir);
 
 	/* We're done with the libgfs portion, so commit it to disk.      */
 	bsync(&sdp->buf_list);
diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c
index cb6a3cc..6ebaa99 100644
--- a/gfs2/mkfs/main_mkfs.c
+++ b/gfs2/mkfs/main_mkfs.c
@@ -637,10 +637,14 @@ void main_mkfs(int argc, char *argv[])
 
 	/* Cleanup */
 
-	inode_put(sdp->md.rooti, updated);
-	inode_put(sdp->master_dir, updated);
-	inode_put(sdp->md.inum, updated);
-	inode_put(sdp->md.statfs, updated);
+	bmodified(sdp->md.rooti->i_bh);
+	inode_put(sdp->md.rooti);
+	bmodified(sdp->master_dir->i_bh);
+	inode_put(sdp->master_dir);
+	bmodified(sdp->md.inum->i_bh);
+	inode_put(sdp->md.inum);
+	bmodified(sdp->md.statfs->i_bh);
+	inode_put(sdp->md.statfs);
 	bsync(&sdp->buf_list);
 
 	error = fsync(sdp->device_fd);


More information about the cluster-commits mailing list