All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups
@ 2018-03-05 18:25 Andrew Price
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 01/20] libgfs2: Remove unused lock* fields from gfs2_sbd Andrew Price
                   ` (20 more replies)
  0 siblings, 21 replies; 26+ messages in thread
From: Andrew Price @ 2018-03-05 18:25 UTC (permalink / raw)
  To: cluster-devel.redhat.com

This is an accumulation of yak shaving patches and cleanups that I want to get out of the way. There shouldn't be anything controversial here. The main theme is to make it easier to use libgfs2 without using gfs2_buffer_heads, and it gets rid of some 'dummy_bh' uses.

Andrew Price (20):
  libgfs2: Remove unused lock* fields from gfs2_sbd
  libgfs2: Remove sb_addr from gfs2_sbd
  libgfs2: Plug an alignment hole in gfs2_sbd
  libgfs2: Plug an alignment hole in gfs2_buffer_head
  libgfs2: Plug an alignment hole in gfs2_inode
  libgfs2: Remove gfs2_meta_header_out_bh()
  libgfs2: Don't pass an extlen to block_map where not required
  libgfs2: Don't use a buffer_head in gfs2_meta_header_in
  libgfs2: Don't use buffer_heads in gfs2_sb_in
  libgfs2: Don't use buffer_heads in gfs2_rgrp_in
  libgfs2: Remove gfs2_rgrp_out_bh
  libgfs2: Don't use buffer_heads in gfs2_dinode_in
  libgfs2: Remove gfs2_dinode_out_bh
  libgfs2: Don't use buffer_heads in gfs2_leaf_{in,out}
  libgfs2: Don't use buffer_heads in gfs2_log_header_in
  libgfs2: Remove gfs2_log_header_out_bh
  libgfs2: Don't use buffer_heads in gfs2_log_descriptor_{in,out}
  libgfs2: Don't use buffer_heads in gfs2_quota_change_{in,out}
  libgfs2: Fix two unused variable warnings
  mkfs.gfs2: Silence an integer overflow warning

 gfs2/convert/gfs2_convert.c |  25 ++++++----
 gfs2/edit/extended.c        |   2 +-
 gfs2/edit/gfs2hex.c         |  22 ++++-----
 gfs2/edit/hexedit.c         |  19 +++----
 gfs2/edit/journal.c         |  29 +++++------
 gfs2/edit/savemeta.c        |  26 +++++-----
 gfs2/fsck/fs_recovery.c     |  10 ++--
 gfs2/fsck/fsck.h            |   4 +-
 gfs2/fsck/initialize.c      |  10 ++--
 gfs2/fsck/lost_n_found.c    |   2 +-
 gfs2/fsck/metawalk.c        |  13 +++--
 gfs2/fsck/pass1.c           |   4 +-
 gfs2/fsck/pass2.c           |   6 +--
 gfs2/fsck/pass5.c           |   2 +-
 gfs2/fsck/rgrepair.c        |  39 +++++++--------
 gfs2/glocktop/glocktop.c    |   2 +-
 gfs2/libgfs2/fs_bits.c      |   2 +-
 gfs2/libgfs2/fs_geometry.c  |   5 +-
 gfs2/libgfs2/fs_ops.c       |  46 ++++++++++-------
 gfs2/libgfs2/gfs1.c         |  16 +++---
 gfs2/libgfs2/lang.c         |   2 +-
 gfs2/libgfs2/libgfs2.h      |  46 ++++++-----------
 gfs2/libgfs2/misc.c         |   2 -
 gfs2/libgfs2/ondisk.c       | 118 +++++++++++++++++---------------------------
 gfs2/libgfs2/recovery.c     |   9 ++--
 gfs2/libgfs2/rgrp.c         |   2 +-
 gfs2/libgfs2/structures.c   |  13 ++---
 gfs2/libgfs2/super.c        |   3 +-
 gfs2/mkfs/main_jadd.c       |   8 ++-
 gfs2/mkfs/main_mkfs.c       |   6 +--
 30 files changed, 229 insertions(+), 264 deletions(-)

-- 
2.14.3



^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Cluster-devel] [PATCH 01/20] libgfs2: Remove unused lock* fields from gfs2_sbd
  2018-03-05 18:25 [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Andrew Price
@ 2018-03-05 18:25 ` Andrew Price
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 02/20] libgfs2: Remove sb_addr " Andrew Price
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 26+ messages in thread
From: Andrew Price @ 2018-03-05 18:25 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 gfs2/libgfs2/libgfs2.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 15d2a9d1..641cac24 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -256,8 +256,6 @@ struct master_dir
 
 struct gfs2_sbd {
 	struct gfs2_sb sd_sb;    /* a copy of the ondisk structure */
-	char lockproto[GFS2_LOCKNAME_LEN];
-	char locktable[GFS2_LOCKNAME_LEN];
 
 	unsigned int bsize;	     /* The block size of the FS (in bytes) */
 	unsigned int jsize;	     /* Size of journals (in MB) */
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Cluster-devel] [PATCH 02/20] libgfs2: Remove sb_addr from gfs2_sbd
  2018-03-05 18:25 [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Andrew Price
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 01/20] libgfs2: Remove unused lock* fields from gfs2_sbd Andrew Price
@ 2018-03-05 18:25 ` Andrew Price
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 03/20] libgfs2: Plug an alignment hole in gfs2_sbd Andrew Price
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 26+ messages in thread
From: Andrew Price @ 2018-03-05 18:25 UTC (permalink / raw)
  To: cluster-devel.redhat.com

The sb address is constant so we can just shift it to the fs block size.

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 gfs2/convert/gfs2_convert.c |  2 +-
 gfs2/edit/hexedit.c         |  4 ++--
 gfs2/edit/savemeta.c        |  2 +-
 gfs2/fsck/fs_recovery.c     |  2 +-
 gfs2/fsck/fsck.h            |  4 ++--
 gfs2/fsck/pass1.c           |  2 +-
 gfs2/fsck/rgrepair.c        | 20 ++++++++++----------
 gfs2/libgfs2/fs_bits.c      |  2 +-
 gfs2/libgfs2/lang.c         |  2 +-
 gfs2/libgfs2/libgfs2.h      |  3 +--
 gfs2/libgfs2/misc.c         |  2 --
 gfs2/libgfs2/super.c        |  1 -
 gfs2/mkfs/main_mkfs.c       |  4 ++--
 13 files changed, 23 insertions(+), 27 deletions(-)

diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index d5e98e6c..4b18c770 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -2343,7 +2343,7 @@ int main(int argc, char **argv)
 		/* end because if the tool is interrupted in the middle, we want */
 		/* it to not reject the partially converted fs as already done   */
 		/* when it's run a second time.                                  */
-		bh = bread(&sb2, sb2.sb_addr);
+		bh = bread(&sb2, LGFS2_SB_ADDR(&sb2));
 		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);
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index b67fde2d..96001187 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -1708,7 +1708,7 @@ static void find_print_block_rg(int bitmap)
 	struct rgrp_tree *rgd;
 
 	rblock = blockstack[blockhist % BLOCK_STACK_SIZE].block;
-	if (rblock == sbd.sb_addr)
+	if (rblock == LGFS2_SB_ADDR(&sbd))
 		printf("0 (the superblock is not in the bitmap)\n");
 	else {
 		rgd = gfs2_blk2rgrpd(&sbd, rblock);
@@ -1762,7 +1762,7 @@ static void find_change_block_alloc(int *newval)
 		exit(-1);
 	}
 	ablock = blockstack[blockhist % BLOCK_STACK_SIZE].block;
-	if (ablock == sbd.sb_addr)
+	if (ablock == LGFS2_SB_ADDR(&sbd))
 		printf("3 (the superblock is not in the bitmap)\n");
 	else {
 		rgd = gfs2_blk2rgrpd(&sbd, ablock);
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 664484f2..a15fcf22 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -470,7 +470,7 @@ static int save_block(int fd, struct metafd *mfd, uint64_t blk, uint64_t owner,
 	struct gfs2_buffer_head *savebh;
 	int err;
 
-	if (gfs2_check_range(&sbd, blk) && blk != sbd.sb_addr) {
+	if (gfs2_check_range(&sbd, blk) && blk != LGFS2_SB_ADDR(&sbd)) {
 		fprintf(stderr, "\nWarning: bad block pointer '0x%llx' "
 			"ignored in block (block %llu (0x%llx))",
 			(unsigned long long)blk,
diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c
index 775c27b6..7284868b 100644
--- a/gfs2/fsck/fs_recovery.c
+++ b/gfs2/fsck/fs_recovery.c
@@ -626,7 +626,7 @@ reinit:
  * through initialization properly yet. */
 static int rangecheck_jblock(struct gfs2_inode *ip, uint64_t block)
 {
-	if((block > ip->i_sbd->fssize) || (block <= ip->i_sbd->sb_addr)) {
+	if((block > ip->i_sbd->fssize) || (block <= LGFS2_SB_ADDR(ip->i_sbd))) {
 		log_info( _("Bad block pointer (out of range) found in "
 			    "journal inode %lld (0x%llx).\n"),
 			  (unsigned long long)ip->i_di.di_num.no_addr,
diff --git a/gfs2/fsck/fsck.h b/gfs2/fsck/fsck.h
index 8af4eb41..d3f76352 100644
--- a/gfs2/fsck/fsck.h
+++ b/gfs2/fsck/fsck.h
@@ -166,7 +166,7 @@ extern struct gfs_sb *sbd1;
 
 static inline int valid_block(struct gfs2_sbd *sdp, uint64_t blkno)
 {
-	return !((blkno > sdp->fssize) || (blkno <= sdp->sb_addr) ||
+	return !((blkno > sdp->fssize) || (blkno <= LGFS2_SB_ADDR(sdp)) ||
 	         (lgfs2_get_bitmap(sdp, blkno, NULL) < 0));
 }
 
@@ -186,7 +186,7 @@ static inline int valid_block_ip(struct gfs2_inode *ip, uint64_t blk)
 
 	if (blk > sdp->fssize)
 		return 0;
-	if (blk <= sdp->sb_addr)
+	if (blk <= LGFS2_SB_ADDR(sdp))
 		return 0;
 	if (rgd == NULL || !rgrp_contains_block(rgd, blk)) {
 		rgd = gfs2_blk2rgrpd(sdp, blk);
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index 6dd115f1..87fab9ae 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -1569,7 +1569,7 @@ static void check_i_goal(struct gfs2_sbd *sdp, struct gfs2_inode *ip)
 	if (sdp->gfs1 || ip->i_di.di_flags & GFS2_DIF_SYSTEM)
 		return;
 
-	if (ip->i_di.di_goal_meta <= sdp->sb_addr ||
+	if (ip->i_di.di_goal_meta <= LGFS2_SB_ADDR(sdp) ||
 	    ip->i_di.di_goal_meta > sdp->fssize) {
 		log_err(_("Inode #%llu (0x%llx): Bad allocation goal block "
 			  "found: %llu (0x%llx)\n"),
diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c
index 6d5619af..f15266e0 100644
--- a/gfs2/fsck/rgrepair.c
+++ b/gfs2/fsck/rgrepair.c
@@ -116,13 +116,13 @@ static int find_shortest_rgdist(struct gfs2_sbd *sdp, uint64_t *dist_array,
 	find_journaled_rgs(sdp);
 
 	initial_first_rg_dist = dist_array[0] = block_last_rg =
-		sdp->sb_addr + 1;
+		LGFS2_SB_ADDR(sdp) + 1;
 	shortest_dist_btwn_rgs = sdp->device.length;
 
-	for (blk = sdp->sb_addr + 1; blk < sdp->device.length; blk++) {
+	for (blk = LGFS2_SB_ADDR(sdp) + 1; blk < sdp->device.length; blk++) {
 		uint64_t dist;
 
-		if (blk == sdp->sb_addr + 1)
+		if (blk == LGFS2_SB_ADDR(sdp) + 1)
 			is_rgrp = 1;
 		else if (is_false_rg(blk))
 			is_rgrp = 0;
@@ -187,7 +187,7 @@ static int find_shortest_rgdist(struct gfs2_sbd *sdp, uint64_t *dist_array,
 		log_info(_("segment %d: rgrp found at block 0x%llx\n"),
 			 gsegment + 1, (unsigned long long)blk);
 		dist = blk - block_last_rg;
-		if (blk > sdp->sb_addr + 1) { /* not the very first rgrp */
+		if (blk > LGFS2_SB_ADDR(sdp) + 1) { /* not the very first rgrp */
 
 			log_info("dist 0x%llx = 0x%llx - 0x%llx ",
 				 (unsigned long long)dist,
@@ -245,9 +245,9 @@ static int find_shortest_rgdist(struct gfs2_sbd *sdp, uint64_t *dist_array,
 			   sizeof(struct gfs2_rindex),
 			   sizeof(struct gfs2_rindex));
 		gfs2_rindex_in(&tmpndx, (char *)&buf);
-		if (tmpndx.ri_addr > sdp->sb_addr + 1) { /* sanity check */
+		if (tmpndx.ri_addr > LGFS2_SB_ADDR(sdp) + 1) { /* sanity check */
 			log_warn( _("rgrp 2 is damaged: getting dist from index: "));
-			*dist_array = tmpndx.ri_addr - (sdp->sb_addr + 1);
+			*dist_array = tmpndx.ri_addr - (LGFS2_SB_ADDR(sdp) + 1);
 			log_warn("0x%llx\n", (unsigned long long)*dist_array);
 		} else {
 			log_warn( _("rgrp index 2 is damaged: extrapolating dist: "));
@@ -558,7 +558,7 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, int *num_rgs,
 	/* -------------------------------------------------------------- */
 	prev_rgd = NULL;
 	block_bump = rg_dist[0];
-	blk = sdp->sb_addr + 1;
+	blk = LGFS2_SB_ADDR(sdp) + 1;
 	while (blk <= sdp->device.length) {
 		log_debug( _("Block 0x%llx\n"), (unsigned long long)blk);
 		bh = bread(sdp, blk);
@@ -631,7 +631,7 @@ static int gfs2_rindex_rebuild(struct gfs2_sbd *sdp, int *num_rgs,
 		/*
 		 * Figure out where our next rgrp should be.
 		 */
-		if ((blk == sdp->sb_addr + 1) || (!gfs_grow)) {
+		if ((blk == LGFS2_SB_ADDR(sdp) + 1) || (!gfs_grow)) {
 			block_bump = rg_dist[segment];
 			if (segment_rgs >= rg_dcnt[segment]) {
 				log_debug(_("End of segment %d\n"), ++segment);
@@ -772,7 +772,7 @@ static void compute_rgrp_layout(struct gfs2_sbd *sdp, struct osi_root *rgtree, i
 	/* of rgs based on the size of the device.                     */
 	/* If we have existing RGs (i.e. gfs2_grow) find the last one. */
 	if (!rgtree->osi_node) {
-		dev->length -= sdp->sb_addr + 1;
+		dev->length -= LGFS2_SB_ADDR(sdp) + 1;
 		nrgrp = how_many_rgrps(sdp, dev, rgsize_specified);
 		rglength = dev->length / nrgrp;
 		sdp->new_rgrps = nrgrp;
@@ -807,7 +807,7 @@ static void compute_rgrp_layout(struct gfs2_sbd *sdp, struct osi_root *rgtree, i
 			rl = rgrp_insert(rgtree, rgaddr);
 			rl->length = rglength;
 		} else {
-			rgaddr = sdp->sb_addr + 1;
+			rgaddr = LGFS2_SB_ADDR(sdp) + 1;
 			rl = rgrp_insert(rgtree, rgaddr);
 			rl->length = dev->length -
 				(nrgrp - 1) * (dev->length / nrgrp);
diff --git a/gfs2/libgfs2/fs_bits.c b/gfs2/libgfs2/fs_bits.c
index 93ddc132..e6aef558 100644
--- a/gfs2/libgfs2/fs_bits.c
+++ b/gfs2/libgfs2/fs_bits.c
@@ -108,7 +108,7 @@ unsigned long gfs2_bitfit(const unsigned char *buf, const unsigned int len,
  */
 int gfs2_check_range(struct gfs2_sbd *sdp, uint64_t blkno)
 {
-	if((blkno > sdp->fssize) || (blkno <= sdp->sb_addr))
+	if((blkno > sdp->fssize) || (blkno <= LGFS2_SB_ADDR(sdp)))
 		return -1;
 	return 0;
 }
diff --git a/gfs2/libgfs2/lang.c b/gfs2/libgfs2/lang.c
index 2f93c564..62ad2ab7 100644
--- a/gfs2/libgfs2/lang.c
+++ b/gfs2/libgfs2/lang.c
@@ -213,7 +213,7 @@ static uint64_t ast_lookup_id(const char *id, struct gfs2_sbd *sbd)
 	}
 	switch (i) {
 	case ID_SB:
-		bn = sbd->sb_addr;
+		bn = LGFS2_SB_ADDR(sbd);
 		break;
 	case ID_MASTER:
 		bn = sbd->sd_sb.sb_master_dir.no_addr;
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 641cac24..a85b9ce2 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -254,6 +254,7 @@ struct master_dir
 	uint32_t journals;                /* Journal count */
 };
 
+#define LGFS2_SB_ADDR(sdp) (GFS2_SB_ADDR >> (sdp)->sd_fsb2bb_shift)
 struct gfs2_sbd {
 	struct gfs2_sb sd_sb;    /* a copy of the ondisk structure */
 
@@ -289,8 +290,6 @@ struct gfs2_sbd {
 	int device_fd;
 	int path_fd;
 
-	uint64_t sb_addr;
-
 	uint64_t fssize;
 	uint64_t blks_total;
 	uint64_t blks_alloced;
diff --git a/gfs2/libgfs2/misc.c b/gfs2/libgfs2/misc.c
index cb2a231d..f6ae74cf 100644
--- a/gfs2/libgfs2/misc.c
+++ b/gfs2/libgfs2/misc.c
@@ -44,8 +44,6 @@ int compute_constants(struct gfs2_sbd *sdp)
 	sdp->md.next_inum = 1;
 
 	sdp->sd_sb.sb_bsize_shift = ffs(sdp->bsize) - 1;
-	sdp->sb_addr = GFS2_SB_ADDR * GFS2_BASIC_BLOCK / sdp->bsize;
-
 	sdp->sd_fsb2bb_shift = sdp->sd_sb.sb_bsize_shift -
 		GFS2_BASIC_BLOCK_SHIFT;
 	sdp->sd_fsb2bb = 1 << sdp->sd_fsb2bb_shift;
diff --git a/gfs2/libgfs2/super.c b/gfs2/libgfs2/super.c
index 61752031..4b80da2f 100644
--- a/gfs2/libgfs2/super.c
+++ b/gfs2/libgfs2/super.c
@@ -119,7 +119,6 @@ int read_sb(struct gfs2_sbd *sdp)
 		return -1;
 	}
 	sdp->fssize = lseek(sdp->device_fd, 0, SEEK_END) / sdp->sd_sb.sb_bsize;
-	sdp->sb_addr = GFS2_SB_ADDR * GFS2_BASIC_BLOCK / sdp->bsize;
 	sdp->sd_blocks_per_bitmap = (sdp->sd_sb.sb_bsize - sizeof(struct gfs2_meta_header))
 	                             * GFS2_NBBY;
 	sdp->qcsize = GFS2_DEFAULT_QCSIZE;
diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c
index 05e97498..42ce6dd6 100644
--- a/gfs2/mkfs/main_mkfs.c
+++ b/gfs2/mkfs/main_mkfs.c
@@ -721,7 +721,7 @@ static int place_journals(struct gfs2_sbd *sdp, lgfs2_rgrps_t rgs, struct mkfs_o
 	mkfs_journals = calloc(opts->journals, sizeof(*mkfs_journals));
 	if (mkfs_journals == NULL)
 		return 1;
-	*rgaddr = lgfs2_rgrp_align_addr(rgs, sdp->sb_addr + 1);
+	*rgaddr = lgfs2_rgrp_align_addr(rgs, LGFS2_SB_ADDR(sdp) + 1);
 	rgsize = lgfs2_rgrp_align_len(rgs, rgsize);
 
 	for (j = 0; j < opts->journals; j++) {
@@ -1035,7 +1035,7 @@ int main(int argc, char *argv[])
 		if (!opts.quiet)
 			printf("%s", _("Done\n"));
 	}
-	rgaddr = lgfs2_rgrp_align_addr(rgs, sbd.sb_addr + 1);
+	rgaddr = lgfs2_rgrp_align_addr(rgs, LGFS2_SB_ADDR(&sbd) + 1);
 	error = place_journals(&sbd, rgs, &opts, &rgaddr);
 	if (error != 0) {
 		fprintf(stderr, _("Failed to create journals\n"));
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Cluster-devel] [PATCH 03/20] libgfs2: Plug an alignment hole in gfs2_sbd
  2018-03-05 18:25 [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Andrew Price
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 01/20] libgfs2: Remove unused lock* fields from gfs2_sbd Andrew Price
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 02/20] libgfs2: Remove sb_addr " Andrew Price
@ 2018-03-05 18:25 ` Andrew Price
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 04/20] libgfs2: Plug an alignment hole in gfs2_buffer_head Andrew Price
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 26+ messages in thread
From: Andrew Price @ 2018-03-05 18:25 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Allows struct gfs2_sbd to fit in 14 cachelines instead of 15

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 gfs2/libgfs2/libgfs2.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index a85b9ce2..dfe593ec 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -276,8 +276,8 @@ struct gfs2_sbd {
 	uint32_t sd_blocks_per_bitmap;
 	uint32_t sd_max_dirres;
 	uint32_t sd_max_height;
-	uint64_t sd_heightsize[GFS2_MAX_META_HEIGHT];
 	uint32_t sd_max_jheight;
+	uint64_t sd_heightsize[GFS2_MAX_META_HEIGHT];
 	uint64_t sd_jheightsize[GFS2_MAX_META_HEIGHT];
 
 	/* Not specified on the command line, but... */
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Cluster-devel] [PATCH 04/20] libgfs2: Plug an alignment hole in gfs2_buffer_head
  2018-03-05 18:25 [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Andrew Price
                   ` (2 preceding siblings ...)
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 03/20] libgfs2: Plug an alignment hole in gfs2_sbd Andrew Price
@ 2018-03-05 18:25 ` Andrew Price
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 05/20] libgfs2: Plug an alignment hole in gfs2_inode Andrew Price
                   ` (16 subsequent siblings)
  20 siblings, 0 replies; 26+ messages in thread
From: Andrew Price @ 2018-03-05 18:25 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 gfs2/libgfs2/libgfs2.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index dfe593ec..6970c11d 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -217,12 +217,12 @@ extern struct osi_node *lgfs2_rgrps_root(lgfs2_rgrps_t rgs) __attribute__((depre
 struct gfs2_buffer_head {
 	osi_list_t b_altlist; /* alternate list */
 	uint64_t b_blocknr;
-	int b_modified;
 	union {
 		char *b_data;
 		struct iovec iov;
 	};
 	struct gfs2_sbd *sdp;
+	int b_modified;
 };
 
 struct special_blocks {
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Cluster-devel] [PATCH 05/20] libgfs2: Plug an alignment hole in gfs2_inode
  2018-03-05 18:25 [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Andrew Price
                   ` (3 preceding siblings ...)
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 04/20] libgfs2: Plug an alignment hole in gfs2_buffer_head Andrew Price
@ 2018-03-05 18:25 ` Andrew Price
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 06/20] libgfs2: Remove gfs2_meta_header_out_bh() Andrew Price
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 26+ messages in thread
From: Andrew Price @ 2018-03-05 18:25 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 gfs2/libgfs2/libgfs2.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 6970c11d..5767c43a 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -231,11 +231,11 @@ struct special_blocks {
 };
 
 struct gfs2_inode {
-	int bh_owned; /* Is this bh owned, iow, should we release it later? */
 	struct gfs2_dinode i_di;
 	struct gfs2_buffer_head *i_bh;
 	struct gfs2_sbd *i_sbd;
 	struct rgrp_tree *i_rgd; /* performance hint */
+	int bh_owned; /* Is this bh owned, iow, should we release it later? */
 };
 
 struct master_dir
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Cluster-devel] [PATCH 06/20] libgfs2: Remove gfs2_meta_header_out_bh()
  2018-03-05 18:25 [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Andrew Price
                   ` (4 preceding siblings ...)
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 05/20] libgfs2: Plug an alignment hole in gfs2_inode Andrew Price
@ 2018-03-05 18:25 ` Andrew Price
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 07/20] libgfs2: Don't pass an extlen to block_map where not required Andrew Price
                   ` (14 subsequent siblings)
  20 siblings, 0 replies; 26+ messages in thread
From: Andrew Price @ 2018-03-05 18:25 UTC (permalink / raw)
  To: cluster-devel.redhat.com

The bmodified() calls have to be preserved until the brelse() calls can
be replaced with explicit writes and frees, where required.

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 gfs2/convert/gfs2_convert.c | 12 ++++++++----
 gfs2/fsck/rgrepair.c        |  3 ++-
 gfs2/libgfs2/fs_geometry.c  |  3 ++-
 gfs2/libgfs2/fs_ops.c       | 21 ++++++++++++++-------
 gfs2/libgfs2/gfs1.c         |  7 ++++---
 gfs2/libgfs2/libgfs2.h      |  2 --
 gfs2/libgfs2/ondisk.c       | 11 ++---------
 gfs2/libgfs2/structures.c   |  3 ++-
 gfs2/mkfs/main_jadd.c       |  8 +++-----
 9 files changed, 37 insertions(+), 33 deletions(-)

diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index 4b18c770..765c6d50 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -312,7 +312,8 @@ static void fix_metatree(struct gfs2_sbd *sbp, struct gfs2_inode *ip,
 			bh = bread(sbp, block);
 			if (new)
 				memset(bh->b_data, 0, sbp->bsize);
-			gfs2_meta_header_out_bh(&mh, bh);
+			gfs2_meta_header_out(&mh, bh->b_data);
+			bmodified(bh);
 		}
 
 		hdrsize = blk->height ? sizeof(struct gfs2_meta_header) :
@@ -469,8 +470,10 @@ static uint64_t fix_jdatatree(struct gfs2_sbd *sbp, struct gfs2_inode *ip,
 			bh = bread(sbp, block);
 			if (new)
 				memset(bh->b_data, 0, sbp->bsize);
-			if (h < (blk->height - 1))
-				gfs2_meta_header_out_bh(&mh, bh);
+			if (h < (blk->height - 1)) {
+				gfs2_meta_header_out(&mh, bh->b_data);
+				bmodified(bh);
+			}
 		}
 
 		if (amount > sbp->bsize - ptramt)
@@ -1875,9 +1878,10 @@ static int journ_space_to_rg(struct gfs2_sbd *sdp)
 		convert_bitmaps(sdp, rgd);
 		for (x = 0; x < rgd->ri.ri_length; x++) {
 			if (x)
-				gfs2_meta_header_out_bh(&mh, rgd->bits[x].bi_bh);
+				gfs2_meta_header_out(&mh, rgd->bits[x].bi_bh->b_data);
 			else
 				gfs2_rgrp_out_bh(&rgd->rg, rgd->bits[x].bi_bh);
+			bmodified(rgd->bits[x].bi_bh);
 		}
 	} /* for each journal */
 	return error;
diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c
index f15266e0..d9a33705 100644
--- a/gfs2/fsck/rgrepair.c
+++ b/gfs2/fsck/rgrepair.c
@@ -898,7 +898,8 @@ static int rewrite_rg_block(struct gfs2_sbd *sdp, struct rgrp_tree *rg,
 			mh.mh_magic = GFS2_MAGIC;
 			mh.mh_type = GFS2_METATYPE_RB;
 			mh.mh_format = GFS2_FORMAT_RB;
-			gfs2_meta_header_out_bh(&mh, rg->bits[x].bi_bh);
+			gfs2_meta_header_out(&mh, rg->bits[x].bi_bh->b_data);
+			bmodified(rg->bits[x].bi_bh);
 		} else {
 			if (sdp->gfs1)
 				memset(&rg->rg, 0, sizeof(struct gfs_rgrp));
diff --git a/gfs2/libgfs2/fs_geometry.c b/gfs2/libgfs2/fs_geometry.c
index 59b5ef7b..07d6c647 100644
--- a/gfs2/libgfs2/fs_geometry.c
+++ b/gfs2/libgfs2/fs_geometry.c
@@ -89,9 +89,10 @@ int build_rgrps(struct gfs2_sbd *sdp, int do_write)
 			for (x = 0; x < bitblocks; x++) {
 				rl->bits[x].bi_bh = bget(sdp, rl->start + x);
 				if (x)
-					gfs2_meta_header_out_bh(&mh, rl->bits[x].bi_bh);
+					gfs2_meta_header_out(&mh, rl->bits[x].bi_bh->b_data);
 				else
 					gfs2_rgrp_out_bh(&rl->rg, rl->bits[x].bi_bh);
+				bmodified(rl->bits[x].bi_bh);
 			}
 		}
 
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index a22e0447..288c40c7 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -255,12 +255,13 @@ void unstuff_dinode(struct gfs2_inode *ip)
 			mh.mh_magic = GFS2_MAGIC;
 			mh.mh_type = GFS2_METATYPE_JD;
 			mh.mh_format = GFS2_FORMAT_JD;
-			gfs2_meta_header_out_bh(&mh, bh);
+			gfs2_meta_header_out(&mh, bh->b_data);
 
 			buffer_copy_tail(sdp, bh,
 					 sizeof(struct gfs2_meta_header),
 					 ip->i_bh, sizeof(struct gfs2_dinode));
 
+			bmodified(bh);
 			brelse(bh);
 		} else {
 			bh = bget(sdp, block);
@@ -410,10 +411,11 @@ void build_height(struct gfs2_inode *ip, int height)
 			mh.mh_magic = GFS2_MAGIC;
 			mh.mh_type = GFS2_METATYPE_IN;
 			mh.mh_format = GFS2_FORMAT_IN;
-			gfs2_meta_header_out_bh(&mh, bh);
+			gfs2_meta_header_out(&mh, bh->b_data);
 			buffer_copy_tail(sdp, bh,
 					 sizeof(struct gfs2_meta_header),
 					 ip->i_bh, sizeof(struct gfs2_dinode));
+			bmodified(bh);
 			brelse(bh);
 		}
 
@@ -521,7 +523,8 @@ 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;
-			gfs2_meta_header_out_bh(&mh, bh);
+			gfs2_meta_header_out(&mh, bh->b_data);
+			bmodified(bh);
 		} else {
 			if (*dblock == ip->i_di.di_num.no_addr)
 				bh = ip->i_bh;
@@ -712,7 +715,8 @@ int __gfs2_writei(struct gfs2_inode *ip, void *buf,
 				mh.mh_magic = GFS2_MAGIC;
 				mh.mh_type = GFS2_METATYPE_JD;
 				mh.mh_format = GFS2_FORMAT_JD;
-				gfs2_meta_header_out_bh(&mh, bh);
+				gfs2_meta_header_out(&mh, bh->b_data);
+				bmodified(bh);
 			}
 		} else {
 			if (dblock == ip->i_di.di_num.no_addr)
@@ -938,7 +942,8 @@ void dir_split_leaf(struct gfs2_inode *dip, uint32_t start, uint64_t leaf_no,
 		mh.mh_magic = GFS2_MAGIC;
 		mh.mh_type = GFS2_METATYPE_LF;
 		mh.mh_format = GFS2_FORMAT_LF;
-		gfs2_meta_header_out_bh(&mh, nbh);
+		gfs2_meta_header_out(&mh, nbh->b_data);
+		bmodified(nbh);
 		buffer_clear_tail(dip->i_sbd, nbh,
 				  sizeof(struct gfs2_meta_header));
 	}
@@ -1218,7 +1223,8 @@ restart:
 				mh.mh_magic = GFS2_MAGIC;
 				mh.mh_type = GFS2_METATYPE_LF;
 				mh.mh_format = GFS2_FORMAT_LF;
-				gfs2_meta_header_out_bh(&mh, nbh);
+				gfs2_meta_header_out(&mh, nbh->b_data);
+				bmodified(nbh);
 
 				leaf->lf_next = cpu_to_be64(bn);
 
@@ -1272,7 +1278,8 @@ static void dir_make_exhash(struct gfs2_inode *dip)
 		mh.mh_magic = GFS2_MAGIC;
 		mh.mh_type = GFS2_METATYPE_LF;
 		mh.mh_format = GFS2_FORMAT_LF;
-		gfs2_meta_header_out_bh(&mh, bh);
+		gfs2_meta_header_out(&mh, bh->b_data);
+		bmodified(bh);
 	}
 
 	leaf = (struct gfs2_leaf *)bh->b_data;
diff --git a/gfs2/libgfs2/gfs1.c b/gfs2/libgfs2/gfs1.c
index 2c84f78a..5596ec90 100644
--- a/gfs2/libgfs2/gfs1.c
+++ b/gfs2/libgfs2/gfs1.c
@@ -125,7 +125,8 @@ void gfs1_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;
-			gfs2_meta_header_out_bh(&mh, bh);
+			gfs2_meta_header_out(&mh, bh->b_data);
+			bmodified(bh);
 		} else {
 			if (*dblock == ip->i_di.di_num.no_addr)
 				bh = ip->i_bh;
@@ -221,7 +222,7 @@ int gfs1_writei(struct gfs2_inode *ip, char *buf, uint64_t offset,
 			mh.mh_magic = GFS2_MAGIC;
 			mh.mh_type = GFS2_METATYPE_JD;
 			mh.mh_format = GFS2_FORMAT_JD;
-			gfs2_meta_header_out_bh(&mh, bh);
+			gfs2_meta_header_out(&mh, bh->b_data);
 		}
 
 		memcpy(bh->b_data + offset, buf + copied, amount);
@@ -377,7 +378,7 @@ void gfs_rgrp_out(struct gfs_rgrp *rgrp, struct gfs2_buffer_head *rbh)
 {
 	struct gfs_rgrp *str = (struct gfs_rgrp *)rbh->b_data;
 
-	gfs2_meta_header_out_bh(&rgrp->rg_header, rbh);
+	gfs2_meta_header_out(&rgrp->rg_header, rbh->b_data);
 	str->rg_flags = cpu_to_be32(rgrp->rg_flags);
 	str->rg_free = cpu_to_be32(rgrp->rg_free);
 	str->rg_useddi = cpu_to_be32(rgrp->rg_useddi);
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 5767c43a..0f434d25 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -724,8 +724,6 @@ extern void gfs2_inum_out(const struct gfs2_inum *no, char *buf);
 extern void gfs2_meta_header_in(struct gfs2_meta_header *mh,
 				struct gfs2_buffer_head *bh);
 extern void gfs2_meta_header_out(const struct gfs2_meta_header *mh, char *buf);
-extern void gfs2_meta_header_out_bh(const struct gfs2_meta_header *mh,
-                                    struct gfs2_buffer_head *bh);
 extern void gfs2_sb_in(struct gfs2_sb *sb, struct gfs2_buffer_head *bh);
 extern void gfs2_sb_out(const struct gfs2_sb *sb, char *buf);
 extern void gfs2_rindex_in(struct gfs2_rindex *ri, char *buf);
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index 9de568c0..7fb8f000 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -85,13 +85,6 @@ void gfs2_meta_header_out(const struct gfs2_meta_header *mh, char *buf)
 	str->__pad1 = 0;
 }
 
-void gfs2_meta_header_out_bh(const struct gfs2_meta_header *mh,
-                             struct gfs2_buffer_head *bh)
-{
-	gfs2_meta_header_out(mh, bh->iov.iov_base);
-	bmodified(bh);
-}
-
 void gfs2_meta_header_print(const struct gfs2_meta_header *mh)
 {
 	pv(mh, mh_magic, "0x%08X", NULL);
@@ -496,7 +489,7 @@ void gfs2_leaf_out(struct gfs2_leaf *lf, struct gfs2_buffer_head *bh)
 {
 	struct gfs2_leaf *str = (struct gfs2_leaf *)bh->b_data;
 
-	gfs2_meta_header_out_bh(&lf->lf_header, bh);
+	gfs2_meta_header_out(&lf->lf_header, bh->b_data);
 	CPOUT_16(lf, str, lf_depth);
 	CPOUT_16(lf, str, lf_entries);
 	CPOUT_32(lf, str, lf_dirent_format);
@@ -670,7 +663,7 @@ void gfs2_log_descriptor_out(struct gfs2_log_descriptor *ld,
 {
 	struct gfs2_log_descriptor *str = (struct gfs2_log_descriptor *)bh->b_data;
 
-	gfs2_meta_header_out_bh(&ld->ld_header, bh);
+	gfs2_meta_header_out(&ld->ld_header, bh->b_data);
 	CPOUT_32(ld, str, ld_type);
 	CPOUT_32(ld, str, ld_length);
 	CPOUT_32(ld, str, ld_data1);
diff --git a/gfs2/libgfs2/structures.c b/gfs2/libgfs2/structures.c
index 2d30018a..aaa76994 100644
--- a/gfs2/libgfs2/structures.c
+++ b/gfs2/libgfs2/structures.c
@@ -412,7 +412,8 @@ int build_quota_change(struct gfs2_inode *per_node, unsigned int j)
 			return -1;
 
 		memset(bh->b_data, 0, sdp->bsize);
-		gfs2_meta_header_out_bh(&mh, bh);
+		gfs2_meta_header_out(&mh, bh->b_data);
+		bmodified(bh);
 		brelse(bh);
 	}
 
diff --git a/gfs2/mkfs/main_jadd.c b/gfs2/mkfs/main_jadd.c
index 543070da..efe91e30 100644
--- a/gfs2/mkfs/main_jadd.c
+++ b/gfs2/mkfs/main_jadd.c
@@ -345,9 +345,7 @@ static void add_qc(struct gfs2_sbd *sdp, struct jadd_opts *opts)
 			sdp->qcsize << (20 - sdp->sd_sb.sb_bsize_shift);
 		unsigned int x;
 		struct gfs2_meta_header mh;
-		struct gfs2_buffer_head dummy_bh;
 
-		dummy_bh.b_data = buf;
 		set_flags(fd, JA_FL_CLEAR, FS_JOURNAL_DATA_FL);
 		memset(buf, 0, sdp->bsize);
 
@@ -359,12 +357,12 @@ static void add_qc(struct gfs2_sbd *sdp, struct jadd_opts *opts)
 		}
 
 		lseek(fd, 0, SEEK_SET);
-		
+
 		memset(&mh, 0, sizeof(struct gfs2_meta_header));
 		mh.mh_magic = GFS2_MAGIC;
 		mh.mh_type = GFS2_METATYPE_QC;
 		mh.mh_format = GFS2_FORMAT_QC;
-		gfs2_meta_header_out_bh(&mh, &dummy_bh);
+		gfs2_meta_header_out(&mh, buf);
 
 		for (x=0; x<blocks; x++) {
 			if (write(fd, buf, sdp->bsize) != sdp->bsize) {
@@ -381,7 +379,7 @@ static void add_qc(struct gfs2_sbd *sdp, struct jadd_opts *opts)
 	}
 
 	close(fd);
-	
+
 	sprintf(new_name, "quota_change%u", opts->journals);
 	error = rename2system(opts, opts->per_node, new_name);
 	if (error < 0 && errno != EEXIST){
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Cluster-devel] [PATCH 07/20] libgfs2: Don't pass an extlen to block_map where not required
  2018-03-05 18:25 [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Andrew Price
                   ` (5 preceding siblings ...)
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 06/20] libgfs2: Remove gfs2_meta_header_out_bh() Andrew Price
@ 2018-03-05 18:25 ` Andrew Price
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 08/20] libgfs2: Don't use a buffer_head in gfs2_meta_header_in Andrew Price
                   ` (13 subsequent siblings)
  20 siblings, 0 replies; 26+ messages in thread
From: Andrew Price @ 2018-03-05 18:25 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 gfs2/fsck/fs_recovery.c | 3 +--
 gfs2/fsck/rgrepair.c    | 3 +--
 gfs2/libgfs2/recovery.c | 7 +++----
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c
index 7284868b..4fd28796 100644
--- a/gfs2/fsck/fs_recovery.c
+++ b/gfs2/fsck/fs_recovery.c
@@ -406,7 +406,6 @@ static int check_journal_seq_no(struct gfs2_inode *ip, int fix)
 	uint64_t highest_seq = 0, lowest_seq = 0, prev_seq = 0;
 	int new = 0;
 	uint64_t dblock;
-	uint32_t extlen;
 	struct gfs2_buffer_head *bh;
 	int seq_errors = 0;
 
@@ -443,7 +442,7 @@ static int check_journal_seq_no(struct gfs2_inode *ip, int fix)
 		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);
+		block_map(ip, blk, &new, &dblock, NULL, FALSE);
 		bh = bread(ip->i_sbd, dblock);
 		gfs2_log_header_out_bh(&lh, bh);
 		brelse(bh);
diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c
index d9a33705..44f268a8 100644
--- a/gfs2/fsck/rgrepair.c
+++ b/gfs2/fsck/rgrepair.c
@@ -53,7 +53,6 @@ static void find_journaled_rgs(struct gfs2_sbd *sdp)
 	int j, new = 0;
 	unsigned int jblocks;
 	uint64_t b, dblock;
-	uint32_t extlen;
 	struct gfs2_inode *ip;
 	struct gfs2_buffer_head *bh;
 	int false_count;
@@ -67,7 +66,7 @@ static void find_journaled_rgs(struct gfs2_sbd *sdp)
 		jblocks = ip->i_di.di_size / sdp->sd_sb.sb_bsize;
 		false_count = 0;
 		for (b = 0; b < jblocks; b++) {
-			block_map(ip, b, &new, &dblock, &extlen, 0);
+			block_map(ip, b, &new, &dblock, NULL, 0);
 			if (!dblock)
 				break;
 			bh = bread(sdp, dblock);
diff --git a/gfs2/libgfs2/recovery.c b/gfs2/libgfs2/recovery.c
index b813d698..71f907b0 100644
--- a/gfs2/libgfs2/recovery.c
+++ b/gfs2/libgfs2/recovery.c
@@ -27,9 +27,8 @@ int gfs2_replay_read_block(struct gfs2_inode *ip, unsigned int blk,
 {
 	int new = 0;
 	uint64_t dblock;
-	uint32_t extlen;
 
-	block_map(ip, blk, &new, &dblock, &extlen, FALSE);
+	block_map(ip, blk, &new, &dblock, NULL, FALSE);
 	if (!dblock)
 		return -EIO;
 
@@ -220,14 +219,14 @@ int clean_journal(struct gfs2_inode *ip, struct gfs2_log_header *head)
 {
 	unsigned int lblock;
 	struct gfs2_log_header *lh;
-	uint32_t hash, extlen;
+	uint32_t hash;
 	struct gfs2_buffer_head *bh;
 	int new = 0;
 	uint64_t dblock;
 
 	lblock = head->lh_blkno;
 	gfs2_replay_incr_blk(ip, &lblock);
-	block_map(ip, lblock, &new, &dblock, &extlen, 0);
+	block_map(ip, lblock, &new, &dblock, NULL, 0);
 	if (!dblock)
 		return -EIO;
 
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Cluster-devel] [PATCH 08/20] libgfs2: Don't use a buffer_head in gfs2_meta_header_in
  2018-03-05 18:25 [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Andrew Price
                   ` (6 preceding siblings ...)
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 07/20] libgfs2: Don't pass an extlen to block_map where not required Andrew Price
@ 2018-03-05 18:25 ` Andrew Price
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 09/20] libgfs2: Don't use buffer_heads in gfs2_sb_in Andrew Price
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 26+ messages in thread
From: Andrew Price @ 2018-03-05 18:25 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 gfs2/edit/gfs2hex.c    |  4 ++--
 gfs2/edit/hexedit.c    |  2 +-
 gfs2/edit/savemeta.c   |  4 ++--
 gfs2/fsck/initialize.c |  2 +-
 gfs2/fsck/pass1.c      |  2 +-
 gfs2/fsck/rgrepair.c   |  8 ++++----
 gfs2/libgfs2/gfs1.c    |  4 ++--
 gfs2/libgfs2/libgfs2.h |  3 +--
 gfs2/libgfs2/ondisk.c  | 17 ++++++++---------
 9 files changed, 22 insertions(+), 24 deletions(-)

diff --git a/gfs2/edit/gfs2hex.c b/gfs2/edit/gfs2hex.c
index 8abadd21..4a20b465 100644
--- a/gfs2/edit/gfs2hex.c
+++ b/gfs2/edit/gfs2hex.c
@@ -436,7 +436,7 @@ static void gfs1_rgrp_in(struct gfs_rgrp *rgrp, struct gfs2_buffer_head *rbh)
 {
         struct gfs_rgrp *str = (struct gfs_rgrp *)rbh->b_data;
 
-        gfs2_meta_header_in(&rgrp->rg_header, rbh);
+        gfs2_meta_header_in(&rgrp->rg_header, rbh->b_data);
         rgrp->rg_flags = be32_to_cpu(str->rg_flags);
         rgrp->rg_free = be32_to_cpu(str->rg_free);
         rgrp->rg_useddi = be32_to_cpu(str->rg_useddi);
@@ -480,7 +480,7 @@ int display_gfs2(struct gfs2_buffer_head *dbh)
 	switch (magic)
 	{
 	case GFS2_MAGIC:
-		gfs2_meta_header_in(&mh, dbh);
+		gfs2_meta_header_in(&mh, dbh->b_data);
 		if (mh.mh_type > GFS2_METATYPE_QC)
 			print_gfs2("Unknown metadata type");
 		else
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 96001187..9997ddb5 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -2120,7 +2120,7 @@ void gfs_log_header_in(struct gfs_log_header *head,
 {
 	struct gfs_log_header *str = lbh->iov.iov_base;
 
-	gfs2_meta_header_in(&head->lh_header, lbh);
+	gfs2_meta_header_in(&head->lh_header, lbh->b_data);
 
 	head->lh_flags = be32_to_cpu(str->lh_flags);
 	head->lh_pad = be32_to_cpu(str->lh_pad);
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index a15fcf22..c4dab490 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -242,7 +242,7 @@ static int get_gfs_struct_info(struct gfs2_buffer_head *lbh, uint64_t owner,
 		*block_type = 0;
 	*gstruct_len = sbd.bsize;
 
-	gfs2_meta_header_in(&mh, lbh);
+	gfs2_meta_header_in(&mh, lbh->b_data);
 	if (mh.mh_magic != GFS2_MAGIC)
 		return -1;
 
@@ -680,7 +680,7 @@ static void save_inode_data(struct metafd *mfd, uint64_t iblk)
 
 		lbh = bread(&sbd, inode->i_di.di_eattr);
 		save_block(sbd.device_fd, mfd, inode->i_di.di_eattr, iblk, NULL);
-		gfs2_meta_header_in(&mh, lbh);
+		gfs2_meta_header_in(&mh, lbh->b_data);
 		if (mh.mh_magic == GFS2_MAGIC &&
 		    mh.mh_type == GFS2_METATYPE_EA)
 			save_ea_block(mfd, lbh, iblk);
diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index 5862fc3c..badbf507 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -1130,7 +1130,7 @@ static int find_rgs_for_bsize(struct gfs2_sbd *sdp, uint64_t startblock,
 				(bsize / bsize2) + 1;
 			sdp->bsize = bsize2; /* temporarily */
 			rb_bh = bread(sdp, rb_addr);
-			gfs2_meta_header_in(&mh, rb_bh);
+			gfs2_meta_header_in(&mh, rb_bh->b_data);
 			brelse(rb_bh);
 			if (mh.mh_magic == GFS2_MAGIC &&
 			    mh.mh_type == GFS2_METATYPE_RB) {
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index 87fab9ae..3c2f74fa 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -602,7 +602,7 @@ static int check_data(struct gfs2_inode *ip, uint64_t metablock,
 			return 1;
 		case GFS2_BLKST_USED: /* tough decision: May be data or meta */
 			bh = bread(ip->i_sbd, block);
-			gfs2_meta_header_in(&mh, bh);
+			gfs2_meta_header_in(&mh, bh->b_data);
 			brelse(bh);
 			if (mh.mh_magic == GFS2_MAGIC &&
 			    mh.mh_type >= GFS2_METATYPE_RG &&
diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c
index 44f268a8..0fa5a4ae 100644
--- a/gfs2/fsck/rgrepair.c
+++ b/gfs2/fsck/rgrepair.c
@@ -361,7 +361,7 @@ static uint64_t find_next_rgrp_dist(struct gfs2_sbd *sdp, uint64_t blk,
 		if (block >= prevrgd->ri.ri_addr + twogigs)
 			break;
 		bh = bread(sdp, block);
-		gfs2_meta_header_in(&mh, bh);
+		gfs2_meta_header_in(&mh, bh->b_data);
 		if ((mh.mh_magic != GFS2_MAGIC) ||
 		    (first && mh.mh_type != GFS2_METATYPE_RG) ||
 		    (!first && mh.mh_type != GFS2_METATYPE_RB)) {
@@ -394,7 +394,7 @@ static uint64_t find_next_rgrp_dist(struct gfs2_sbd *sdp, uint64_t blk,
 			if (next_block >= sdp->device.length)
 				break;
 			bh = bread(sdp, next_block + b);
-			gfs2_meta_header_in(&mh, bh);
+			gfs2_meta_header_in(&mh, bh->b_data);
 			brelse(bh);
 			if (mh.mh_magic == GFS2_MAGIC) {
 				if (mh.mh_type == GFS2_METATYPE_RG) {
@@ -444,7 +444,7 @@ static uint64_t hunt_and_peck(struct gfs2_sbd *sdp, uint64_t blk,
 		return sdp->fssize - blk;
 
 	bh = bread(sdp, blk + last_bump);
-	gfs2_meta_header_in(&mh, bh);
+	gfs2_meta_header_in(&mh, bh->b_data);
 	brelse(bh);
 	if (mh.mh_magic == GFS2_MAGIC && mh.mh_type == GFS2_METATYPE_RG) {
 		log_info( _("rgrp found at 0x%llx, length=%lld\n"),
@@ -471,7 +471,7 @@ static uint64_t hunt_and_peck(struct gfs2_sbd *sdp, uint64_t blk,
 	}
 	for (b = AWAY_FROM_BITMAPS; b < last_block; b++) {
 		bh = bread(sdp, block + b);
-		gfs2_meta_header_in(&mh, bh);
+		gfs2_meta_header_in(&mh, bh->b_data);
 		brelse(bh);
 		if (mh.mh_magic == GFS2_MAGIC) {
 			if (mh.mh_type == GFS2_METATYPE_RG)
diff --git a/gfs2/libgfs2/gfs1.c b/gfs2/libgfs2/gfs1.c
index 5596ec90..00d32238 100644
--- a/gfs2/libgfs2/gfs1.c
+++ b/gfs2/libgfs2/gfs1.c
@@ -256,7 +256,7 @@ static void gfs_dinode_in(struct gfs_dinode *di, struct gfs2_buffer_head *bh)
 {
 	struct gfs_dinode *str = (struct gfs_dinode *)bh->b_data;
 
-	gfs2_meta_header_in(&di->di_header, bh);
+	gfs2_meta_header_in(&di->di_header, bh->b_data);
 	gfs2_inum_in(&di->di_num, (char *)&str->di_num);
 
 	di->di_mode = be32_to_cpu(str->di_mode);
@@ -359,7 +359,7 @@ void gfs_rgrp_in(struct gfs_rgrp *rgrp, struct gfs2_buffer_head *rbh)
 {
 	struct gfs_rgrp *str = (struct gfs_rgrp *)rbh->b_data;
 
-	gfs2_meta_header_in(&rgrp->rg_header, rbh);
+	gfs2_meta_header_in(&rgrp->rg_header, rbh->b_data);
 	rgrp->rg_flags = be32_to_cpu(str->rg_flags);
 	rgrp->rg_free = be32_to_cpu(str->rg_free);
 	rgrp->rg_useddi = be32_to_cpu(str->rg_useddi);
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 0f434d25..4f0d4924 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -721,8 +721,7 @@ extern void print_it(const char *label, const char *fmt, const char *fmt2, ...)
 
 extern void gfs2_inum_in(struct gfs2_inum *no, char *buf);
 extern void gfs2_inum_out(const struct gfs2_inum *no, char *buf);
-extern void gfs2_meta_header_in(struct gfs2_meta_header *mh,
-				struct gfs2_buffer_head *bh);
+extern void gfs2_meta_header_in(struct gfs2_meta_header *mh, char *buf);
 extern void gfs2_meta_header_out(const struct gfs2_meta_header *mh, char *buf);
 extern void gfs2_sb_in(struct gfs2_sb *sb, struct gfs2_buffer_head *bh);
 extern void gfs2_sb_out(const struct gfs2_sb *sb, char *buf);
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index 7fb8f000..f56717a8 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -64,10 +64,9 @@ void gfs2_inum_print(const struct gfs2_inum *no)
 	pv(no, no_addr, "%llu", "0x%llx");
 }
 
-void gfs2_meta_header_in(struct gfs2_meta_header *mh,
-			 struct gfs2_buffer_head *bh)
+void gfs2_meta_header_in(struct gfs2_meta_header *mh, char *buf)
 {
-	struct gfs2_meta_header *str = (struct gfs2_meta_header *)bh->b_data;
+	struct gfs2_meta_header *str = (struct gfs2_meta_header *)buf;
 
 	CPIN_32(mh, str, mh_magic);
 	CPIN_32(mh, str, mh_type);
@@ -96,7 +95,7 @@ void gfs2_sb_in(struct gfs2_sb *sb, struct gfs2_buffer_head *bh)
 {
 	struct gfs2_sb *str = (struct gfs2_sb *)bh->b_data;
 
-	gfs2_meta_header_in(&sb->sb_header, bh);
+	gfs2_meta_header_in(&sb->sb_header, bh->b_data);
 
 	CPIN_32(sb, str, sb_fs_format);
 	CPIN_32(sb, str, sb_multihost_format);
@@ -216,7 +215,7 @@ void gfs2_rgrp_in(struct gfs2_rgrp *rg, struct gfs2_buffer_head *bh)
 {
 	struct gfs2_rgrp *str = (struct gfs2_rgrp *)bh->b_data;
 
-	gfs2_meta_header_in(&rg->rg_header, bh);
+	gfs2_meta_header_in(&rg->rg_header, bh->b_data);
 	CPIN_32(rg, str, rg_flags);
 	CPIN_32(rg, str, rg_free);
 	CPIN_32(rg, str, rg_dinodes);
@@ -319,7 +318,7 @@ void gfs2_dinode_in(struct gfs2_dinode *di, struct gfs2_buffer_head *bh)
 {
 	struct gfs2_dinode *str = (struct gfs2_dinode *)bh->b_data;
 
-	gfs2_meta_header_in(&di->di_header, bh);
+	gfs2_meta_header_in(&di->di_header, bh->b_data);
 	gfs2_inum_in(&di->di_num, (char *)&str->di_num);
 
 	CPIN_32(di, str, di_mode);
@@ -469,7 +468,7 @@ void gfs2_leaf_in(struct gfs2_leaf *lf, struct gfs2_buffer_head *bh)
 {
 	struct gfs2_leaf *str = (struct gfs2_leaf *)bh->b_data;
 
-	gfs2_meta_header_in(&lf->lf_header, bh);
+	gfs2_meta_header_in(&lf->lf_header, bh->b_data);
 	CPIN_16(lf, str, lf_depth);
 	CPIN_16(lf, str, lf_entries);
 	CPIN_32(lf, str, lf_dirent_format);
@@ -553,7 +552,7 @@ void gfs2_log_header_v1_in(struct gfs2_log_header *lh, struct gfs2_buffer_head *
 {
 	struct gfs2_log_header *str = (struct gfs2_log_header *)bh->b_data;
 
-	gfs2_meta_header_in(&lh->lh_header, bh);
+	gfs2_meta_header_in(&lh->lh_header, bh->b_data);
 	CPIN_64(lh, str, lh_sequence);
 	CPIN_32(lh, str, lh_flags);
 	CPIN_32(lh, str, lh_tail);
@@ -649,7 +648,7 @@ void gfs2_log_descriptor_in(struct gfs2_log_descriptor *ld,
 {
 	struct gfs2_log_descriptor *str = (struct gfs2_log_descriptor *)bh->b_data;
 
-	gfs2_meta_header_in(&ld->ld_header, bh);
+	gfs2_meta_header_in(&ld->ld_header, bh->b_data);
 	CPIN_32(ld, str, ld_type);
 	CPIN_32(ld, str, ld_length);
 	CPIN_32(ld, str, ld_data1);
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Cluster-devel] [PATCH 09/20] libgfs2: Don't use buffer_heads in gfs2_sb_in
  2018-03-05 18:25 [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Andrew Price
                   ` (7 preceding siblings ...)
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 08/20] libgfs2: Don't use a buffer_head in gfs2_meta_header_in Andrew Price
@ 2018-03-05 18:25 ` Andrew Price
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 10/20] libgfs2: Don't use buffer_heads in gfs2_rgrp_in Andrew Price
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 26+ messages in thread
From: Andrew Price @ 2018-03-05 18:25 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 gfs2/convert/gfs2_convert.c |  2 +-
 gfs2/edit/gfs2hex.c         |  2 +-
 gfs2/edit/hexedit.c         |  4 ++--
 gfs2/edit/savemeta.c        | 14 +++++++-------
 gfs2/glocktop/glocktop.c    |  2 +-
 gfs2/libgfs2/libgfs2.h      |  2 +-
 gfs2/libgfs2/ondisk.c       |  6 +++---
 gfs2/libgfs2/super.c        |  2 +-
 8 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index 765c6d50..6aac2b0e 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -1587,7 +1587,7 @@ static int init(struct gfs2_sbd *sbp, struct gfs2_options *opts)
 	bh = bread(sbp, GFS2_SB_ADDR >> sbp->sd_fsb2bb_shift);
 	memcpy(&raw_gfs1_ondisk_sb, (struct gfs_sb *)bh->b_data,
 		   sizeof(struct gfs_sb));
-	gfs2_sb_in(&sbp->sd_sb, bh);
+	gfs2_sb_in(&sbp->sd_sb, bh->b_data);
 
 	jindex_addr = be64_to_cpu(raw_gfs1_ondisk_sb.sb_jindex_di.no_addr);
 	rindex_addr = be64_to_cpu(raw_gfs1_ondisk_sb.sb_rindex_di.no_addr);
diff --git a/gfs2/edit/gfs2hex.c b/gfs2/edit/gfs2hex.c
index 4a20b465..2d165392 100644
--- a/gfs2/edit/gfs2hex.c
+++ b/gfs2/edit/gfs2hex.c
@@ -490,7 +490,7 @@ int display_gfs2(struct gfs2_buffer_head *dbh)
 		switch (mh.mh_type)
 		{
 		case GFS2_METATYPE_SB:
-			gfs2_sb_in(&sbd.sd_sb, dbh);
+			gfs2_sb_in(&sbd.sd_sb, dbh->b_data);
 			gfs2_sb_print2(&sbd.sd_sb);
 			break;
 
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 9997ddb5..a06199e7 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -973,7 +973,7 @@ static void read_superblock(int fd)
 	sbd.qcsize = GFS2_DEFAULT_QCSIZE;
 	sbd.time = time(NULL);
 	sbd.rgtree.osi_node = NULL;
-	gfs2_sb_in(&sbd.sd_sb, bh); /* parse it out into the sb structure */
+	gfs2_sb_in(&sbd.sd_sb, bh->b_data);
 	/* Check to see if this is really gfs1 */
 	if (sbd1->sb_fs_format == GFS_FORMAT_FS &&
 		sbd1->sb_header.mh_type == GFS_METATYPE_SB &&
@@ -1103,7 +1103,7 @@ int display(int identify_only, int trunc_zeros, uint64_t flagref,
 	indirect_blocks = 0;
 	lines_per_row[dmode] = 1;
 	if (gfs2_struct_type == GFS2_METATYPE_SB || blk == 0x10 * (4096 / sbd.bsize)) {
-		gfs2_sb_in(&sbd.sd_sb, bh); /* parse it out into the sb structure */
+		gfs2_sb_in(&sbd.sd_sb, bh->b_data);
 		memset(indirect, 0, sizeof(struct iinfo));
 		indirect->ii[0].block = sbd.sd_sb.sb_master_dir.no_addr;
 		indirect->ii[0].is_dir = TRUE;
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index c4dab490..0b7e4790 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -1059,15 +1059,15 @@ static int restore_super(gzFile gzfd, off_t pos)
 {
 	int ret;
 	struct saved_metablock svb = {0};
-	struct gfs2_buffer_head dummy_bh;
+	char *buf;
 
-	dummy_bh.b_data = calloc(1, sizeof(struct gfs2_sb));
-	if (dummy_bh.b_data == NULL) {
+	buf = calloc(1, sizeof(struct gfs2_sb));
+	if (buf == NULL) {
 		perror("Failed to restore super block");
 		exit(1);
 	}
 	gzseek(gzfd, pos, SEEK_SET);
-	ret = restore_block(gzfd, &svb, dummy_bh.b_data, sizeof(struct gfs2_sb));
+	ret = restore_block(gzfd, &svb, buf, sizeof(struct gfs2_sb));
 	if (ret == 1) {
 		fprintf(stderr, "Reached end of file while restoring superblock\n");
 		goto err;
@@ -1075,7 +1075,7 @@ static int restore_super(gzFile gzfd, off_t pos)
 		goto err;
 	}
 
-	gfs2_sb_in(&sbd.sd_sb, &dummy_bh);
+	gfs2_sb_in(&sbd.sd_sb, buf);
 	sbd1 = (struct gfs_sb *)&sbd.sd_sb;
 	ret = check_sb(&sbd.sd_sb);
 	if (ret < 0) {
@@ -1085,11 +1085,11 @@ static int restore_super(gzFile gzfd, off_t pos)
 	if (ret == 1)
 		sbd.gfs1 = 1;
 	sbd.bsize = sbd.sd_sb.sb_bsize;
-	free(dummy_bh.b_data);
+	free(buf);
 	printf("Block size is %uB\n", sbd.bsize);
 	return 0;
 err:
-	free(dummy_bh.b_data);
+	free(buf);
 	return -1;
 }
 
diff --git a/gfs2/glocktop/glocktop.c b/gfs2/glocktop/glocktop.c
index cef368a0..45d8c497 100644
--- a/gfs2/glocktop/glocktop.c
+++ b/gfs2/glocktop/glocktop.c
@@ -234,7 +234,7 @@ static void read_superblock(int fd, int mntpt)
 
 	ioctl(fd, BLKFLSBUF, 0);
 	bh = bread(&sbd, GFS2_SB_ADDR);
-	gfs2_sb_in(&sd_sb[mntpt], bh); /* parse it out into the sb structure */
+	gfs2_sb_in(&sd_sb[mntpt], bh->b_data);
 	bsize = sd_sb[mntpt].sb_bsize;
 	if (!bsize)
 		bsize = 4096;
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 4f0d4924..0e4ca9d6 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -723,7 +723,7 @@ extern void gfs2_inum_in(struct gfs2_inum *no, char *buf);
 extern void gfs2_inum_out(const struct gfs2_inum *no, char *buf);
 extern void gfs2_meta_header_in(struct gfs2_meta_header *mh, char *buf);
 extern void gfs2_meta_header_out(const struct gfs2_meta_header *mh, char *buf);
-extern void gfs2_sb_in(struct gfs2_sb *sb, struct gfs2_buffer_head *bh);
+extern void gfs2_sb_in(struct gfs2_sb *sb, char *buf);
 extern void gfs2_sb_out(const struct gfs2_sb *sb, char *buf);
 extern void gfs2_rindex_in(struct gfs2_rindex *ri, char *buf);
 extern void gfs2_rindex_out(const struct gfs2_rindex *ri, char *buf);
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index f56717a8..9bcba878 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -91,11 +91,11 @@ void gfs2_meta_header_print(const struct gfs2_meta_header *mh)
 	pv(mh, mh_format, "%u", "0x%x");
 }
 
-void gfs2_sb_in(struct gfs2_sb *sb, struct gfs2_buffer_head *bh)
+void gfs2_sb_in(struct gfs2_sb *sb, char *buf)
 {
-	struct gfs2_sb *str = (struct gfs2_sb *)bh->b_data;
+	struct gfs2_sb *str = (struct gfs2_sb *)buf;
 
-	gfs2_meta_header_in(&sb->sb_header, bh->b_data);
+	gfs2_meta_header_in(&sb->sb_header, buf);
 
 	CPIN_32(sb, str, sb_fs_format);
 	CPIN_32(sb, str, sb_multihost_format);
diff --git a/gfs2/libgfs2/super.c b/gfs2/libgfs2/super.c
index 4b80da2f..6e7d8c23 100644
--- a/gfs2/libgfs2/super.c
+++ b/gfs2/libgfs2/super.c
@@ -57,7 +57,7 @@ int read_sb(struct gfs2_sbd *sdp)
 	int ret;
 
 	bh = bread(sdp, GFS2_SB_ADDR >> sdp->sd_fsb2bb_shift);
-	gfs2_sb_in(&sdp->sd_sb, bh);
+	gfs2_sb_in(&sdp->sd_sb, bh->b_data);
 	brelse(bh);
 
 	ret = check_sb(&sdp->sd_sb);
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Cluster-devel] [PATCH 10/20] libgfs2: Don't use buffer_heads in gfs2_rgrp_in
  2018-03-05 18:25 [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Andrew Price
                   ` (8 preceding siblings ...)
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 09/20] libgfs2: Don't use buffer_heads in gfs2_sb_in Andrew Price
@ 2018-03-05 18:25 ` Andrew Price
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 11/20] libgfs2: Remove gfs2_rgrp_out_bh Andrew Price
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 26+ messages in thread
From: Andrew Price @ 2018-03-05 18:25 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 gfs2/edit/extended.c    | 4 ++--
 gfs2/edit/gfs2hex.c     | 2 +-
 gfs2/edit/hexedit.c     | 2 +-
 gfs2/edit/savemeta.c    | 2 +-
 gfs2/fsck/fs_recovery.c | 2 +-
 gfs2/libgfs2/libgfs2.h  | 2 +-
 gfs2/libgfs2/ondisk.c   | 6 +++---
 gfs2/libgfs2/rgrp.c     | 2 +-
 8 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/gfs2/edit/extended.c b/gfs2/edit/extended.c
index 214fdba4..4bfdb327 100644
--- a/gfs2/edit/extended.c
+++ b/gfs2/edit/extended.c
@@ -561,11 +561,11 @@ static int parse_rindex(struct gfs2_inode *dip, int print_rindex)
 				tmp_bh = bread(&sbd, ri.ri_addr);
 				if (sbd.gfs1) {
 					struct gfs_rgrp rg1;
-					gfs_rgrp_in(&rg1, tmp_bh);
+					gfs_rgrp_in(&rg1, tmp_bh->b_data);
 					gfs_rgrp_print(&rg1);
 				} else {
 					struct gfs2_rgrp rg;
-					gfs2_rgrp_in(&rg, tmp_bh);
+					gfs2_rgrp_in(&rg, tmp_bh->b_data);
 					gfs2_rgrp_print(&rg);
 				}
 				brelse(tmp_bh);
diff --git a/gfs2/edit/gfs2hex.c b/gfs2/edit/gfs2hex.c
index 2d165392..1a12e05e 100644
--- a/gfs2/edit/gfs2hex.c
+++ b/gfs2/edit/gfs2hex.c
@@ -501,7 +501,7 @@ int display_gfs2(struct gfs2_buffer_head *dbh)
 				gfs1_rgrp_in(&rg1, dbh);
 				gfs1_rgrp_print(&rg1);
 			} else {
-				gfs2_rgrp_in(&rg, dbh);
+				gfs2_rgrp_in(&rg, dbh->b_data);
 				gfs2_rgrp_print(&rg);
 			}
 			break;
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index a06199e7..e346ec0d 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -852,7 +852,7 @@ static void set_rgrp_flags(int rgnum, uint32_t new_flags, int modify, int full)
 	if (sbd.gfs1)
 		gfs_rgrp_in(&rg.rg1, rbh);
 	else
-		gfs2_rgrp_in(&rg.rg2, rbh);
+		gfs2_rgrp_in(&rg.rg2, rbh->b_data);
 	if (modify) {
 		printf("RG #%d (block %llu / 0x%llx) rg_flags changed from 0x%08x to 0x%08x\n",
 		       rgnum, (unsigned long long)rgblk,
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 0b7e4790..ac2d984f 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -809,7 +809,7 @@ static int rgrp_read(struct gfs2_sbd *sdp, struct rgrp_tree *rgd)
 	if (sdp->gfs1)
 		gfs_rgrp_in((struct gfs_rgrp *)&rgd->rg, rgd->bits[0].bi_bh);
 	else
-		gfs2_rgrp_in(&rgd->rg, rgd->bits[0].bi_bh);
+		gfs2_rgrp_in(&rgd->rg, rgd->bits[0].bi_bh->b_data);
 	free(bhs);
 	return 0;
 }
diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c
index 4fd28796..740334da 100644
--- a/gfs2/fsck/fs_recovery.c
+++ b/gfs2/fsck/fs_recovery.c
@@ -114,7 +114,7 @@ static void refresh_rgrp(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
 				gfs_rgrp_in((struct gfs_rgrp *)&rgd->rg,
 					    rgd->bits[0].bi_bh);
 			else
-				gfs2_rgrp_in(&rgd->rg, rgd->bits[0].bi_bh);
+				gfs2_rgrp_in(&rgd->rg, rgd->bits[0].bi_bh->b_data);
 		}
 		break;
 	}
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 0e4ca9d6..5c3b7878 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -727,7 +727,7 @@ extern void gfs2_sb_in(struct gfs2_sb *sb, char *buf);
 extern void gfs2_sb_out(const struct gfs2_sb *sb, char *buf);
 extern void gfs2_rindex_in(struct gfs2_rindex *ri, char *buf);
 extern void gfs2_rindex_out(const struct gfs2_rindex *ri, char *buf);
-extern void gfs2_rgrp_in(struct gfs2_rgrp *rg, struct gfs2_buffer_head *bh);
+extern void gfs2_rgrp_in(struct gfs2_rgrp *rg, char *buf);
 extern void gfs2_rgrp_out(const struct gfs2_rgrp *rg, char *buf);
 extern void gfs2_rgrp_out_bh(const struct gfs2_rgrp *rg, struct gfs2_buffer_head *bh);
 extern void gfs2_quota_in(struct gfs2_quota *qu, char *buf);
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index 9bcba878..b9606d76 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -211,11 +211,11 @@ void gfs2_rindex_print(const struct gfs2_rindex *ri)
 	pv(ri, ri_bitbytes, "%u", "0x%x");
 }
 
-void gfs2_rgrp_in(struct gfs2_rgrp *rg, struct gfs2_buffer_head *bh)
+void gfs2_rgrp_in(struct gfs2_rgrp *rg, char *buf)
 {
-	struct gfs2_rgrp *str = (struct gfs2_rgrp *)bh->b_data;
+	struct gfs2_rgrp *str = (struct gfs2_rgrp *)buf;
 
-	gfs2_meta_header_in(&rg->rg_header, bh->b_data);
+	gfs2_meta_header_in(&rg->rg_header, buf);
 	CPIN_32(rg, str, rg_flags);
 	CPIN_32(rg, str, rg_free);
 	CPIN_32(rg, str, rg_dinodes);
diff --git a/gfs2/libgfs2/rgrp.c b/gfs2/libgfs2/rgrp.c
index 6d9d8e7d..6af6bbaf 100644
--- a/gfs2/libgfs2/rgrp.c
+++ b/gfs2/libgfs2/rgrp.c
@@ -242,7 +242,7 @@ uint64_t gfs2_rgrp_read(struct gfs2_sbd *sdp, struct rgrp_tree *rgd)
 			free(bhs);
 			return rgd->ri.ri_addr;
 		}
-		gfs2_rgrp_in(&rgd->rg, rgd->bits[0].bi_bh);
+		gfs2_rgrp_in(&rgd->rg, rgd->bits[0].bi_bh->b_data);
 	}
 	free(bhs);
 	return 0;
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Cluster-devel] [PATCH 11/20] libgfs2: Remove gfs2_rgrp_out_bh
  2018-03-05 18:25 [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Andrew Price
                   ` (9 preceding siblings ...)
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 10/20] libgfs2: Don't use buffer_heads in gfs2_rgrp_in Andrew Price
@ 2018-03-05 18:25 ` Andrew Price
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 12/20] libgfs2: Don't use buffer_heads in gfs2_dinode_in Andrew Price
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 26+ messages in thread
From: Andrew Price @ 2018-03-05 18:25 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 gfs2/convert/gfs2_convert.c |  5 +++--
 gfs2/edit/extended.c        |  2 +-
 gfs2/edit/hexedit.c         |  3 ++-
 gfs2/fsck/initialize.c      |  6 ++++--
 gfs2/fsck/metawalk.c        |  3 ++-
 gfs2/fsck/pass5.c           |  2 +-
 gfs2/fsck/rgrepair.c        |  4 ++--
 gfs2/libgfs2/fs_geometry.c  |  2 +-
 gfs2/libgfs2/fs_ops.c       | 10 ++++++----
 gfs2/libgfs2/libgfs2.h      |  1 -
 gfs2/libgfs2/ondisk.c       |  6 ------
 11 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index 6aac2b0e..e664022e 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -190,7 +190,8 @@ static int convert_rgs(struct gfs2_sbd *sbp)
 		sbp->dinodes_alloced += rgd1->rg_useddi;
 		convert_bitmaps(sbp, rgd);
 		/* Write the updated rgrp to the gfs2 buffer */
-		gfs2_rgrp_out_bh(&rgd->rg, rgd->bits[0].bi_bh);
+		gfs2_rgrp_out(&rgd->rg, rgd->bits[0].bi_bh->b_data);
+		bmodified(rgd->bits[0].bi_bh);
 		rgs++;
 		if (rgs % 100 == 0) {
 			printf(".");
@@ -1880,7 +1881,7 @@ static int journ_space_to_rg(struct gfs2_sbd *sdp)
 			if (x)
 				gfs2_meta_header_out(&mh, rgd->bits[x].bi_bh->b_data);
 			else
-				gfs2_rgrp_out_bh(&rgd->rg, rgd->bits[x].bi_bh);
+				gfs2_rgrp_out(&rgd->rg, rgd->bits[x].bi_bh->b_data);
 			bmodified(rgd->bits[x].bi_bh);
 		}
 	} /* for each journal */
diff --git a/gfs2/edit/extended.c b/gfs2/edit/extended.c
index 4bfdb327..d24d7550 100644
--- a/gfs2/edit/extended.c
+++ b/gfs2/edit/extended.c
@@ -561,7 +561,7 @@ static int parse_rindex(struct gfs2_inode *dip, int print_rindex)
 				tmp_bh = bread(&sbd, ri.ri_addr);
 				if (sbd.gfs1) {
 					struct gfs_rgrp rg1;
-					gfs_rgrp_in(&rg1, tmp_bh->b_data);
+					gfs_rgrp_in(&rg1, tmp_bh);
 					gfs_rgrp_print(&rg1);
 				} else {
 					struct gfs2_rgrp rg;
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index e346ec0d..8100136b 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -861,7 +861,8 @@ static void set_rgrp_flags(int rgnum, uint32_t new_flags, int modify, int full)
 		if (sbd.gfs1)
 			gfs_rgrp_out(&rg.rg1, rbh);
 		else
-			gfs2_rgrp_out_bh(&rg.rg2, rbh);
+			gfs2_rgrp_out(&rg.rg2, rbh->b_data);
+		bmodified(rbh);
 		brelse(rbh);
 	} else {
 		if (full) {
diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index badbf507..2a604172 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -326,7 +326,8 @@ static void check_rgrp_integrity(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
 		if (sdp->gfs1)
 			gfs_rgrp_out((struct gfs_rgrp *)&rgd->rg, rgd->bits[0].bi_bh);
 		else
-			gfs2_rgrp_out_bh(&rgd->rg, rgd->bits[0].bi_bh);
+			gfs2_rgrp_out(&rgd->rg, rgd->bits[0].bi_bh->b_data);
+		bmodified(rgd->bits[0].bi_bh);
 		*this_rg_cleaned = 1;
 		log_info( _("The rgrp at %lld (0x%llx) was cleaned of %d "
 			    "free metadata blocks.\n"),
@@ -347,7 +348,8 @@ static void check_rgrp_integrity(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
 			if (sdp->gfs1)
 				gfs_rgrp_out((struct gfs_rgrp *)&rgd->rg, rgd->bits[0].bi_bh);
 			else
-				gfs2_rgrp_out_bh(&rgd->rg, rgd->bits[0].bi_bh);
+				gfs2_rgrp_out(&rgd->rg, rgd->bits[0].bi_bh->b_data);
+			bmodified(rgd->bits[0].bi_bh);
 			*this_rg_fixed = 1;
 			log_err( _("The rgrp was fixed.\n"));
 		} else
diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index 4d6dcfae..78c5b8aa 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -157,7 +157,8 @@ int check_n_fix_bitmap(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
 		if (sdp->gfs1)
 			gfs_rgrp_out((struct gfs_rgrp *)&rgd->rg, rgd->bits[0].bi_bh);
 		else
-			gfs2_rgrp_out_bh(&rgd->rg, rgd->bits[0].bi_bh);
+			gfs2_rgrp_out(&rgd->rg, rgd->bits[0].bi_bh->b_data);
+		bmodified(rgd->bits[0].bi_bh);
 	}
 	log_err( _("The bitmap was fixed.\n"));
 	return 0;
diff --git a/gfs2/fsck/pass5.c b/gfs2/fsck/pass5.c
index 554f39f9..62341940 100644
--- a/gfs2/fsck/pass5.c
+++ b/gfs2/fsck/pass5.c
@@ -203,7 +203,7 @@ static void update_rgrp(struct gfs2_sbd *sdp, struct rgrp_tree *rgp,
 			if (sdp->gfs1)
 				gfs_rgrp_out(gfs1rg, rgp->bits[0].bi_bh);
 			else
-				gfs2_rgrp_out_bh(&rgp->rg, rgp->bits[0].bi_bh);
+				gfs2_rgrp_out(&rgp->rg, rgp->bits[0].bi_bh->b_data);
 		} else
 			log_err( _("Resource group counts left inconsistent\n"));
 	}
diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c
index 0fa5a4ae..b772ec65 100644
--- a/gfs2/fsck/rgrepair.c
+++ b/gfs2/fsck/rgrepair.c
@@ -898,7 +898,6 @@ static int rewrite_rg_block(struct gfs2_sbd *sdp, struct rgrp_tree *rg,
 			mh.mh_type = GFS2_METATYPE_RB;
 			mh.mh_format = GFS2_FORMAT_RB;
 			gfs2_meta_header_out(&mh, rg->bits[x].bi_bh->b_data);
-			bmodified(rg->bits[x].bi_bh);
 		} else {
 			if (sdp->gfs1)
 				memset(&rg->rg, 0, sizeof(struct gfs_rgrp));
@@ -911,8 +910,9 @@ static int rewrite_rg_block(struct gfs2_sbd *sdp, struct rgrp_tree *rg,
 			if (sdp->gfs1)
 				gfs_rgrp_out((struct gfs_rgrp *)&rg->rg, rg->bits[x].bi_bh);
 			else
-				gfs2_rgrp_out_bh(&rg->rg, rg->bits[x].bi_bh);
+				gfs2_rgrp_out(&rg->rg, rg->bits[x].bi_bh->b_data);
 		}
+		bmodified(rg->bits[x].bi_bh);
 		brelse(rg->bits[x].bi_bh);
 		rg->bits[x].bi_bh = NULL;
 		return 0;
diff --git a/gfs2/libgfs2/fs_geometry.c b/gfs2/libgfs2/fs_geometry.c
index 07d6c647..df8a13a9 100644
--- a/gfs2/libgfs2/fs_geometry.c
+++ b/gfs2/libgfs2/fs_geometry.c
@@ -91,7 +91,7 @@ int build_rgrps(struct gfs2_sbd *sdp, int do_write)
 				if (x)
 					gfs2_meta_header_out(&mh, rl->bits[x].bi_bh->b_data);
 				else
-					gfs2_rgrp_out_bh(&rl->rg, rl->bits[x].bi_bh);
+					gfs2_rgrp_out(&rl->rg, rl->bits[x].bi_bh->b_data);
 				bmodified(rl->bits[x].bi_bh);
 			}
 		}
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index 288c40c7..d6ce64aa 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -158,8 +158,8 @@ static int blk_alloc_in_rg(struct gfs2_sbd *sdp, unsigned state, struct rgrp_tre
 	if (sdp->gfs1)
 		gfs_rgrp_out((struct gfs_rgrp *)&rgd->rg, rgd->bits[0].bi_bh);
 	else
-		gfs2_rgrp_out_bh(&rgd->rg, rgd->bits[0].bi_bh);
-
+		gfs2_rgrp_out(&rgd->rg, rgd->bits[0].bi_bh->b_data);
+	bmodified(rgd->bits[0].bi_bh);
 	sdp->blks_alloced++;
 	return 0;
 }
@@ -1931,7 +1931,8 @@ void gfs2_free_block(struct gfs2_sbd *sdp, uint64_t block)
 		if (sdp->gfs1)
 			gfs_rgrp_out((struct gfs_rgrp *)&rgd->rg, rgd->bits[0].bi_bh);
 		else
-			gfs2_rgrp_out_bh(&rgd->rg, rgd->bits[0].bi_bh);
+			gfs2_rgrp_out(&rgd->rg, rgd->bits[0].bi_bh->b_data);
+		bmodified(rgd->bits[0].bi_bh);
 		sdp->blks_alloced--;
 	}
 }
@@ -2000,7 +2001,8 @@ int gfs2_freedi(struct gfs2_sbd *sdp, uint64_t diblock)
 	if (sdp->gfs1)
 		gfs_rgrp_out((struct gfs_rgrp *)&rgd->rg, rgd->bits[0].bi_bh);
 	else
-		gfs2_rgrp_out_bh(&rgd->rg, rgd->bits[0].bi_bh);
+		gfs2_rgrp_out(&rgd->rg, rgd->bits[0].bi_bh->b_data);
+	bmodified(rgd->bits[0].bi_bh);
 	sdp->dinodes_alloced--;
 	return 0;
 }
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 5c3b7878..bdc8f364 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -729,7 +729,6 @@ extern void gfs2_rindex_in(struct gfs2_rindex *ri, char *buf);
 extern void gfs2_rindex_out(const struct gfs2_rindex *ri, char *buf);
 extern void gfs2_rgrp_in(struct gfs2_rgrp *rg, char *buf);
 extern void gfs2_rgrp_out(const struct gfs2_rgrp *rg, char *buf);
-extern void gfs2_rgrp_out_bh(const struct gfs2_rgrp *rg, struct gfs2_buffer_head *bh);
 extern void gfs2_quota_in(struct gfs2_quota *qu, char *buf);
 extern void gfs2_quota_out(struct gfs2_quota *qu, char *buf);
 extern void gfs2_dinode_in(struct gfs2_dinode *di,
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index b9606d76..1c68354a 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -261,12 +261,6 @@ void gfs2_rgrp_out(const struct gfs2_rgrp *rg, char *buf)
 #endif
 }
 
-void gfs2_rgrp_out_bh(const struct gfs2_rgrp *rg, struct gfs2_buffer_head *bh)
-{
-	gfs2_rgrp_out(rg, bh->iov.iov_base);
-	bmodified(bh);
-}
-
 void gfs2_rgrp_print(const struct gfs2_rgrp *rg)
 {
 	gfs2_meta_header_print(&rg->rg_header);
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Cluster-devel] [PATCH 12/20] libgfs2: Don't use buffer_heads in gfs2_dinode_in
  2018-03-05 18:25 [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Andrew Price
                   ` (10 preceding siblings ...)
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 11/20] libgfs2: Remove gfs2_rgrp_out_bh Andrew Price
@ 2018-03-05 18:25 ` Andrew Price
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 13/20] libgfs2: Remove gfs2_dinode_out_bh Andrew Price
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 26+ messages in thread
From: Andrew Price @ 2018-03-05 18:25 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 gfs2/edit/hexedit.c    | 4 ++--
 gfs2/edit/journal.c    | 4 ++--
 gfs2/edit/savemeta.c   | 2 +-
 gfs2/fsck/initialize.c | 2 +-
 gfs2/libgfs2/fs_ops.c  | 2 +-
 gfs2/libgfs2/libgfs2.h | 3 +--
 gfs2/libgfs2/ondisk.c  | 6 +++---
 7 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 8100136b..5cdea684 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -1056,7 +1056,7 @@ static int read_master_dir(void)
 	bh = bread(&sbd, sbd.sd_sb.sb_master_dir.no_addr);
 	if (bh == NULL)
 		return 1;
-	gfs2_dinode_in(&di, bh); /* parse disk inode into structure */
+	gfs2_dinode_in(&di, bh->b_data);
 	do_dinode_extended(&di, bh); /* get extended data, if any */
 	memcpy(&masterdir, &indirect[0], sizeof(struct indirect_info));
 	return 0;
@@ -1127,7 +1127,7 @@ int display(int identify_only, int trunc_zeros, uint64_t flagref,
 		indirect->ii[0].dirent[1].dirent.de_type = DT_DIR;
 	}
 	else if (gfs2_struct_type == GFS2_METATYPE_DI) {
-		gfs2_dinode_in(&di, bh); /* parse disk inode into structure */
+		gfs2_dinode_in(&di, bh->b_data);
 		do_dinode_extended(&di, bh); /* get extended data, if any */
 	}
 	else if (gfs2_struct_type == GFS2_METATYPE_IN) { /* indirect block list */
diff --git a/gfs2/edit/journal.c b/gfs2/edit/journal.c
index ff0c6df9..6ec1b2a5 100644
--- a/gfs2/edit/journal.c
+++ b/gfs2/edit/journal.c
@@ -54,7 +54,7 @@ uint64_t find_journal_block(const char *journal, uint64_t *j_size)
 	/* read in the block */
 	jindex_bh = bread(&sbd, jindex_block);
 	/* get the dinode data from it. */
-	gfs2_dinode_in(&di, jindex_bh); /* parse disk inode to struct*/
+	gfs2_dinode_in(&di, jindex_bh->b_data);
 
 	if (!sbd.gfs1)
 		do_dinode_extended(&di, jindex_bh); /* parse dir. */
@@ -82,7 +82,7 @@ uint64_t find_journal_block(const char *journal, uint64_t *j_size)
 			return 0;
 		jblock = indirect->ii[0].dirent[journal_num + 2].block;
 		j_bh = bread(&sbd, jblock);
-		gfs2_dinode_in(&jdi, j_bh);/* parse dinode to struct */
+		gfs2_dinode_in(&jdi, j_bh->b_data);
 		*j_size = jdi.di_size;
 		brelse(j_bh);
 	}
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index ac2d984f..6d87f33d 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -901,7 +901,7 @@ void savemeta(char *out_fn, int saveoption, int gziplevel)
 	else
 		jindex_block = masterblock("jindex");
 	lbh = bread(&sbd, jindex_block);
-	gfs2_dinode_in(&di, lbh);
+	gfs2_dinode_in(&di, lbh->b_data);
 	if (!sbd.gfs1)
 		do_dinode_extended(&di, lbh);
 	brelse(lbh);
diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index 2a604172..ebe62b9f 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -1175,7 +1175,7 @@ static int peruse_metadata(struct gfs2_sbd *sdp, uint64_t startblock)
 			brelse(bh);
 			continue;
 		}
-		gfs2_dinode_in(&di, bh);
+		gfs2_dinode_in(&di, bh->b_data);
 		if (di.di_flags & GFS2_DIF_SYSTEM)
 			peruse_system_dinode(sdp, &di, bh);
 		else
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index d6ce64aa..6f7c422a 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -39,7 +39,7 @@ struct gfs2_inode *lgfs2_inode_get(struct gfs2_sbd *sdp, struct gfs2_buffer_head
 	if (ip == NULL) {
 		return NULL;
 	}
-	gfs2_dinode_in(&ip->i_di, bh);
+	gfs2_dinode_in(&ip->i_di, bh->b_data);
 	ip->i_bh = bh;
 	ip->i_sbd = sdp;
 	return ip;
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index bdc8f364..5fe1154f 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -731,8 +731,7 @@ extern void gfs2_rgrp_in(struct gfs2_rgrp *rg, char *buf);
 extern void gfs2_rgrp_out(const struct gfs2_rgrp *rg, char *buf);
 extern void gfs2_quota_in(struct gfs2_quota *qu, char *buf);
 extern void gfs2_quota_out(struct gfs2_quota *qu, char *buf);
-extern void gfs2_dinode_in(struct gfs2_dinode *di,
-			   struct gfs2_buffer_head *bh);
+extern void gfs2_dinode_in(struct gfs2_dinode *di, char *buf);
 extern void gfs2_dinode_out(struct gfs2_dinode *di, char *buf);
 extern void gfs2_dinode_out_bh(struct gfs2_dinode *di, struct gfs2_buffer_head *bh);
 extern void gfs2_dirent_in(struct gfs2_dirent *de, char *buf);
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index 1c68354a..b54a6389 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -308,11 +308,11 @@ void gfs2_quota_print(const struct gfs2_quota *qu)
 	pv(qu, qu_value, "%lld", "0x%llx");
 }
 
-void gfs2_dinode_in(struct gfs2_dinode *di, struct gfs2_buffer_head *bh)
+void gfs2_dinode_in(struct gfs2_dinode *di, char *buf)
 {
-	struct gfs2_dinode *str = (struct gfs2_dinode *)bh->b_data;
+	struct gfs2_dinode *str = (struct gfs2_dinode *)buf;
 
-	gfs2_meta_header_in(&di->di_header, bh->b_data);
+	gfs2_meta_header_in(&di->di_header, buf);
 	gfs2_inum_in(&di->di_num, (char *)&str->di_num);
 
 	CPIN_32(di, str, di_mode);
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Cluster-devel] [PATCH 13/20] libgfs2: Remove gfs2_dinode_out_bh
  2018-03-05 18:25 [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Andrew Price
                   ` (11 preceding siblings ...)
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 12/20] libgfs2: Don't use buffer_heads in gfs2_dinode_in Andrew Price
@ 2018-03-05 18:25 ` Andrew Price
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 14/20] libgfs2: Don't use buffer_heads in gfs2_leaf_{in, out} Andrew Price
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 26+ messages in thread
From: Andrew Price @ 2018-03-05 18:25 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 gfs2/convert/gfs2_convert.c |  2 +-
 gfs2/fsck/lost_n_found.c    |  2 +-
 gfs2/fsck/rgrepair.c        |  3 +--
 gfs2/libgfs2/fs_ops.c       | 13 ++++++-------
 gfs2/libgfs2/gfs1.c         |  5 ++---
 gfs2/libgfs2/libgfs2.h      |  1 -
 gfs2/libgfs2/ondisk.c       |  6 ------
 gfs2/libgfs2/structures.c   |  8 ++++----
 8 files changed, 15 insertions(+), 25 deletions(-)

diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index e664022e..d2b29f34 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -2323,7 +2323,7 @@ int main(int argc, char **argv)
 		{
 			struct gfs2_inode *ip = sb2.master_dir;
 			if (ip->i_bh->b_modified)
-				gfs2_dinode_out_bh(&ip->i_di, ip->i_bh);
+				gfs2_dinode_out(&ip->i_di, ip->i_bh->b_data);
 		}
 		/* Copy old quotas */
 		copy_quotas(&sb2);
diff --git a/gfs2/fsck/lost_n_found.c b/gfs2/fsck/lost_n_found.c
index 2722b29d..4d5d52c8 100644
--- a/gfs2/fsck/lost_n_found.c
+++ b/gfs2/fsck/lost_n_found.c
@@ -253,7 +253,7 @@ int add_inode_to_lf(struct gfs2_inode *ip){
 	log_notice( _("Added inode #%llu (0x%llx) to lost+found\n"),
 		    (unsigned long long)ip->i_di.di_num.no_addr,
 		    (unsigned long long)ip->i_di.di_num.no_addr);
-	gfs2_dinode_out_bh(&lf_dip->i_di, lf_dip->i_bh);
+	gfs2_dinode_out(&lf_dip->i_di, lf_dip->i_bh->b_data);
 	bwrite(lf_dip->i_bh);
 	return 0;
 }
diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c
index b772ec65..e64f70df 100644
--- a/gfs2/fsck/rgrepair.c
+++ b/gfs2/fsck/rgrepair.c
@@ -1237,8 +1237,7 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count, int *sane)
 	   permission. */
 	if (sdp->md.riinode->i_bh->b_modified) {
 		log_debug("Syncing rindex inode changes to disk.\n");
-		gfs2_dinode_out_bh(&sdp->md.riinode->i_di,
-		                    sdp->md.riinode->i_bh);
+		gfs2_dinode_out(&sdp->md.riinode->i_di, sdp->md.riinode->i_bh->b_data);
 		bwrite(sdp->md.riinode->i_bh);
 	}
 	return 0;
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index 6f7c422a..7e87e435 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -95,7 +95,7 @@ void inode_put(struct gfs2_inode **ip_in)
 	struct gfs2_sbd *sdp = ip->i_sbd;
 
 	if (ip->i_bh->b_modified) {
-		gfs2_dinode_out_bh(&ip->i_di, ip->i_bh);
+		gfs2_dinode_out(&ip->i_di, ip->i_bh->b_data);
 		if (!ip->bh_owned && is_system_inode(sdp, block))
 			fprintf(stderr, "Warning: Change made to inode "
 				"were discarded.\n");
@@ -1324,7 +1324,7 @@ static void dir_make_exhash(struct gfs2_inode *dip)
 	for (x = sdp->sd_hash_ptrs, y = -1; x; x >>= 1, y++) ;
 	dip->i_di.di_depth = y;
 
-	gfs2_dinode_out_bh(&dip->i_di, dip->i_bh);
+	gfs2_dinode_out(&dip->i_di, dip->i_bh->b_data);
 	bwrite(dip->i_bh);
 }
 
@@ -1430,9 +1430,8 @@ static int __init_dinode(struct gfs2_sbd *sdp, struct gfs2_buffer_head **bhp, st
 		di.di_payload_format = GFS2_FORMAT_DE;
 		di.di_entries = 2;
 	}
-
-	gfs2_dinode_out_bh(&di, bh);
-
+	gfs2_dinode_out(&di, bh->b_data);
+	bmodified(bh);
 	return 0;
 }
 
@@ -1494,13 +1493,13 @@ int lgfs2_write_filemeta(struct gfs2_inode *ip)
 			char *start = bh->b_data;
 			if (height == 0) {
 				start += sizeof(struct gfs2_dinode);
-				gfs2_dinode_out_bh(&ip->i_di, bh);
+				gfs2_dinode_out(&ip->i_di, bh->b_data);
 			} else {
 				start += sizeof(struct gfs2_meta_header);
 				gfs2_meta_header_out(&mh, bh->b_data);
 			}
 			lgfs2_fill_indir(start, bh->b_data + sdp->bsize, ptr0, ptrs, &p);
-			if(bwrite(bh)) {
+			if (bwrite(bh)) {
 				free(bh);
 				return 1;
 			}
diff --git a/gfs2/libgfs2/gfs1.c b/gfs2/libgfs2/gfs1.c
index 00d32238..b91cce5e 100644
--- a/gfs2/libgfs2/gfs1.c
+++ b/gfs2/libgfs2/gfs1.c
@@ -243,9 +243,8 @@ int gfs1_writei(struct gfs2_inode *ip, char *buf, uint64_t offset,
 		ip->i_di.di_size = start + copied;
 	}
 	ip->i_di.di_mtime = ip->i_di.di_ctime = time(NULL);
-
-	gfs2_dinode_out_bh(&ip->i_di, ip->i_bh);
-
+	gfs2_dinode_out(&ip->i_di, ip->i_bh->b_data);
+	bmodified(ip->i_bh);
 	return copied;
 }
 
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 5fe1154f..7b2671b5 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -733,7 +733,6 @@ extern void gfs2_quota_in(struct gfs2_quota *qu, char *buf);
 extern void gfs2_quota_out(struct gfs2_quota *qu, char *buf);
 extern void gfs2_dinode_in(struct gfs2_dinode *di, char *buf);
 extern void gfs2_dinode_out(struct gfs2_dinode *di, char *buf);
-extern void gfs2_dinode_out_bh(struct gfs2_dinode *di, struct gfs2_buffer_head *bh);
 extern void gfs2_dirent_in(struct gfs2_dirent *de, char *buf);
 extern void gfs2_dirent_out(struct gfs2_dirent *de, char *buf);
 extern void gfs2_leaf_in(struct gfs2_leaf *lf, struct gfs2_buffer_head *bh);
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index b54a6389..51dc004f 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -378,12 +378,6 @@ void gfs2_dinode_out(struct gfs2_dinode *di, char *buf)
 	CPOUT_08(di, str, di_reserved, 32);
 }
 
-void gfs2_dinode_out_bh(struct gfs2_dinode *di, struct gfs2_buffer_head *bh)
-{
-	gfs2_dinode_out(di, bh->iov.iov_base);
-	bmodified(bh);
-}
-
 void gfs2_dinode_print(const struct gfs2_dinode *di)
 {
 	gfs2_meta_header_print(&di->di_header);
diff --git a/gfs2/libgfs2/structures.c b/gfs2/libgfs2/structures.c
index aaa76994..51e7d077 100644
--- a/gfs2/libgfs2/structures.c
+++ b/gfs2/libgfs2/structures.c
@@ -347,8 +347,8 @@ int build_inum_range(struct gfs2_inode *per_node, unsigned int j)
 		return errno;
 	}
 	ip->i_di.di_size = sizeof(struct gfs2_inum_range);
-	gfs2_dinode_out_bh(&ip->i_di, ip->i_bh);
-
+	gfs2_dinode_out(&ip->i_di, ip->i_bh->b_data);
+	bmodified(ip->i_bh);
 	if (cfg_debug) {
 		printf("\nInum Range %u:\n", j);
 		gfs2_dinode_print(&ip->i_di);
@@ -370,8 +370,8 @@ int build_statfs_change(struct gfs2_inode *per_node, unsigned int j)
 		return errno;
 	}
 	ip->i_di.di_size = sizeof(struct gfs2_statfs_change);
-	gfs2_dinode_out_bh(&ip->i_di, ip->i_bh);
-
+	gfs2_dinode_out(&ip->i_di, ip->i_bh->b_data);
+	bmodified(ip->i_bh);
 	if (cfg_debug) {
 		printf("\nStatFS Change %u:\n", j);
 		gfs2_dinode_print(&ip->i_di);
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Cluster-devel] [PATCH 14/20] libgfs2: Don't use buffer_heads in gfs2_leaf_{in, out}
  2018-03-05 18:25 [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Andrew Price
                   ` (12 preceding siblings ...)
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 13/20] libgfs2: Remove gfs2_dinode_out_bh Andrew Price
@ 2018-03-05 18:25 ` Andrew Price
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 15/20] libgfs2: Don't use buffer_heads in gfs2_log_header_in Andrew Price
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 26+ messages in thread
From: Andrew Price @ 2018-03-05 18:25 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 gfs2/convert/gfs2_convert.c |  2 +-
 gfs2/edit/gfs2hex.c         |  8 +++-----
 gfs2/edit/savemeta.c        |  2 +-
 gfs2/fsck/metawalk.c        | 10 ++++++----
 gfs2/fsck/pass2.c           |  6 +++---
 gfs2/libgfs2/libgfs2.h      |  4 ++--
 gfs2/libgfs2/ondisk.c       | 13 ++++++-------
 7 files changed, 22 insertions(+), 23 deletions(-)

diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index d2b29f34..eac907cd 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -1303,7 +1303,7 @@ static int fix_one_directory_exhash(struct gfs2_sbd *sbp, struct gfs2_inode *dip
 				 (unsigned long long)leaf_block);
 			break;
 		}
-		gfs2_leaf_in(&leaf, bh_leaf); /* buffer to structure */
+		gfs2_leaf_in(&leaf, bh_leaf->b_data);
 		error = process_dirent_info(dip, sbp, bh_leaf, leaf.lf_entries, dentmod);
 		bmodified(bh_leaf);
 		brelse(bh_leaf);
diff --git a/gfs2/edit/gfs2hex.c b/gfs2/edit/gfs2hex.c
index 1a12e05e..c1aa81a8 100644
--- a/gfs2/edit/gfs2hex.c
+++ b/gfs2/edit/gfs2hex.c
@@ -298,7 +298,7 @@ void do_dinode_extended(struct gfs2_dinode *dine, struct gfs2_buffer_head *lbh)
 				if (last >= max_block)
 					break;
 				tmp_bh = bread(&sbd, last);
-				gfs2_leaf_in(&leaf, tmp_bh);
+				gfs2_leaf_in(&leaf, tmp_bh->b_data);
 				indirect->ii[indirect_blocks].dirents = 0;
 				for (direntcount = 0, bufoffset = sizeof(struct gfs2_leaf);
 					 bufoffset < sbd.bsize;
@@ -325,12 +325,10 @@ uint64_t do_leaf_extended(char *dlebuf, struct iinfo *indir)
 {
 	int x, i;
 	struct gfs2_dirent de;
-	struct gfs2_buffer_head tbh; /* kludge */
 
 	x = 0;
 	memset(indir, 0, sizeof(*indir));
-	tbh.b_data = dlebuf;
-	gfs2_leaf_in(&indir->ii[0].lf, &tbh);
+	gfs2_leaf_in(&indir->ii[0].lf, dlebuf);
 	/* Directory Entries: */
 	for (i = sizeof(struct gfs2_leaf); i < sbd.bsize;
 	     i += de.de_rec_len) {
@@ -519,7 +517,7 @@ int display_gfs2(struct gfs2_buffer_head *dbh)
 			break;
 
 		case GFS2_METATYPE_LF:
-			gfs2_leaf_in(&lf, dbh);
+			gfs2_leaf_in(&lf, dbh->b_data);
 			gfs2_leaf_print(&lf);
 			break;
 
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 6d87f33d..25fd7bc1 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -574,7 +574,7 @@ static int save_leaf_chain(struct metafd *mfd, struct gfs2_sbd *sdp, uint64_t bl
 				return ret;
 			}
 		}
-		gfs2_leaf_in(&leaf, bh);
+		gfs2_leaf_in(&leaf, bh->b_data);
 		brelse(bh);
 		blk = leaf.lf_next;
 	} while (leaf.lf_next != 0);
diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index 78c5b8aa..127edaa2 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -583,12 +583,13 @@ int check_leaf(struct gfs2_inode *ip, int lindex, struct metawalk_fxns *pass,
 	   to use cpu_to_be32(), but we should check for incorrect values and
 	   replace them with the correct value. */
 
-	gfs2_leaf_in(leaf, lbh);
+	gfs2_leaf_in(leaf, lbh->b_data);
 	if (leaf->lf_dirent_format == (GFS2_FORMAT_DE << 16)) {
 		log_debug( _("incorrect lf_dirent_format@leaf #%" PRIu64
 			     "\n"), *leaf_no);
 		leaf->lf_dirent_format = GFS2_FORMAT_DE;
-		gfs2_leaf_out(leaf, lbh);
+		gfs2_leaf_out(leaf, lbh->b_data);
+		bmodified(lbh);
 		log_debug( _("Fixing lf_dirent_format.\n"));
 	}
 
@@ -623,7 +624,7 @@ int check_leaf(struct gfs2_inode *ip, int lindex, struct metawalk_fxns *pass,
 		   changed it. */
 		brelse(lbh);
 		lbh = bread(sdp, *leaf_no);
-		gfs2_leaf_in(leaf, lbh);
+		gfs2_leaf_in(leaf, lbh->b_data);
 		if (count != leaf->lf_entries) {
 			log_err( _("Leaf %llu (0x%llx) entry count in "
 				   "directory %llu (0x%llx) does not match "
@@ -635,7 +636,8 @@ int check_leaf(struct gfs2_inode *ip, int lindex, struct metawalk_fxns *pass,
 				 leaf->lf_entries, count);
 			if (query( _("Update leaf entry count? (y/n) "))) {
 				leaf->lf_entries = count;
-				gfs2_leaf_out(leaf, lbh);
+				gfs2_leaf_out(leaf, lbh->b_data);
+				bmodified(lbh);
 				log_warn( _("Leaf entry count updated\n"));
 			} else
 				log_err( _("Leaf entry count left in "
diff --git a/gfs2/fsck/pass2.c b/gfs2/fsck/pass2.c
index abc2b960..763e39a9 100644
--- a/gfs2/fsck/pass2.c
+++ b/gfs2/fsck/pass2.c
@@ -1496,7 +1496,7 @@ static int fix_hashtable(struct gfs2_inode *ip, uint64_t *tbl, unsigned hsize,
 		new_leaf_blk = find_free_blk(ip->i_sbd);
 		dir_split_leaf(ip, lindex, leafblk, lbh);
 		/* re-read the leaf to pick up dir_split_leaf's changes */
-		gfs2_leaf_in(&leaf, lbh);
+		gfs2_leaf_in(&leaf, lbh->b_data);
 		*proper_len = 1 << (ip->i_di.di_depth - leaf.lf_depth);
 		log_err(_("Leaf block %llu (0x%llx) was split from length "
 			  "%d to %d\n"), (unsigned long long)leafblk,
@@ -1793,7 +1793,7 @@ static int check_hash_tbl(struct gfs2_inode *ip, uint64_t *tbl,
 				(unsigned long long)leafblk,
 				proper_len, proper_len);
 			lbh = bread(ip->i_sbd, leafblk);
-			gfs2_leaf_in(&leaf, lbh);
+			gfs2_leaf_in(&leaf, lbh->b_data);
 			if (gfs2_check_meta(lbh, GFS2_METATYPE_LF) ||
 			    leaf.lf_depth > ip->i_di.di_depth)
 				leaf.lf_depth = factor;
@@ -1833,7 +1833,7 @@ static int check_hash_tbl(struct gfs2_inode *ip, uint64_t *tbl,
 			/* Now we have to determine if the hash table is
 			   corrupt, or if the leaf has the wrong depth. */
 			lbh = bread(ip->i_sbd, leafblk);
-			gfs2_leaf_in(&leaf, lbh);
+			gfs2_leaf_in(&leaf, lbh->b_data);
 			brelse(lbh);
 			/* Calculate the expected pointer count based on the
 			   leaf depth. */
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 7b2671b5..71b4e5e8 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -735,8 +735,8 @@ extern void gfs2_dinode_in(struct gfs2_dinode *di, char *buf);
 extern void gfs2_dinode_out(struct gfs2_dinode *di, char *buf);
 extern void gfs2_dirent_in(struct gfs2_dirent *de, char *buf);
 extern void gfs2_dirent_out(struct gfs2_dirent *de, char *buf);
-extern void gfs2_leaf_in(struct gfs2_leaf *lf, struct gfs2_buffer_head *bh);
-extern void gfs2_leaf_out(struct gfs2_leaf *lf, struct gfs2_buffer_head *bh);
+extern void gfs2_leaf_in(struct gfs2_leaf *lf, char *buf);
+extern void gfs2_leaf_out(struct gfs2_leaf *lf, char *buf);
 extern void gfs2_ea_header_in(struct gfs2_ea_header *ea, char *buf);
 extern void gfs2_log_header_v1_in(struct gfs2_log_header *lh, struct gfs2_buffer_head *bh);
 extern void gfs2_log_header_in(struct gfs2_log_header *lh, struct gfs2_buffer_head *bh);
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index 51dc004f..04f3ce2c 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -452,11 +452,11 @@ void gfs2_dirent_out(struct gfs2_dirent *de, char *buf)
 #endif /* GFS2_HAS_DE_RAHEAD */
 }
 
-void gfs2_leaf_in(struct gfs2_leaf *lf, struct gfs2_buffer_head *bh)
+void gfs2_leaf_in(struct gfs2_leaf *lf, char *buf)
 {
-	struct gfs2_leaf *str = (struct gfs2_leaf *)bh->b_data;
+	struct gfs2_leaf *str = (struct gfs2_leaf *)buf;
 
-	gfs2_meta_header_in(&lf->lf_header, bh->b_data);
+	gfs2_meta_header_in(&lf->lf_header, buf);
 	CPIN_16(lf, str, lf_depth);
 	CPIN_16(lf, str, lf_entries);
 	CPIN_32(lf, str, lf_dirent_format);
@@ -472,11 +472,11 @@ void gfs2_leaf_in(struct gfs2_leaf *lf, struct gfs2_buffer_head *bh)
 #endif
 }
 
-void gfs2_leaf_out(struct gfs2_leaf *lf, struct gfs2_buffer_head *bh)
+void gfs2_leaf_out(struct gfs2_leaf *lf, char *buf)
 {
-	struct gfs2_leaf *str = (struct gfs2_leaf *)bh->b_data;
+	struct gfs2_leaf *str = (struct gfs2_leaf *)buf;
 
-	gfs2_meta_header_out(&lf->lf_header, bh->b_data);
+	gfs2_meta_header_out(&lf->lf_header, buf);
 	CPOUT_16(lf, str, lf_depth);
 	CPOUT_16(lf, str, lf_entries);
 	CPOUT_32(lf, str, lf_dirent_format);
@@ -490,7 +490,6 @@ void gfs2_leaf_out(struct gfs2_leaf *lf, struct gfs2_buffer_head *bh)
 #else
 	CPOUT_08(lf, str, lf_reserved, 64);
 #endif
-	bmodified(bh);
 }
 
 void gfs2_leaf_print(const struct gfs2_leaf *lf)
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Cluster-devel] [PATCH 15/20] libgfs2: Don't use buffer_heads in gfs2_log_header_in
  2018-03-05 18:25 [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Andrew Price
                   ` (13 preceding siblings ...)
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 14/20] libgfs2: Don't use buffer_heads in gfs2_leaf_{in, out} Andrew Price
@ 2018-03-05 18:25 ` Andrew Price
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 16/20] libgfs2: Remove gfs2_log_header_out_bh Andrew Price
                   ` (5 subsequent siblings)
  20 siblings, 0 replies; 26+ messages in thread
From: Andrew Price @ 2018-03-05 18:25 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 gfs2/edit/gfs2hex.c     |  2 +-
 gfs2/edit/journal.c     |  4 ++--
 gfs2/libgfs2/libgfs2.h  |  4 ++--
 gfs2/libgfs2/ondisk.c   | 12 ++++++------
 gfs2/libgfs2/recovery.c |  2 +-
 5 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/gfs2/edit/gfs2hex.c b/gfs2/edit/gfs2hex.c
index c1aa81a8..a4dd454e 100644
--- a/gfs2/edit/gfs2hex.c
+++ b/gfs2/edit/gfs2hex.c
@@ -530,7 +530,7 @@ int display_gfs2(struct gfs2_buffer_head *dbh)
 				gfs_log_header_in(&lh1, dbh);
 				gfs_log_header_print(&lh1);
 			} else {
-				gfs2_log_header_in(&lh, dbh);
+				gfs2_log_header_in(&lh, dbh->b_data);
 				gfs2_log_header_print(&lh);
 			}
 			break;
diff --git a/gfs2/edit/journal.c b/gfs2/edit/journal.c
index 6ec1b2a5..f6c649d2 100644
--- a/gfs2/edit/journal.c
+++ b/gfs2/edit/journal.c
@@ -317,7 +317,7 @@ static int is_wrap_pt(char *buf, uint64_t *highest_seq)
 			seq = lh.lh_sequence;
 		} else {
 			struct gfs2_log_header lh;
-			gfs2_log_header_in(&lh, &tbh);
+			gfs2_log_header_in(&lh, buf);
 			seq = lh.lh_sequence;
 		}
 		if (seq < *highest_seq)
@@ -596,7 +596,7 @@ void dump_journal(const char *journal, int tblk)
 					   lh1.lh_first, lh1.lh_tail,
 					   lh1.lh_last_dump);
 			} else {
-				gfs2_log_header_in(&lh, &dummy_bh);
+				gfs2_log_header_in(&lh, dummy_bh.b_data);
 				check_journal_wrap(lh.lh_sequence,
 						   &highest_seq);
 				print_gfs2("0x%"PRIx64" (j+%4"PRIx64"): Log header: Seq"
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 71b4e5e8..82900fb5 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -738,8 +738,8 @@ extern void gfs2_dirent_out(struct gfs2_dirent *de, char *buf);
 extern void gfs2_leaf_in(struct gfs2_leaf *lf, char *buf);
 extern void gfs2_leaf_out(struct gfs2_leaf *lf, char *buf);
 extern void gfs2_ea_header_in(struct gfs2_ea_header *ea, char *buf);
-extern void gfs2_log_header_v1_in(struct gfs2_log_header *lh, struct gfs2_buffer_head *bh);
-extern void gfs2_log_header_in(struct gfs2_log_header *lh, struct gfs2_buffer_head *bh);
+extern void gfs2_log_header_v1_in(struct gfs2_log_header *lh, char *buf);
+extern void gfs2_log_header_in(struct gfs2_log_header *lh, char *buf);
 extern void gfs2_log_header_v1_out(struct gfs2_log_header *lh, char *buf);
 extern void gfs2_log_header_out(struct gfs2_log_header *lh, char *buf);
 extern void gfs2_log_header_out_bh(struct gfs2_log_header *lh, struct gfs2_buffer_head *bh);
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index 04f3ce2c..fb8815d7 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -535,11 +535,11 @@ void gfs2_ea_header_print(const struct gfs2_ea_header *ea, char *name)
 	print_it("  name", "%s", NULL, buf);
 }
 
-void gfs2_log_header_v1_in(struct gfs2_log_header *lh, struct gfs2_buffer_head *bh)
+void gfs2_log_header_v1_in(struct gfs2_log_header *lh, char *buf)
 {
-	struct gfs2_log_header *str = (struct gfs2_log_header *)bh->b_data;
+	struct gfs2_log_header *str = (struct gfs2_log_header *)buf;
 
-	gfs2_meta_header_in(&lh->lh_header, bh->b_data);
+	gfs2_meta_header_in(&lh->lh_header, buf);
 	CPIN_64(lh, str, lh_sequence);
 	CPIN_32(lh, str, lh_flags);
 	CPIN_32(lh, str, lh_tail);
@@ -547,11 +547,11 @@ void gfs2_log_header_v1_in(struct gfs2_log_header *lh, struct gfs2_buffer_head *
 	CPIN_32(lh, str, lh_hash);
 }
 
-void gfs2_log_header_in(struct gfs2_log_header *lh, struct gfs2_buffer_head *bh)
+void gfs2_log_header_in(struct gfs2_log_header *lh, char *buf)
 {
-	struct gfs2_log_header *str = (struct gfs2_log_header *)bh->b_data;
+	struct gfs2_log_header *str = (struct gfs2_log_header *)buf;
 
-	gfs2_log_header_v1_in(lh, bh);
+	gfs2_log_header_v1_in(lh, buf);
 #ifdef GFS2_HAS_LH_V2
 	CPIN_32(lh, str, lh_crc);
 	CPIN_32(lh, str, lh_nsec);
diff --git a/gfs2/libgfs2/recovery.c b/gfs2/libgfs2/recovery.c
index 71f907b0..6b14bf94 100644
--- a/gfs2/libgfs2/recovery.c
+++ b/gfs2/libgfs2/recovery.c
@@ -70,7 +70,7 @@ int get_log_header(struct gfs2_inode *ip, unsigned int blk,
 	hash = lgfs2_log_header_hash(bh->b_data);
 	tmp->lh_hash = saved_hash;
 	crc = lgfs2_log_header_crc(bh->b_data, ip->i_sbd->bsize);
-	gfs2_log_header_in(&lh, bh);
+	gfs2_log_header_in(&lh, bh->b_data);
 	brelse(bh);
 #ifdef GFS2_HAS_LH_V2
 	lh_crc = lh.lh_crc;
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Cluster-devel] [PATCH 16/20] libgfs2: Remove gfs2_log_header_out_bh
  2018-03-05 18:25 [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Andrew Price
                   ` (14 preceding siblings ...)
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 15/20] libgfs2: Don't use buffer_heads in gfs2_log_header_in Andrew Price
@ 2018-03-05 18:25 ` Andrew Price
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 17/20] libgfs2: Don't use buffer_heads in gfs2_log_descriptor_{in, out} Andrew Price
                   ` (4 subsequent siblings)
  20 siblings, 0 replies; 26+ messages in thread
From: Andrew Price @ 2018-03-05 18:25 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 gfs2/fsck/fs_recovery.c   | 3 ++-
 gfs2/libgfs2/libgfs2.h    | 1 -
 gfs2/libgfs2/ondisk.c     | 6 ------
 gfs2/libgfs2/structures.c | 2 +-
 4 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c
index 740334da..677abd75 100644
--- a/gfs2/fsck/fs_recovery.c
+++ b/gfs2/fsck/fs_recovery.c
@@ -444,7 +444,8 @@ static int check_journal_seq_no(struct gfs2_inode *ip, int fix)
 		log_warn( _("Renumbering it as 0x%llx\n"), lh.lh_sequence);
 		block_map(ip, blk, &new, &dblock, NULL, FALSE);
 		bh = bread(ip->i_sbd, dblock);
-		gfs2_log_header_out_bh(&lh, bh);
+		gfs2_log_header_out(&lh, bh->b_data);
+		bmodified(bh);
 		brelse(bh);
 	}
 	if (seq_errors && fix) {
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 82900fb5..f83caaad 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -742,7 +742,6 @@ extern void gfs2_log_header_v1_in(struct gfs2_log_header *lh, char *buf);
 extern void gfs2_log_header_in(struct gfs2_log_header *lh, char *buf);
 extern void gfs2_log_header_v1_out(struct gfs2_log_header *lh, char *buf);
 extern void gfs2_log_header_out(struct gfs2_log_header *lh, char *buf);
-extern void gfs2_log_header_out_bh(struct gfs2_log_header *lh, struct gfs2_buffer_head *bh);
 extern void gfs2_log_descriptor_in(struct gfs2_log_descriptor *ld,
 				   struct gfs2_buffer_head *bh);
 extern void gfs2_log_descriptor_out(struct gfs2_log_descriptor *ld,
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index fb8815d7..d030cb16 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -597,12 +597,6 @@ void gfs2_log_header_out(struct gfs2_log_header *lh, char *buf)
 #endif
 }
 
-void gfs2_log_header_out_bh(struct gfs2_log_header *lh, struct gfs2_buffer_head *bh)
-{
-	gfs2_log_header_out(lh, bh->iov.iov_base);
-	bmodified(bh);
-}
-
 void gfs2_log_header_v1_print(const struct gfs2_log_header *lh)
 {
 	gfs2_meta_header_print(&lh->lh_header);
diff --git a/gfs2/libgfs2/structures.c b/gfs2/libgfs2/structures.c
index 51e7d077..310ba3c1 100644
--- a/gfs2/libgfs2/structures.c
+++ b/gfs2/libgfs2/structures.c
@@ -232,7 +232,7 @@ int write_journal(struct gfs2_inode *jnl, unsigned bsize, unsigned int blocks)
 		memset(bh->b_data, 0, bsize);
 		lh.lh_sequence = seq;
 		lh.lh_blkno = x;
-		gfs2_log_header_out_bh(&lh, bh);
+		gfs2_log_header_out(&lh, bh->b_data);
 		hash = lgfs2_log_header_hash(bh->b_data);
 		((struct gfs2_log_header *)bh->b_data)->lh_hash = cpu_to_be32(hash);
 #ifdef GFS2_HAS_LH_V2
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Cluster-devel] [PATCH 17/20] libgfs2: Don't use buffer_heads in gfs2_log_descriptor_{in, out}
  2018-03-05 18:25 [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Andrew Price
                   ` (15 preceding siblings ...)
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 16/20] libgfs2: Remove gfs2_log_header_out_bh Andrew Price
@ 2018-03-05 18:25 ` Andrew Price
  2018-03-05 19:00   ` Bob Peterson
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 18/20] libgfs2: Don't use buffer_heads in gfs2_quota_change_{in, out} Andrew Price
                   ` (3 subsequent siblings)
  20 siblings, 1 reply; 26+ messages in thread
From: Andrew Price @ 2018-03-05 18:25 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 gfs2/edit/gfs2hex.c    |  2 +-
 gfs2/edit/journal.c    | 21 +++++++++------------
 gfs2/libgfs2/libgfs2.h |  6 ++----
 gfs2/libgfs2/ondisk.c  | 15 ++++++---------
 4 files changed, 18 insertions(+), 26 deletions(-)

diff --git a/gfs2/edit/gfs2hex.c b/gfs2/edit/gfs2hex.c
index a4dd454e..dd4ae7f0 100644
--- a/gfs2/edit/gfs2hex.c
+++ b/gfs2/edit/gfs2hex.c
@@ -536,7 +536,7 @@ int display_gfs2(struct gfs2_buffer_head *dbh)
 			break;
 
 		case GFS2_METATYPE_LD:
-			gfs2_log_descriptor_in(&ld, dbh);
+			gfs2_log_descriptor_in(&ld, dbh->b_data);
 			gfs2_log_descriptor_print(&ld);
 			break;
 
diff --git a/gfs2/edit/journal.c b/gfs2/edit/journal.c
index f6c649d2..84ce12f1 100644
--- a/gfs2/edit/journal.c
+++ b/gfs2/edit/journal.c
@@ -364,7 +364,7 @@ static uint64_t find_wrap_pt(struct gfs2_inode *ji, char *jbuf, uint64_t jblock,
  * process_ld - process a log descriptor
  */
 static int process_ld(uint64_t abs_block, uint64_t wrappt, uint64_t j_size,
-		      uint64_t jb, struct gfs2_buffer_head *dummy_bh, int tblk,
+		      uint64_t jb, char *buf, int tblk,
 		      uint64_t *tblk_off, uint64_t bitblk,
 		      struct rgrp_tree *rgd, int *prnt, uint64_t *bblk_off)
 {
@@ -383,15 +383,12 @@ static int process_ld(uint64_t abs_block, uint64_t wrappt, uint64_t j_size,
 		{"Metadata", "Unlinked inode", "Dealloc inode",
 		 "Quota", "Final Entry", "Unknown"}};
 
-	gfs2_log_descriptor_in(&ld, dummy_bh);
+	gfs2_log_descriptor_in(&ld, buf);
 	if (sbd.gfs1)
-		b = (uint64_t *)(dummy_bh->b_data +
-				 sizeof(struct gfs_log_descriptor));
+		b = (uint64_t *)(buf + sizeof(struct gfs_log_descriptor));
 	else
-		b = (uint64_t *)(dummy_bh->b_data +
-				 sizeof(struct gfs2_log_descriptor));
-	*prnt = ld_is_pertinent(b, (dummy_bh->b_data + sbd.bsize), tblk, rgd,
-			       bitblk);
+		b = (uint64_t *)(buf + sizeof(struct gfs2_log_descriptor));
+	*prnt = ld_is_pertinent(b, (buf + sbd.bsize), tblk, rgd, bitblk);
 
 	if (*prnt) {
 		print_gfs2("0x%"PRIx64" (j+%4"PRIx64"): Log descriptor, ",
@@ -412,9 +409,9 @@ static int process_ld(uint64_t abs_block, uint64_t wrappt, uint64_t j_size,
 	if (ld.ld_type == GFS2_LOG_DESC_METADATA ||
 	    ld.ld_type == GFS_LOG_DESC_METADATA)
 		is_meta_ld = 1;
-	ld_blocks -= print_ld_blks(b, (dummy_bh->b_data + sbd.bsize), line,
-				   tblk, tblk_off, bitblk, rgd, abs_block,
-				   *prnt, bblk_off, is_meta_ld);
+	ld_blocks -= print_ld_blks(b, (buf + sbd.bsize), line, tblk, tblk_off,
+	                           bitblk, rgd, abs_block, *prnt, bblk_off,
+	                           is_meta_ld);
 
 	return ld_blocks;
 }
@@ -575,7 +572,7 @@ void dump_journal(const char *journal, int tblk)
 		block_type = get_block_type(&dummy_bh, NULL);
 		if (block_type == GFS2_METATYPE_LD) {
 			ld_blocks = process_ld(abs_block, wrappt, j_size, jb,
-					       &dummy_bh, tblk, &tblk_off,
+					       dummy_bh.b_data, tblk, &tblk_off,
 					       bitblk, rgd, &is_pertinent,
 					       &bblk_off);
 			offset_from_ld = 0;
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index f83caaad..a3091031 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -742,10 +742,8 @@ extern void gfs2_log_header_v1_in(struct gfs2_log_header *lh, char *buf);
 extern void gfs2_log_header_in(struct gfs2_log_header *lh, char *buf);
 extern void gfs2_log_header_v1_out(struct gfs2_log_header *lh, char *buf);
 extern void gfs2_log_header_out(struct gfs2_log_header *lh, char *buf);
-extern void gfs2_log_descriptor_in(struct gfs2_log_descriptor *ld,
-				   struct gfs2_buffer_head *bh);
-extern void gfs2_log_descriptor_out(struct gfs2_log_descriptor *ld,
-				    struct gfs2_buffer_head *bh);
+extern void gfs2_log_descriptor_in(struct gfs2_log_descriptor *ld, char *buf);
+extern void gfs2_log_descriptor_out(struct gfs2_log_descriptor *ld, char *buf);
 extern void gfs2_statfs_change_in(struct gfs2_statfs_change *sc, char *buf);
 extern void gfs2_statfs_change_out(struct gfs2_statfs_change *sc, char *buf);
 extern void gfs2_quota_change_in(struct gfs2_quota_change *qc,
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index d030cb16..206915a0 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -624,12 +624,11 @@ void gfs2_log_header_print(const struct gfs2_log_header *lh)
 #endif
 }
 
-void gfs2_log_descriptor_in(struct gfs2_log_descriptor *ld,
-			    struct gfs2_buffer_head *bh)
+void gfs2_log_descriptor_in(struct gfs2_log_descriptor *ld, char *buf)
 {
-	struct gfs2_log_descriptor *str = (struct gfs2_log_descriptor *)bh->b_data;
+	struct gfs2_log_descriptor *str = (struct gfs2_log_descriptor *)buf;
 
-	gfs2_meta_header_in(&ld->ld_header, bh->b_data);
+	gfs2_meta_header_in(&ld->ld_header, buf);
 	CPIN_32(ld, str, ld_type);
 	CPIN_32(ld, str, ld_length);
 	CPIN_32(ld, str, ld_data1);
@@ -638,19 +637,17 @@ void gfs2_log_descriptor_in(struct gfs2_log_descriptor *ld,
 	CPIN_08(ld, str, ld_reserved, 32);
 }
 
-void gfs2_log_descriptor_out(struct gfs2_log_descriptor *ld,
-			     struct gfs2_buffer_head *bh)
+void gfs2_log_descriptor_out(struct gfs2_log_descriptor *ld, char *buf)
 {
-	struct gfs2_log_descriptor *str = (struct gfs2_log_descriptor *)bh->b_data;
+	struct gfs2_log_descriptor *str = (struct gfs2_log_descriptor *)buf;
 
-	gfs2_meta_header_out(&ld->ld_header, bh->b_data);
+	gfs2_meta_header_out(&ld->ld_header, buf);
 	CPOUT_32(ld, str, ld_type);
 	CPOUT_32(ld, str, ld_length);
 	CPOUT_32(ld, str, ld_data1);
 	CPOUT_32(ld, str, ld_data2);
 
 	CPOUT_08(ld, str, ld_reserved, 32);
-	bmodified(bh);
 }
 
 void gfs2_log_descriptor_print(const struct gfs2_log_descriptor *ld)
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Cluster-devel] [PATCH 18/20] libgfs2: Don't use buffer_heads in gfs2_quota_change_{in, out}
  2018-03-05 18:25 [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Andrew Price
                   ` (16 preceding siblings ...)
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 17/20] libgfs2: Don't use buffer_heads in gfs2_log_descriptor_{in, out} Andrew Price
@ 2018-03-05 18:25 ` Andrew Price
  2018-03-05 19:02   ` Bob Peterson
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 19/20] libgfs2: Fix two unused variable warnings Andrew Price
                   ` (2 subsequent siblings)
  20 siblings, 1 reply; 26+ messages in thread
From: Andrew Price @ 2018-03-05 18:25 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 gfs2/edit/gfs2hex.c    |  2 +-
 gfs2/libgfs2/libgfs2.h |  6 ++----
 gfs2/libgfs2/ondisk.c  | 20 ++++++++------------
 3 files changed, 11 insertions(+), 17 deletions(-)

diff --git a/gfs2/edit/gfs2hex.c b/gfs2/edit/gfs2hex.c
index dd4ae7f0..62d5cab5 100644
--- a/gfs2/edit/gfs2hex.c
+++ b/gfs2/edit/gfs2hex.c
@@ -553,7 +553,7 @@ int display_gfs2(struct gfs2_buffer_head *dbh)
 			break;
 
 		case GFS2_METATYPE_QC:
-			gfs2_quota_change_in(&qc, dbh);
+			gfs2_quota_change_in(&qc, dbh->b_data);
 			gfs2_quota_change_print(&qc);
 			break;
 
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index a3091031..3a54195c 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -746,10 +746,8 @@ extern void gfs2_log_descriptor_in(struct gfs2_log_descriptor *ld, char *buf);
 extern void gfs2_log_descriptor_out(struct gfs2_log_descriptor *ld, char *buf);
 extern void gfs2_statfs_change_in(struct gfs2_statfs_change *sc, char *buf);
 extern void gfs2_statfs_change_out(struct gfs2_statfs_change *sc, char *buf);
-extern void gfs2_quota_change_in(struct gfs2_quota_change *qc,
-				 struct gfs2_buffer_head *bh);
-extern void gfs2_quota_change_out(struct gfs2_quota_change *qc,
-				  struct gfs2_buffer_head *bh);
+extern void gfs2_quota_change_in(struct gfs2_quota_change *qc, char *buf);
+extern void gfs2_quota_change_out(struct gfs2_quota_change *qc, char *buf);
 
 /* Printing functions */
 
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index 206915a0..b78b198a 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -32,11 +32,11 @@
 /*
  * gfs2_xxx_in - read in an xxx struct
  * first arg: the cpu-order structure
- * bh: the disk-order buffer_head
+ * buf: the disk-order block data
  *
  * gfs2_xxx_out - write out an xxx struct
  * first arg: the cpu-order structure
- * bh: the disk-order buffer_head
+ * buf: the disk-order block data
  *
  * gfs2_xxx_print - print out an xxx struct
  * first arg: the cpu-order structure
@@ -684,27 +684,24 @@ void gfs2_statfs_change_print(const struct gfs2_statfs_change *sc)
 	pv(sc, sc_dinodes, "%lld", "0x%llx");
 }
 
-void gfs2_quota_change_in(struct gfs2_quota_change *qc,
-			  struct gfs2_buffer_head *bh)
+void gfs2_quota_change_in(struct gfs2_quota_change *qc, char *buf)
 {
-	struct gfs2_quota_change *str = (struct gfs2_quota_change *)(bh->b_data +
-		sizeof(struct gfs2_meta_header));
+	struct gfs2_quota_change *str = (struct gfs2_quota_change *)(buf +
+	                                 sizeof(struct gfs2_meta_header));
 
 	CPIN_64(qc, str, qc_change);
 	CPIN_32(qc, str, qc_flags);
 	CPIN_32(qc, str, qc_id);
 }
 
-void gfs2_quota_change_out(struct gfs2_quota_change *qc,
-			   struct gfs2_buffer_head *bh)
+void gfs2_quota_change_out(struct gfs2_quota_change *qc, char *buf)
 {
-	struct gfs2_quota_change *str = (struct gfs2_quota_change *)(bh->b_data +
-		sizeof(struct gfs2_meta_header));
+	struct gfs2_quota_change *str = (struct gfs2_quota_change *)(buf +
+	                                 sizeof(struct gfs2_meta_header));
 
 	CPOUT_64(qc, str, qc_change);
 	CPOUT_32(qc, str, qc_flags);
 	CPOUT_32(qc, str, qc_id);
-	bmodified(bh);
 }
 
 void gfs2_quota_change_print(const struct gfs2_quota_change *qc)
@@ -714,4 +711,3 @@ void gfs2_quota_change_print(const struct gfs2_quota_change *qc)
 	pv(qc, qc_id, "%u", "0x%x");
 }
 
-
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Cluster-devel] [PATCH 19/20] libgfs2: Fix two unused variable warnings
  2018-03-05 18:25 [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Andrew Price
                   ` (17 preceding siblings ...)
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 18/20] libgfs2: Don't use buffer_heads in gfs2_quota_change_{in, out} Andrew Price
@ 2018-03-05 18:25 ` Andrew Price
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 20/20] mkfs.gfs2: Silence an integer overflow warning Andrew Price
  2018-03-05 19:08 ` [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Bob Peterson
  20 siblings, 0 replies; 26+ messages in thread
From: Andrew Price @ 2018-03-05 18:25 UTC (permalink / raw)
  To: cluster-devel.redhat.com

These only occur without v2 log headers.

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 gfs2/libgfs2/ondisk.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index b78b198a..366e7c9a 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -549,10 +549,11 @@ void gfs2_log_header_v1_in(struct gfs2_log_header *lh, char *buf)
 
 void gfs2_log_header_in(struct gfs2_log_header *lh, char *buf)
 {
-	struct gfs2_log_header *str = (struct gfs2_log_header *)buf;
-
 	gfs2_log_header_v1_in(lh, buf);
 #ifdef GFS2_HAS_LH_V2
+	{
+	struct gfs2_log_header *str = (struct gfs2_log_header *)buf;
+
 	CPIN_32(lh, str, lh_crc);
 	CPIN_32(lh, str, lh_nsec);
 	CPIN_64(lh, str, lh_sec);
@@ -563,6 +564,7 @@ void gfs2_log_header_in(struct gfs2_log_header *lh, char *buf)
 	CPIN_64(lh, str, lh_local_total);
 	CPIN_64(lh, str, lh_local_free);
 	CPIN_64(lh, str, lh_local_dinodes);
+	}
 #endif
 }
 
@@ -580,10 +582,11 @@ void gfs2_log_header_v1_out(struct gfs2_log_header *lh, char *buf)
 
 void gfs2_log_header_out(struct gfs2_log_header *lh, char *buf)
 {
-	struct gfs2_log_header *str = (struct gfs2_log_header *)buf;
-
 	gfs2_log_header_v1_out(lh, buf);
 #ifdef GFS2_HAS_LH_V2
+	{
+	struct gfs2_log_header *str = (struct gfs2_log_header *)buf;
+
 	CPOUT_32(lh, str, lh_crc);
 	CPOUT_32(lh, str, lh_nsec);
 	CPOUT_64(lh, str, lh_sec);
@@ -594,6 +597,7 @@ void gfs2_log_header_out(struct gfs2_log_header *lh, char *buf)
 	CPOUT_64(lh, str, lh_local_total);
 	CPOUT_64(lh, str, lh_local_free);
 	CPOUT_64(lh, str, lh_local_dinodes);
+	}
 #endif
 }
 
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Cluster-devel] [PATCH 20/20] mkfs.gfs2: Silence an integer overflow warning
  2018-03-05 18:25 [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Andrew Price
                   ` (18 preceding siblings ...)
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 19/20] libgfs2: Fix two unused variable warnings Andrew Price
@ 2018-03-05 18:25 ` Andrew Price
  2018-03-05 19:08 ` [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Bob Peterson
  20 siblings, 0 replies; 26+ messages in thread
From: Andrew Price @ 2018-03-05 18:25 UTC (permalink / raw)
  To: cluster-devel.redhat.com

No bug here, just need to acknowledge the widening.

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 gfs2/mkfs/main_mkfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c
index 42ce6dd6..297ff7a3 100644
--- a/gfs2/mkfs/main_mkfs.c
+++ b/gfs2/mkfs/main_mkfs.c
@@ -840,7 +840,7 @@ static int default_journal_size(unsigned bsize, uint64_t num_blocks)
 		return (16384);                 /* 64 MB */
 	if (num_blocks < 262144*1024)   /*  1 TB */
 		return (32768);                 /* 128 MB */
-	if (num_blocks < 2621440*1024)  /* 10 TB */
+	if (num_blocks < 2621440UL*1024)  /* 10 TB */
 		return (131072);                /* 512 MB */
 	return 262144;                          /*   1 GB */
 }
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Cluster-devel] [PATCH 17/20] libgfs2: Don't use buffer_heads in gfs2_log_descriptor_{in, out}
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 17/20] libgfs2: Don't use buffer_heads in gfs2_log_descriptor_{in, out} Andrew Price
@ 2018-03-05 19:00   ` Bob Peterson
  2018-03-05 19:15     ` Andrew Price
  0 siblings, 1 reply; 26+ messages in thread
From: Bob Peterson @ 2018-03-05 19:00 UTC (permalink / raw)
  To: cluster-devel.redhat.com

----- Original Message -----
| Signed-off-by: Andrew Price <anprice@redhat.com>
| ---
|  gfs2/edit/gfs2hex.c    |  2 +-
|  gfs2/edit/journal.c    | 21 +++++++++------------
|  gfs2/libgfs2/libgfs2.h |  6 ++----
|  gfs2/libgfs2/ondisk.c  | 15 ++++++---------
|  4 files changed, 18 insertions(+), 26 deletions(-)
| +extern void gfs2_log_descriptor_out(struct gfs2_log_descriptor *ld, char
| *buf);

Hm. Looks like gfs2_log_descriptor_out isn't used by any of the utils.

We went through a phase where we tried to trim down libgfs2 in favor of
moving functions like this to the gfs2-util that uses it, in cases where
only one tool used it. Perhaps we should get rid of it altogether?
Unless you want to keep it in case third party tools link it in.

Regards,

Bob



^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Cluster-devel] [PATCH 18/20] libgfs2: Don't use buffer_heads in gfs2_quota_change_{in, out}
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 18/20] libgfs2: Don't use buffer_heads in gfs2_quota_change_{in, out} Andrew Price
@ 2018-03-05 19:02   ` Bob Peterson
  0 siblings, 0 replies; 26+ messages in thread
From: Bob Peterson @ 2018-03-05 19:02 UTC (permalink / raw)
  To: cluster-devel.redhat.com

----- Original Message -----
| Signed-off-by: Andrew Price <anprice@redhat.com>
| ---
|  gfs2/edit/gfs2hex.c    |  2 +-
|  gfs2/libgfs2/libgfs2.h |  6 ++----
|  gfs2/libgfs2/ondisk.c  | 20 ++++++++------------
|  3 files changed, 11 insertions(+), 17 deletions(-)
Hi,

Function gfs2_quota_change_out is also unused afaict.

Bob



^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups
  2018-03-05 18:25 [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Andrew Price
                   ` (19 preceding siblings ...)
  2018-03-05 18:25 ` [Cluster-devel] [PATCH 20/20] mkfs.gfs2: Silence an integer overflow warning Andrew Price
@ 2018-03-05 19:08 ` Bob Peterson
  2018-03-05 19:19   ` Andrew Price
  20 siblings, 1 reply; 26+ messages in thread
From: Bob Peterson @ 2018-03-05 19:08 UTC (permalink / raw)
  To: cluster-devel.redhat.com

----- Original Message -----
| This is an accumulation of yak shaving patches and cleanups that I want to
| get out of the way. There shouldn't be anything controversial here. The main
| theme is to make it easier to use libgfs2 without using gfs2_buffer_heads,
| and it gets rid of some 'dummy_bh' uses.
| 
| Andrew Price (20):
|   libgfs2: Remove unused lock* fields from gfs2_sbd
|   libgfs2: Remove sb_addr from gfs2_sbd
|   libgfs2: Plug an alignment hole in gfs2_sbd
|   libgfs2: Plug an alignment hole in gfs2_buffer_head
|   libgfs2: Plug an alignment hole in gfs2_inode
|   libgfs2: Remove gfs2_meta_header_out_bh()
|   libgfs2: Don't pass an extlen to block_map where not required
|   libgfs2: Don't use a buffer_head in gfs2_meta_header_in
|   libgfs2: Don't use buffer_heads in gfs2_sb_in
|   libgfs2: Don't use buffer_heads in gfs2_rgrp_in
|   libgfs2: Remove gfs2_rgrp_out_bh
|   libgfs2: Don't use buffer_heads in gfs2_dinode_in
|   libgfs2: Remove gfs2_dinode_out_bh
|   libgfs2: Don't use buffer_heads in gfs2_leaf_{in,out}
|   libgfs2: Don't use buffer_heads in gfs2_log_header_in
|   libgfs2: Remove gfs2_log_header_out_bh
|   libgfs2: Don't use buffer_heads in gfs2_log_descriptor_{in,out}
|   libgfs2: Don't use buffer_heads in gfs2_quota_change_{in,out}
|   libgfs2: Fix two unused variable warnings
|   mkfs.gfs2: Silence an integer overflow warning
| 
|  gfs2/convert/gfs2_convert.c |  25 ++++++----
|  gfs2/edit/extended.c        |   2 +-
|  gfs2/edit/gfs2hex.c         |  22 ++++-----
|  gfs2/edit/hexedit.c         |  19 +++----
|  gfs2/edit/journal.c         |  29 +++++------
|  gfs2/edit/savemeta.c        |  26 +++++-----
|  gfs2/fsck/fs_recovery.c     |  10 ++--
|  gfs2/fsck/fsck.h            |   4 +-
|  gfs2/fsck/initialize.c      |  10 ++--
|  gfs2/fsck/lost_n_found.c    |   2 +-
|  gfs2/fsck/metawalk.c        |  13 +++--
|  gfs2/fsck/pass1.c           |   4 +-
|  gfs2/fsck/pass2.c           |   6 +--
|  gfs2/fsck/pass5.c           |   2 +-
|  gfs2/fsck/rgrepair.c        |  39 +++++++--------
|  gfs2/glocktop/glocktop.c    |   2 +-
|  gfs2/libgfs2/fs_bits.c      |   2 +-
|  gfs2/libgfs2/fs_geometry.c  |   5 +-
|  gfs2/libgfs2/fs_ops.c       |  46 ++++++++++-------
|  gfs2/libgfs2/gfs1.c         |  16 +++---
|  gfs2/libgfs2/lang.c         |   2 +-
|  gfs2/libgfs2/libgfs2.h      |  46 ++++++-----------
|  gfs2/libgfs2/misc.c         |   2 -
|  gfs2/libgfs2/ondisk.c       | 118
|  +++++++++++++++++---------------------------
|  gfs2/libgfs2/recovery.c     |   9 ++--
|  gfs2/libgfs2/rgrp.c         |   2 +-
|  gfs2/libgfs2/structures.c   |  13 ++---
|  gfs2/libgfs2/super.c        |   3 +-
|  gfs2/mkfs/main_jadd.c       |   8 ++-
|  gfs2/mkfs/main_mkfs.c       |   6 +--
|  30 files changed, 229 insertions(+), 264 deletions(-)
| 
| --
| 2.14.3
| 
| 
Hi,

These all look good to me. The only one that worries me is
patch 02/20 because historically speaking, I've had problems
with some of the tools due to the delicate order of how the
superblock is read in versus the various calculations done.
In other words, in the past, changes like 02/20 would be
transparent and "just work" for one util, but completely
break a different util. In those cases, the breakage was pretty
easy to uncover, because the util would just refuse to do any
basic operations at all. So just make sure all the tools are
tested for base functionality, if you haven't already.

Regards,

Bob Peterson
Red Hat File Systems



^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Cluster-devel] [PATCH 17/20] libgfs2: Don't use buffer_heads in gfs2_log_descriptor_{in, out}
  2018-03-05 19:00   ` Bob Peterson
@ 2018-03-05 19:15     ` Andrew Price
  0 siblings, 0 replies; 26+ messages in thread
From: Andrew Price @ 2018-03-05 19:15 UTC (permalink / raw)
  To: cluster-devel.redhat.com

On 05/03/18 19:00, Bob Peterson wrote:
> ----- Original Message -----
> | Signed-off-by: Andrew Price <anprice@redhat.com>
> | ---
> |  gfs2/edit/gfs2hex.c    |  2 +-
> |  gfs2/edit/journal.c    | 21 +++++++++------------
> |  gfs2/libgfs2/libgfs2.h |  6 ++----
> |  gfs2/libgfs2/ondisk.c  | 15 ++++++---------
> |  4 files changed, 18 insertions(+), 26 deletions(-)
> | +extern void gfs2_log_descriptor_out(struct gfs2_log_descriptor *ld, char
> | *buf);
> 
> Hm. Looks like gfs2_log_descriptor_out isn't used by any of the utils.
> 
> We went through a phase where we tried to trim down libgfs2 in favor of
> moving functions like this to the gfs2-util that uses it, in cases where
> only one tool used it. Perhaps we should get rid of it altogether?
> Unless you want to keep it in case third party tools link it in.

Yes, I thought about that but I figured it doesn't add a large amount of 
burden and it would be an inconvenience to not have it there for times 
when we do need to print out a ld/qc, even just for debugging.

That said, in the medium term I'd like to replace the _out, _in, and 
_print functions with something more generic and portable. I've thrown a 
few ideas out already for being too hackish or slow but these patches 
could make it a little easier to implement a better solution.

Andy



^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups
  2018-03-05 19:08 ` [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Bob Peterson
@ 2018-03-05 19:19   ` Andrew Price
  0 siblings, 0 replies; 26+ messages in thread
From: Andrew Price @ 2018-03-05 19:19 UTC (permalink / raw)
  To: cluster-devel.redhat.com

On 05/03/18 19:08, Bob Peterson wrote:
> ----- Original Message -----
> | This is an accumulation of yak shaving patches and cleanups that I want to
> | get out of the way. There shouldn't be anything controversial here. The main
> | theme is to make it easier to use libgfs2 without using gfs2_buffer_heads,
> | and it gets rid of some 'dummy_bh' uses.
> |
> | Andrew Price (20):
> |   libgfs2: Remove unused lock* fields from gfs2_sbd
> |   libgfs2: Remove sb_addr from gfs2_sbd


> Hi,
> 
> These all look good to me. The only one that worries me is
> patch 02/20 because historically speaking, I've had problems
> with some of the tools due to the delicate order of how the
> superblock is read in versus the various calculations done.
> In other words, in the past, changes like 02/20 would be
> transparent and "just work" for one util, but completely
> break a different util. In those cases, the breakage was pretty
> easy to uncover, because the util would just refuse to do any
> basic operations at all. So just make sure all the tools are
> tested for base functionality, if you haven't already.

I was concerned about that too. Luckily ->sb_addr is always set in the 
same function that sets ->sd_fsb2bb_shift and the accesses are done 
after that. It's very likely that the test suite would have caught any 
problems of that sort, too.

Andy



^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2018-03-05 19:19 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-05 18:25 [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Andrew Price
2018-03-05 18:25 ` [Cluster-devel] [PATCH 01/20] libgfs2: Remove unused lock* fields from gfs2_sbd Andrew Price
2018-03-05 18:25 ` [Cluster-devel] [PATCH 02/20] libgfs2: Remove sb_addr " Andrew Price
2018-03-05 18:25 ` [Cluster-devel] [PATCH 03/20] libgfs2: Plug an alignment hole in gfs2_sbd Andrew Price
2018-03-05 18:25 ` [Cluster-devel] [PATCH 04/20] libgfs2: Plug an alignment hole in gfs2_buffer_head Andrew Price
2018-03-05 18:25 ` [Cluster-devel] [PATCH 05/20] libgfs2: Plug an alignment hole in gfs2_inode Andrew Price
2018-03-05 18:25 ` [Cluster-devel] [PATCH 06/20] libgfs2: Remove gfs2_meta_header_out_bh() Andrew Price
2018-03-05 18:25 ` [Cluster-devel] [PATCH 07/20] libgfs2: Don't pass an extlen to block_map where not required Andrew Price
2018-03-05 18:25 ` [Cluster-devel] [PATCH 08/20] libgfs2: Don't use a buffer_head in gfs2_meta_header_in Andrew Price
2018-03-05 18:25 ` [Cluster-devel] [PATCH 09/20] libgfs2: Don't use buffer_heads in gfs2_sb_in Andrew Price
2018-03-05 18:25 ` [Cluster-devel] [PATCH 10/20] libgfs2: Don't use buffer_heads in gfs2_rgrp_in Andrew Price
2018-03-05 18:25 ` [Cluster-devel] [PATCH 11/20] libgfs2: Remove gfs2_rgrp_out_bh Andrew Price
2018-03-05 18:25 ` [Cluster-devel] [PATCH 12/20] libgfs2: Don't use buffer_heads in gfs2_dinode_in Andrew Price
2018-03-05 18:25 ` [Cluster-devel] [PATCH 13/20] libgfs2: Remove gfs2_dinode_out_bh Andrew Price
2018-03-05 18:25 ` [Cluster-devel] [PATCH 14/20] libgfs2: Don't use buffer_heads in gfs2_leaf_{in, out} Andrew Price
2018-03-05 18:25 ` [Cluster-devel] [PATCH 15/20] libgfs2: Don't use buffer_heads in gfs2_log_header_in Andrew Price
2018-03-05 18:25 ` [Cluster-devel] [PATCH 16/20] libgfs2: Remove gfs2_log_header_out_bh Andrew Price
2018-03-05 18:25 ` [Cluster-devel] [PATCH 17/20] libgfs2: Don't use buffer_heads in gfs2_log_descriptor_{in, out} Andrew Price
2018-03-05 19:00   ` Bob Peterson
2018-03-05 19:15     ` Andrew Price
2018-03-05 18:25 ` [Cluster-devel] [PATCH 18/20] libgfs2: Don't use buffer_heads in gfs2_quota_change_{in, out} Andrew Price
2018-03-05 19:02   ` Bob Peterson
2018-03-05 18:25 ` [Cluster-devel] [PATCH 19/20] libgfs2: Fix two unused variable warnings Andrew Price
2018-03-05 18:25 ` [Cluster-devel] [PATCH 20/20] mkfs.gfs2: Silence an integer overflow warning Andrew Price
2018-03-05 19:08 ` [Cluster-devel] [PATCH 00/20] gfs2-utils: Misc. tidy-ups Bob Peterson
2018-03-05 19:19   ` Andrew Price

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.