This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master in repository gfs2-utils.
The following commit(s) were added to refs/heads/master by this push: new 59f225f8 libgfs2: Remove sd_max_dirres from struct gfs2_sbd 59f225f8 is described below
commit 59f225f8ce72bfde99f3f0f72ce4a217436186d0 Author: Andrew Price anprice@redhat.com AuthorDate: Mon Dec 6 21:14:12 2021 +0000
libgfs2: Remove sd_max_dirres from struct gfs2_sbd
This field has never been used in gfs2-utils and removing it allows a bunch of code to be removed from compute_constants()
Signed-off-by: Andrew Price anprice@redhat.com --- gfs2/libgfs2/libgfs2.h | 1 - gfs2/libgfs2/misc.c | 18 ------------------ 2 files changed, 19 deletions(-)
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h index 171128d7..16bef62a 100644 --- a/gfs2/libgfs2/libgfs2.h +++ b/gfs2/libgfs2/libgfs2.h @@ -349,7 +349,6 @@ struct gfs2_sbd { uint32_t sd_hash_bsize_shift; uint32_t sd_hash_ptrs; uint32_t sd_blocks_per_bitmap; - uint32_t sd_max_dirres; uint32_t sd_max_height; uint32_t sd_max_jheight; uint64_t sd_heightsize[GFS2_MAX_META_HEIGHT]; diff --git a/gfs2/libgfs2/misc.c b/gfs2/libgfs2/misc.c index f2bab8ef..8f1014ea 100644 --- a/gfs2/libgfs2/misc.c +++ b/gfs2/libgfs2/misc.c @@ -38,9 +38,6 @@ int compute_heightsize(unsigned bsize, uint64_t *heightsize,
int compute_constants(struct gfs2_sbd *sdp) { - uint32_t hash_blocks, ind_blocks, leaf_blocks; - uint32_t tmp_blocks; - sdp->md.next_inum = 1;
sdp->sd_bsize_shift = ffs(sdp->sd_bsize) - 1; @@ -58,21 +55,6 @@ int compute_constants(struct gfs2_sbd *sdp) sdp->sd_blocks_per_bitmap = (sdp->sd_bsize - sizeof(struct gfs2_meta_header)) * GFS2_NBBY;
- /* Compute maximum reservation required to add a entry to a directory */ - - hash_blocks = DIV_RU(sizeof(uint64_t) * (1 << GFS2_DIR_MAX_DEPTH), - sdp->sd_jbsize); - - ind_blocks = 0; - for (tmp_blocks = hash_blocks; tmp_blocks > sdp->sd_diptrs;) { - tmp_blocks = DIV_RU(tmp_blocks, sdp->sd_inptrs); - ind_blocks += tmp_blocks; - } - - leaf_blocks = 2 + GFS2_DIR_MAX_DEPTH; - - sdp->sd_max_dirres = hash_blocks + ind_blocks + leaf_blocks; - if (compute_heightsize(sdp->sd_bsize, sdp->sd_heightsize, &sdp->sd_max_height, sdp->sd_bsize, sdp->sd_diptrs, sdp->sd_inptrs)) { return -1;