cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [PATCH 1/8] libgfs2: Remove sdp argument from compute_heightsize
@ 2014-01-27 14:17 Andrew Price
  2014-01-27 14:17 ` [Cluster-devel] [PATCH 2/8] libgfs2: Remove sdp and j arguments from write_journal Andrew Price
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Andrew Price @ 2014-01-27 14:17 UTC (permalink / raw)
  To: cluster-devel.redhat.com

compute_heightsize only uses the bsize member of sdp so just accept a
bsize argument instead.

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 gfs2/convert/gfs2_convert.c | 8 ++++----
 gfs2/libgfs2/libgfs2.h      | 2 +-
 gfs2/libgfs2/misc.c         | 8 ++++----
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index 719ba9c..e9dd0da 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -1611,13 +1611,13 @@ static int init(struct gfs2_sbd *sbp)
 		sizeof(uint64_t);
 	sbp->sd_jbsize = sbp->bsize - sizeof(struct gfs2_meta_header);
 	brelse(bh);
-	if (compute_heightsize(sbp, sbp->sd_heightsize, &sbp->sd_max_height,
+	if (compute_heightsize(sbp->bsize, sbp->sd_heightsize, &sbp->sd_max_height,
 				sbp->bsize, sbp->sd_diptrs, sbp->sd_inptrs)) {
 		log_crit(_("Error: Bad constants (1)\n"));
 		exit(-1);
 	}
 
-	if (compute_heightsize(sbp, sbp->sd_jheightsize, &sbp->sd_max_jheight,
+	if (compute_heightsize(sbp->bsize, sbp->sd_jheightsize, &sbp->sd_max_jheight,
 				sbp->sd_jbsize, sbp->sd_diptrs, sbp->sd_inptrs)) {
 		log_crit(_("Error: Bad constants (1)\n"));
 		exit(-1);
@@ -1628,13 +1628,13 @@ static int init(struct gfs2_sbd *sbp)
 	gfs2_inptrs = (sbp->bsize - sizeof(struct gfs2_meta_header)) /
                 sizeof(uint64_t); /* How many ptrs can we fit on a block? */
 	memset(gfs2_heightsize, 0, sizeof(gfs2_heightsize));
-	if (compute_heightsize(sbp, gfs2_heightsize, &gfs2_max_height,
+	if (compute_heightsize(sbp->bsize, gfs2_heightsize, &gfs2_max_height,
 				sbp->bsize, sbp->sd_diptrs, gfs2_inptrs)) {
 		log_crit(_("Error: Bad constants (1)\n"));
 		exit(-1);
 	}
 	memset(gfs2_jheightsize, 0, sizeof(gfs2_jheightsize));
-	if (compute_heightsize(sbp, gfs2_jheightsize, &gfs2_max_jheight,
+	if (compute_heightsize(sbp->bsize, gfs2_jheightsize, &gfs2_max_jheight,
 				sbp->sd_jbsize, sbp->sd_diptrs, gfs2_inptrs)) {
 		log_crit(_("Error: Bad constants (1)\n"));
 		exit(-1);
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index e785017..3119f39 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -712,7 +712,7 @@ extern void decrease_verbosity(void);
 
 extern int metafs_interrupted;
 
-extern int compute_heightsize(struct gfs2_sbd *sdp, uint64_t *heightsize,
+extern int compute_heightsize(unsigned bsize, uint64_t *heightsize,
 		uint32_t *maxheight, uint32_t bsize1, int diptrs, int inptrs);
 extern int compute_constants(struct gfs2_sbd *sdp);
 extern int lgfs2_open_mnt(const char *path, int dirflags, int *dirfd, int devflags, int *devfd, struct mntent **mnt);
diff --git a/gfs2/libgfs2/misc.c b/gfs2/libgfs2/misc.c
index c4ed722..8ee8324 100644
--- a/gfs2/libgfs2/misc.c
+++ b/gfs2/libgfs2/misc.c
@@ -28,10 +28,10 @@
 
 int metafs_interrupted = 0;
 
-int compute_heightsize(struct gfs2_sbd *sdp, uint64_t *heightsize,
+int compute_heightsize(unsigned bsize, uint64_t *heightsize,
 	uint32_t *maxheight, uint32_t bsize1, int diptrs, int inptrs)
 {
-	heightsize[0] = sdp->bsize - sizeof(struct gfs2_dinode);
+	heightsize[0] = bsize - sizeof(struct gfs2_dinode);
 	heightsize[1] = bsize1 * diptrs;
 	for (*maxheight = 2;; (*maxheight)++) {
 		uint64_t space, d;
@@ -91,11 +91,11 @@ int compute_constants(struct gfs2_sbd *sdp)
 
 	sdp->sd_max_dirres = hash_blocks + ind_blocks + leaf_blocks;
 
-	if (compute_heightsize(sdp, sdp->sd_heightsize, &sdp->sd_max_height,
+	if (compute_heightsize(sdp->bsize, sdp->sd_heightsize, &sdp->sd_max_height,
 				sdp->bsize, sdp->sd_diptrs, sdp->sd_inptrs)) {
 		return -1;
 	}
-	if (compute_heightsize(sdp, sdp->sd_jheightsize, &sdp->sd_max_jheight,
+	if (compute_heightsize(sdp->bsize, sdp->sd_jheightsize, &sdp->sd_max_jheight,
 				sdp->sd_jbsize, sdp->sd_diptrs, sdp->sd_inptrs)) {
 		return -1;
 	}
-- 
1.8.3.1



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

end of thread, other threads:[~2014-01-27 17:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-27 14:17 [Cluster-devel] [PATCH 1/8] libgfs2: Remove sdp argument from compute_heightsize Andrew Price
2014-01-27 14:17 ` [Cluster-devel] [PATCH 2/8] libgfs2: Remove sdp and j arguments from write_journal Andrew Price
2014-01-27 14:17 ` [Cluster-devel] [PATCH 3/8] libgfs2: Rework find_metapath Andrew Price
2014-01-27 14:17 ` [Cluster-devel] [PATCH 4/8] libgfs2: Improve and simplify blk_alloc_in_rg Andrew Price
2014-01-27 15:46   ` Bob Peterson
2014-01-27 17:09     ` Andrew Price
2014-01-27 14:17 ` [Cluster-devel] [PATCH 5/8] mkfs.gfs2 tests: Enable debug output Andrew Price
2014-01-27 14:17 ` [Cluster-devel] [PATCH 6/8] libgfs2: Refactor block allocation functions Andrew Price
2014-01-27 14:17 ` [Cluster-devel] [PATCH 7/8] gfs2-utils: Clean up unused functions Andrew Price
2014-01-27 14:17 ` [Cluster-devel] [PATCH 8/8] libgfs2: Remove exit call from build_rgrps Andrew Price
2014-01-27 14:47 ` [Cluster-devel] [PATCH 1/8] libgfs2: Remove sdp argument from compute_heightsize Steven Whitehouse
2014-01-27 15:03   ` Andrew Price
2014-01-27 15:04     ` Steven Whitehouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).