This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: STABLE3 - libgfs2: Remove unused code, general clean up


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=766b5fdff44b3380acfa4e9f4919eb22eb94f5fa
Commit:        766b5fdff44b3380acfa4e9f4919eb22eb94f5fa
Parent:        c0a2d5b73035d5d37aa179956cff877c90a5bf4e
Author:        Steven Whitehouse <swhiteho@redhat.com>
AuthorDate:    Fri Jan 23 15:13:50 2009 +0000
Committer:     Fabio M. Di Nitto <fdinitto@redhat.com>
CommitterDate: Mon Jan 26 08:39:55 2009 +0100

libgfs2: Remove unused code, general clean up

Marks a number of functions static, removes things which are not
used. Still lots more to do, but this is a start.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
---
 gfs2/fsck/fs_bits.h            |    5 --
 gfs2/libgfs2/buf.c             |   17 -----
 gfs2/libgfs2/device_geometry.c |    6 +-
 gfs2/libgfs2/fs_bits.c         |  114 +----------------------------------
 gfs2/libgfs2/fs_geometry.c     |    9 +--
 gfs2/libgfs2/fs_ops.c          |   82 ++++++++++++-------------
 gfs2/libgfs2/gfs2_log.c        |    8 +-
 gfs2/libgfs2/libgfs2.h         |   11 ----
 gfs2/libgfs2/locking.c         |    3 +-
 gfs2/libgfs2/size.c            |    6 +-
 gfs2/libgfs2/structures.c      |  131 ++++-----------------------------------
 11 files changed, 67 insertions(+), 325 deletions(-)

diff --git a/gfs2/fsck/fs_bits.h b/gfs2/fsck/fs_bits.h
index ae5afb9..371c6c6 100644
--- a/gfs2/fsck/fs_bits.h
+++ b/gfs2/fsck/fs_bits.h
@@ -25,9 +25,4 @@ uint32_t gfs2_blkalloc_internal(struct rgrp_list *rgd, uint32_t goal,
 								unsigned char old_state,
 								unsigned char new_state, int do_it);
 
-/* functions with blk #'s that are file system relative */
-int gfs2_get_bitmap(struct gfs2_sbd *sdp, uint64_t blkno,
-					struct rgrp_list *rgd);
-int gfs2_set_bitmap(struct gfs2_sbd *sdp, uint64_t blkno, int state);
-
 #endif /* __FS_BITS_H__ */
diff --git a/gfs2/libgfs2/buf.c b/gfs2/libgfs2/buf.c
index b43d335..ee43188 100644
--- a/gfs2/libgfs2/buf.c
+++ b/gfs2/libgfs2/buf.c
@@ -132,11 +132,6 @@ struct gfs2_buffer_head *bread(struct buf_list *bl, uint64_t num)
 	return bget_generic(bl, num, TRUE, TRUE);
 }
 
-struct gfs2_buffer_head *bget_zero(struct buf_list *bl, uint64_t num)
-{
-	return bget_generic(bl, num, FALSE, FALSE);
-}
-
 struct gfs2_buffer_head *bhold(struct gfs2_buffer_head *bh)
 {
 	if (!bh->b_count)
@@ -192,15 +187,3 @@ void bcommit(struct buf_list *bl)
 	fsync(sdp->device_fd);
 }
 
-/* Check for unreleased buffers */
-void bcheck(struct buf_list *bl)
-{
-	osi_list_t *tmp;
-	struct gfs2_buffer_head *bh;
-
-	osi_list_foreach(tmp, &bl->list) {
-		bh = osi_list_entry(tmp, struct gfs2_buffer_head, b_list);
-		if (bh->b_count)
-			die("buffer still held: %"PRIu64"\n", bh->b_blocknr);
-	}
-}
diff --git a/gfs2/libgfs2/device_geometry.c b/gfs2/libgfs2/device_geometry.c
index f27f71b..1ad3d91 100644
--- a/gfs2/libgfs2/device_geometry.c
+++ b/gfs2/libgfs2/device_geometry.c
@@ -18,8 +18,7 @@
  *
  */
 
-void
-device_geometry(struct gfs2_sbd *sdp)
+void device_geometry(struct gfs2_sbd *sdp)
 {
 	struct device *device = &sdp->device;
 	uint64_t bytes;
@@ -44,8 +43,7 @@ device_geometry(struct gfs2_sbd *sdp)
  *
  */
 
-void
-fix_device_geometry(struct gfs2_sbd *sdp)
+void fix_device_geometry(struct gfs2_sbd *sdp)
 {
 	struct device *device = &sdp->device;
 	unsigned int bbsize = sdp->bsize >> GFS2_BASIC_BLOCK_SHIFT;
diff --git a/gfs2/libgfs2/fs_bits.c b/gfs2/libgfs2/fs_bits.c
index 0a31b0b..c812ce2 100644
--- a/gfs2/libgfs2/fs_bits.c
+++ b/gfs2/libgfs2/fs_bits.c
@@ -30,53 +30,6 @@ static void gfs2_setbit(unsigned char *buffer, unsigned int buflen,
 	}
 }
 
-uint32_t gfs2_bitfit_core(struct gfs2_sbd *sbp, uint64_t goal, uint64_t start,
-						  uint64_t len, unsigned char old_state,
-						  struct gfs2_block_list *bl)
-{
-	uint64_t block;
-	struct gfs2_block_query q;
-
-	for(block = start+goal; block < start+len; block++) {
-		gfs2_block_check(sbp, bl, block, &q);
-		switch(old_state) {
-			/* FIXME Make sure these are handled correctly */
-		case GFS2_BLKST_FREE:
-			switch(q.block_type) {
-			case gfs2_block_free:
-				return block - start;
-			}
-			break;
-		case GFS2_BLKST_DINODE:
-			switch(q.block_type) {
-			case gfs2_inode_dir:
-			case gfs2_inode_file:
-			case gfs2_inode_lnk:
-			case gfs2_inode_blk:
-			case gfs2_inode_chr:
-			case gfs2_inode_fifo:
-			case gfs2_inode_sock:
-				return block - start;
-			}
-			break;
-		case GFS2_BLKST_USED:
-			switch(q.block_type) {
-			case gfs2_indir_blk:
-			case gfs2_leaf_blk:
-			case gfs2_journal_blk:
-			case gfs2_meta_other:
-			case gfs2_meta_eattr:
-			case gfs2_block_used:
-				return block - start;
-			}
-			break;
-		case GFS2_BLKST_UNLINKED:
-		default:
-			break;
-		}
-	}
-	return BFITNOENT;
-}
 /**
  * gfs2_bitfit - Find a free block in the bitmaps
  * @buffer: the buffer that holds the bitmaps
@@ -86,8 +39,9 @@ uint32_t gfs2_bitfit_core(struct gfs2_sbd *sbp, uint64_t goal, uint64_t start,
  *
  * Return: the block number that was allocated
  */
+
 uint32_t gfs2_bitfit(unsigned char *buffer, unsigned int buflen,
-					 uint32_t goal, unsigned char old_state)
+		     uint32_t goal, unsigned char old_state)
 {
 	unsigned char *byte, *end, alloc;
 	uint32_t blk = goal;
@@ -128,7 +82,7 @@ uint32_t gfs2_bitfit(unsigned char *buffer, unsigned int buflen,
  * Returns: The number of bits
  */
 uint32_t gfs2_bitcount(unsigned char *buffer, unsigned int buflen,
-		     unsigned char state)
+		       unsigned char state)
 {
 	unsigned char *byte, *end;
 	unsigned int bit;
@@ -166,68 +120,6 @@ int gfs2_check_range(struct gfs2_sbd *sdp, uint64_t blkno)
 }
 
 /*
- * fs_get_bitmap - get value of FS bitmap
- * @sdp: super block
- * @blkno: block number relative to file system
- *
- * This function gets the value of a bit of the
- * file system bitmap.
- * Possible state values for a block in the bitmap are:
- *  GFS_BLKST_FREE     (0)
- *  GFS_BLKST_USED     (1)
- *  GFS_BLKST_INVALID  (2)
- *  GFS_BLKST_DINODE   (3)
- *
- * Returns: state on success, -1 on error
- */
-int gfs2_get_bitmap(struct gfs2_sbd *sdp, uint64_t blkno,
-					struct rgrp_list *rgd)
-{
-	int           buf, val;
-	uint32_t        rgrp_block;
-	struct gfs2_bitmap	*bits = NULL;
-	unsigned int  bit;
-	unsigned char *byte;
-	int local_rgd = 0;
-
-	if(gfs2_check_range(sdp, blkno))
-		return -1;
-	if(rgd == NULL) {
-		local_rgd = 1;
-		rgd = gfs2_blk2rgrpd(sdp, blkno);
-	}
-	if(rgd == NULL)
-		return -1;
-	if(gfs2_rgrp_read(sdp, rgd))
-		return -1;
-
-	rgrp_block = (uint32_t)(blkno - rgd->ri.ri_data0);
-
-	for(buf= 0; buf < rgd->ri.ri_length; buf++){
-		bits = &(rgd->bits[buf]);
-		if(rgrp_block < ((bits->bi_start + bits->bi_len)*GFS2_NBBY)){
-			break;
-		}
-	}
-
-	if(buf >= rgd->ri.ri_length){
-		gfs2_rgrp_relse(rgd, not_updated);
-		return -1;
-	}
-
-	byte = (unsigned char *)(rgd->bh[buf]->b_data + bits->bi_offset) +
-		(rgrp_block/GFS2_NBBY - bits->bi_start);
-	bit = (rgrp_block % GFS2_NBBY) * GFS2_BIT_SIZE;
-
-	val = ((*byte >> bit) & GFS2_BIT_MASK);
-	if(local_rgd)
-		gfs2_rgrp_relse(rgd, not_updated);
-
-	return val;
-}
-
-
-/*
  * fs_set_bitmap
  * @sdp: super block
  * @blkno: block number relative to file system
diff --git a/gfs2/libgfs2/fs_geometry.c b/gfs2/libgfs2/fs_geometry.c
index f8a2695..3840cd9 100644
--- a/gfs2/libgfs2/fs_geometry.c
+++ b/gfs2/libgfs2/fs_geometry.c
@@ -20,8 +20,7 @@
  * Returns: the number of RGs
  */
 
-uint64_t
-how_many_rgrps(struct gfs2_sbd *sdp, struct device *dev, int rgsize_specified)
+static uint64_t how_many_rgrps(struct gfs2_sbd *sdp, struct device *dev, int rgsize_specified)
 {
 	uint64_t nrgrp;
 
@@ -50,8 +49,7 @@ how_many_rgrps(struct gfs2_sbd *sdp, struct device *dev, int rgsize_specified)
  * Returns: a list of rgrp_list_t structures
  */
 
-void
-compute_rgrp_layout(struct gfs2_sbd *sdp, int rgsize_specified)
+void compute_rgrp_layout(struct gfs2_sbd *sdp, int rgsize_specified)
 {
 	struct device *dev;
 	struct rgrp_list *rl, *rlast = NULL, *rlast2 = NULL;
@@ -143,8 +141,7 @@ compute_rgrp_layout(struct gfs2_sbd *sdp, int rgsize_specified)
  *
  */
 
-void
-rgblocks2bitblocks(unsigned int bsize, uint32_t *rgblocks, uint32_t *bitblocks)
+void rgblocks2bitblocks(unsigned int bsize, uint32_t *rgblocks, uint32_t *bitblocks)
 {
 	unsigned int bitbytes_provided, last = 0;
 	unsigned int bitbytes_needed;
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index 0402e85..ad6b555 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -13,7 +13,7 @@
 #include "libgfs2.h"
 
 /* Detect directory is a stuffed inode */
-int inode_is_stuffed(struct gfs2_inode *ip)
+static int inode_is_stuffed(struct gfs2_inode *ip)
 {
 	return !ip->i_di.di_height;
 }
@@ -37,7 +37,7 @@ void inode_put(struct gfs2_inode *ip, enum update_flags updated)
 	free(ip);
 }
 
-uint64_t blk_alloc_i(struct gfs2_sbd *sdp, unsigned int type)
+static uint64_t blk_alloc_i(struct gfs2_sbd *sdp, unsigned int type)
 {
 	osi_list_t *tmp, *head;
 	struct rgrp_list *rl = NULL;
@@ -79,7 +79,7 @@ uint64_t blk_alloc_i(struct gfs2_sbd *sdp, unsigned int type)
 	die("allocation is broken (1): %"PRIu64" %u\n",
 	    (uint64_t)rl->ri.ri_addr, rl->rg.rg_free);
 
- found:
+found:
 	if (bn >= ri->ri_bitbytes * GFS2_NBBY)
 		die("allocation is broken (2): %u %u %"PRIu64" %u\n",
 		    bn, ri->ri_bitbytes * GFS2_NBBY,
@@ -614,9 +614,8 @@ int gfs2_dirent_next(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
 	return 0;
 }
 
-static int
-dirent_alloc(struct gfs2_inode *dip, struct gfs2_buffer_head *bh, int name_len,
-			 struct gfs2_dirent **dent_out)
+static int dirent_alloc(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
+			int name_len, struct gfs2_dirent **dent_out)
 {
 	struct gfs2_dirent *dent, *new;
 	unsigned int rec_len = GFS2_DIRENT_SIZE(name_len);
@@ -678,7 +677,7 @@ dirent_alloc(struct gfs2_inode *dip, struct gfs2_buffer_head *bh, int name_len,
 }
 
 void dirent2_del(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
-				struct gfs2_dirent *prev, struct gfs2_dirent *cur)
+		 struct gfs2_dirent *prev, struct gfs2_dirent *cur)
 {
 	uint16_t cur_rec_len, prev_rec_len;
 
@@ -721,8 +720,7 @@ void gfs2_put_leaf_nr(struct gfs2_inode *dip, uint32_t inx, uint64_t leaf_out)
 		die("gfs2_put_leaf_nr:  Bad internal write.\n");
 }
 
-static void
-dir_split_leaf(struct gfs2_inode *dip, uint32_t index, uint64_t leaf_no)
+static void dir_split_leaf(struct gfs2_inode *dip, uint32_t index, uint64_t leaf_no)
 {
 	struct gfs2_buffer_head *nbh, *obh;
 	struct gfs2_leaf *nleaf, *oleaf;
@@ -824,8 +822,7 @@ dir_split_leaf(struct gfs2_inode *dip, uint32_t index, uint64_t leaf_no)
 	brelse(nbh, updated);
 }
 
-static void
-dir_double_exhash(struct gfs2_inode *dip)
+static void dir_double_exhash(struct gfs2_inode *dip)
 {
 	struct gfs2_sbd *sdp = dip->i_sbd;
 	uint64_t *buf;
@@ -896,7 +893,7 @@ int gfs2_get_leaf(struct gfs2_inode *dip, uint64_t leaf_no,
  */
 
 static int get_first_leaf(struct gfs2_inode *dip, uint32_t index,
-						  struct gfs2_buffer_head **bh_out)
+			  struct gfs2_buffer_head **bh_out)
 {
 	uint64_t leaf_no;
 
@@ -915,7 +912,7 @@ static int get_first_leaf(struct gfs2_inode *dip, uint32_t index,
  */
 
 static int get_next_leaf(struct gfs2_inode *dip,struct gfs2_buffer_head *bh_in,
-						 struct gfs2_buffer_head **bh_out)
+			 struct gfs2_buffer_head **bh_out)
 {
 	struct gfs2_leaf *leaf;
 
@@ -927,9 +924,8 @@ static int get_next_leaf(struct gfs2_inode *dip,struct gfs2_buffer_head *bh_in,
 	return 0;
 }
 
-static void
-dir_e_add(struct gfs2_inode *dip, char *filename, int len,
-		  struct gfs2_inum *inum, unsigned int type)
+static void dir_e_add(struct gfs2_inode *dip, char *filename, int len,
+		      struct gfs2_inum *inum, unsigned int type)
 {
 	struct gfs2_buffer_head *bh, *nbh;
 	struct gfs2_leaf *leaf, *nleaf;
@@ -1010,8 +1006,7 @@ dir_e_add(struct gfs2_inode *dip, char *filename, int len,
 	}
 }
 
-static void
-dir_make_exhash(struct gfs2_inode *dip)
+static void dir_make_exhash(struct gfs2_inode *dip)
 {
 	struct gfs2_sbd *sdp = dip->i_sbd;
 	struct gfs2_dirent *dent;
@@ -1070,7 +1065,7 @@ dir_make_exhash(struct gfs2_inode *dip)
 }
 
 static void dir_l_add(struct gfs2_inode *dip, char *filename, int len,
-					  struct gfs2_inum *inum, unsigned int type)
+		      struct gfs2_inum *inum, unsigned int type)
 {
 	struct gfs2_dirent *dent;
 
@@ -1090,7 +1085,7 @@ static void dir_l_add(struct gfs2_inode *dip, char *filename, int len,
 }
 
 void dir_add(struct gfs2_inode *dip, char *filename, int len,
-			 struct gfs2_inum *inum, unsigned int type)
+	     struct gfs2_inum *inum, unsigned int type)
 {
 	if (dip->i_di.di_flags & GFS2_DIF_EXHASH)
 		dir_e_add(dip, filename, len, inum, type);
@@ -1098,10 +1093,9 @@ void dir_add(struct gfs2_inode *dip, char *filename, int len,
 		dir_l_add(dip, filename, len, inum, type);
 }
 
-struct gfs2_buffer_head *
-init_dinode(struct gfs2_sbd *sdp, struct gfs2_inum *inum,
-	    unsigned int mode, uint32_t flags,
-	    struct gfs2_inum *parent)
+struct gfs2_buffer_head *init_dinode(struct gfs2_sbd *sdp,
+				     struct gfs2_inum *inum, unsigned int mode,
+				     uint32_t flags, struct gfs2_inum *parent)
 {
 	struct gfs2_buffer_head *bh;
 	struct gfs2_dinode di;
@@ -1162,7 +1156,7 @@ init_dinode(struct gfs2_sbd *sdp, struct gfs2_inum *inum,
 }
 
 struct gfs2_inode *createi(struct gfs2_inode *dip, char *filename,
-						   unsigned int mode, uint32_t flags)
+			   unsigned int mode, uint32_t flags)
 {
 	struct gfs2_sbd *sdp = dip->i_sbd;
 	uint64_t bn;
@@ -1198,7 +1192,8 @@ struct gfs2_inode *createi(struct gfs2_inode *dip, char *filename,
  *
  * Returns: 1 if the files are the same, otherwise 0.
  */
-int gfs2_filecmp(const char *file1, const char *file2, int len_of_file2)
+
+static int gfs2_filecmp(const char *file1, const char *file2, int len_of_file2)
 {
 	if (strlen(file1) != len_of_file2)
 		return 0;
@@ -1216,11 +1211,10 @@ int gfs2_filecmp(const char *file1, const char *file2, int len_of_file2)
  *
  * Returns:
  */
-static int leaf_search(struct gfs2_inode *dip,
-					   struct gfs2_buffer_head *bh, 
-					   const char *filename, int len,
-                       struct gfs2_dirent **dent_out,
-					   struct gfs2_dirent **dent_prev)
+static int leaf_search(struct gfs2_inode *dip, struct gfs2_buffer_head *bh, 
+		       const char *filename, int len,
+		       struct gfs2_dirent **dent_out,
+		       struct gfs2_dirent **dent_prev)
 {
 	uint32_t hash;
 	struct gfs2_dirent *dent, *prev = NULL;
@@ -1274,11 +1268,11 @@ static int leaf_search(struct gfs2_inode *dip,
  *
  * Returns: 0 on sucess, error code otherwise
  */
-static int linked_leaf_search(struct gfs2_inode *dip,
-							  const char *filename, int len,
-                              struct gfs2_dirent **dent_out,
-							  struct gfs2_dirent **dent_prev,
-							  struct gfs2_buffer_head **bh_out)
+
+static int linked_leaf_search(struct gfs2_inode *dip, const char *filename,
+			      int len, struct gfs2_dirent **dent_out,
+			      struct gfs2_dirent **dent_prev,
+			      struct gfs2_buffer_head **bh_out)
 {
 	struct gfs2_buffer_head *bh = NULL, *bh_next;
 	uint32_t hsize, index;
@@ -1320,7 +1314,7 @@ static int linked_leaf_search(struct gfs2_inode *dip,
 		}
 		
 		error = get_next_leaf(dip, bh, &bh_next);
-	}while (!error);
+	} while (!error);
 	
 	brelse(bh, not_updated);
 	
@@ -1336,7 +1330,7 @@ static int linked_leaf_search(struct gfs2_inode *dip,
  * Returns:
  */
 static int dir_e_search(struct gfs2_inode *dip, const char *filename,
-						int len, unsigned int *type, struct gfs2_inum *inum)
+			int len, unsigned int *type, struct gfs2_inum *inum)
 {
 	struct gfs2_buffer_head *bh = NULL;
 	struct gfs2_dirent *dent;
@@ -1365,7 +1359,7 @@ static int dir_e_search(struct gfs2_inode *dip, const char *filename,
  * Returns:
  */
 static int dir_l_search(struct gfs2_inode *dip, const char *filename,
-						int len, unsigned int *type, struct gfs2_inum *inum)
+			int len, unsigned int *type, struct gfs2_inum *inum)
 {
 	struct gfs2_buffer_head *dibh;
 	struct gfs2_dirent *dent;
@@ -1398,8 +1392,8 @@ static int dir_l_search(struct gfs2_inode *dip, const char *filename,
  *
  * Returns: 0 if found, -1 on failure, -ENOENT if not found.
  */
-int dir_search(struct gfs2_inode *dip, const char *filename, int len,
-			   unsigned int *type, struct gfs2_inum *inum)
+static int dir_search(struct gfs2_inode *dip, const char *filename, int len,
+		      unsigned int *type, struct gfs2_inum *inum)
 {
 	int error;
 
@@ -1454,7 +1448,7 @@ static int dir_e_del(struct gfs2_inode *dip, const char *filename, int len)
 }
 
 static int dir_l_del(struct gfs2_inode *dip, struct gfs2_buffer_head *dibh,
-					 const char *filename, int len){
+		     const char *filename, int len){
 	int error=0;
 	int got_buf = 0;
 	struct gfs2_dirent *cur, *prev;
@@ -1498,7 +1492,7 @@ static int dir_l_del(struct gfs2_inode *dip, struct gfs2_buffer_head *dibh,
  * Returns: 0 on success (or if it doesn't already exist), -1 on failure
  */
 int gfs2_dirent_del(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
-					const char *filename, int len){
+		    const char *filename, int len){
 	int error;
 
 	if(!S_ISDIR(dip->i_di.di_mode))
@@ -1521,7 +1515,7 @@ int gfs2_dirent_del(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
  * Returns: 0 on success, -EXXXX on failure
  */
 int gfs2_lookupi(struct gfs2_inode *dip, const char *filename, int len,
-				 struct gfs2_inode **ipp)
+		 struct gfs2_inode **ipp)
 {
 	struct gfs2_sbd *sdp = dip->i_sbd;
 	int error = 0;
diff --git a/gfs2/libgfs2/gfs2_log.c b/gfs2/libgfs2/gfs2_log.c
index 06203fb..e66d7d5 100644
--- a/gfs2/libgfs2/gfs2_log.c
+++ b/gfs2/libgfs2/gfs2_log.c
@@ -27,8 +27,8 @@ void decrease_verbosity(void)
 	_state.print_level--;
 }
 
-void print_msg(int priority, char *file, int line, const char *format,
-			   va_list args) {
+static void print_msg(int priority, char *file, int line, const char *format,
+		      va_list args) {
 
 	switch (priority) {
 
@@ -54,7 +54,7 @@ void print_msg(int priority, char *file, int line, const char *format,
 
 
 void print_fsck_log(int iif, int priority, char *file, int line,
-					const char *format, ...)
+		    const char *format, ...)
 {
 
 	va_list args;
@@ -71,7 +71,7 @@ void print_fsck_log(int iif, int priority, char *file, int line,
 	va_end(args);
 }
 
-char gfs2_getch(void)
+static char gfs2_getch(void)
 {
 	struct termios termattr, savetermattr;
 	char ch;
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 9ea85a5..8656165 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -379,12 +379,10 @@ struct gfs2_buffer_head *bget_generic(struct buf_list *bl, uint64_t num,
 				      int find_existing, int read_disk);
 struct gfs2_buffer_head *bget(struct buf_list *bl, uint64_t num);
 struct gfs2_buffer_head *bread(struct buf_list *bl, uint64_t num);
-struct gfs2_buffer_head *bget_zero(struct buf_list *bl, uint64_t num);
 struct gfs2_buffer_head *bhold(struct gfs2_buffer_head *bh);
 void brelse(struct gfs2_buffer_head *bh, enum update_flags updated);
 void bsync(struct buf_list *bl);
 void bcommit(struct buf_list *bl);
-void bcheck(struct buf_list *bl);
 
 /* device_geometry.c */
 void device_geometry(struct gfs2_sbd *sdp);
@@ -406,15 +404,11 @@ uint32_t gfs2_blkalloc_internal(struct rgrp_list *rgd, uint32_t goal,
 int gfs2_check_range(struct gfs2_sbd *sdp, uint64_t blkno);
 
 /* functions with blk #'s that are file system relative */
-int gfs2_get_bitmap(struct gfs2_sbd *sdp, uint64_t blkno,
-                                        struct rgrp_list *rgd);
 int gfs2_set_bitmap(struct gfs2_sbd *sdp, uint64_t blkno, int state);
 
 /* fs_geometry.c */
 void rgblocks2bitblocks(unsigned int bsize, uint32_t *rgblocks,
 			uint32_t *bitblocks);
-uint64_t how_many_rgrps(struct gfs2_sbd *sdp, struct device *dev,
-			int rgsize_specified);
 void compute_rgrp_layout(struct gfs2_sbd *sdp, int rgsize_specified);
 void build_rgrps(struct gfs2_sbd *sdp, int write);
 
@@ -617,8 +611,6 @@ void increase_verbosity(void);
 void decrease_verbosity(void);
 void print_fsck_log(int iif, int priority, char *file, int line,
 					const char *format, ...);
-char gfs2_getch(void);
-
 char generic_interrupt(const char *caller, const char *where,
 		       const char *progress, const char *question,
 		       const char *answers);
@@ -679,10 +671,7 @@ void build_quota(struct gfs2_sbd *sdp);
 void build_root(struct gfs2_sbd *sdp);
 void do_init(struct gfs2_sbd *sdp);
 int gfs2_check_meta(struct gfs2_buffer_head *bh, int type);
-int gfs2_set_meta(struct gfs2_buffer_head *bh, int type, int format);
 int gfs2_next_rg_meta(struct rgrp_list *rgd, uint64_t *block, int first);
-int gfs2_next_rg_meta_free(struct rgrp_list *rgd, uint64_t *block, int first,
-						   int *mfree);
 int gfs2_next_rg_metatype(struct gfs2_sbd *sdp, struct rgrp_list *rgd,
 						  uint64_t *block, uint32_t type, int first);
 /* super.c */
diff --git a/gfs2/libgfs2/locking.c b/gfs2/libgfs2/locking.c
index 6e1fa5a..b9199c4 100644
--- a/gfs2/libgfs2/locking.c
+++ b/gfs2/libgfs2/locking.c
@@ -15,8 +15,7 @@
  *
  */
 
-void
-test_locking(char *lockproto, char *locktable)
+void test_locking(char *lockproto, char *locktable)
 {
 	char *c;
 
diff --git a/gfs2/libgfs2/size.c b/gfs2/libgfs2/size.c
index e96f4bc..d9d2c54 100644
--- a/gfs2/libgfs2/size.c
+++ b/gfs2/libgfs2/size.c
@@ -23,8 +23,7 @@
  * Returns: -1 on error (with errno set), 0 on success (with @bytes set)
  */
 
-static int
-do_device_size(int fd, uint64_t *bytes)
+static int do_device_size(int fd, uint64_t *bytes)
 {
 	off_t off;
 
@@ -45,8 +44,7 @@ do_device_size(int fd, uint64_t *bytes)
  * Returns: -1 on error (with errno set), 0 on success (with @bytes set)
  */
 
-int
-device_size(int fd, uint64_t *bytes)
+int device_size(int fd, uint64_t *bytes)
 {
 	struct stat st;
 	int error;
diff --git a/gfs2/libgfs2/structures.c b/gfs2/libgfs2/structures.c
index fdb9bdd..6c9a8b2 100644
--- a/gfs2/libgfs2/structures.c
+++ b/gfs2/libgfs2/structures.c
@@ -32,8 +32,7 @@ void build_master(struct gfs2_sbd *sdp)
 	}
 }
 
-void
-build_sb(struct gfs2_sbd *sdp)
+void build_sb(struct gfs2_sbd *sdp)
 {
 	unsigned int x;
 	struct gfs2_buffer_head *bh;
@@ -80,7 +79,7 @@ build_sb(struct gfs2_sbd *sdp)
 }
 
 void write_journal(struct gfs2_sbd *sdp, struct gfs2_inode *ip, unsigned int j,
-				   unsigned int blocks)
+		   unsigned int blocks)
 {
 	struct gfs2_log_header lh;
 	unsigned int x;
@@ -128,8 +127,7 @@ void write_journal(struct gfs2_sbd *sdp, struct gfs2_inode *ip, unsigned int j,
 	}
 }
 
-void
-build_jindex(struct gfs2_sbd *sdp)
+void build_jindex(struct gfs2_sbd *sdp)
 {
 	struct gfs2_inode *jindex;
 	unsigned int j;
@@ -156,8 +154,7 @@ build_jindex(struct gfs2_sbd *sdp)
 	inode_put(jindex, updated);
 }
 
-static void
-build_inum_range(struct gfs2_inode *per_node, unsigned int j)
+static void build_inum_range(struct gfs2_inode *per_node, unsigned int j)
 {
 	struct gfs2_sbd *sdp = per_node->i_sbd;
 	char name[256];
@@ -176,8 +173,7 @@ build_inum_range(struct gfs2_inode *per_node, unsigned int j)
 	inode_put(ip, updated);
 }
 
-static void
-build_statfs_change(struct gfs2_inode *per_node, unsigned int j)
+static void build_statfs_change(struct gfs2_inode *per_node, unsigned int j)
 {
 	struct gfs2_sbd *sdp = per_node->i_sbd;
 	char name[256];
@@ -196,8 +192,7 @@ build_statfs_change(struct gfs2_inode *per_node, unsigned int j)
 	inode_put(ip, updated);
 }
 
-static void
-build_quota_change(struct gfs2_inode *per_node, unsigned int j)
+static void build_quota_change(struct gfs2_inode *per_node, unsigned int j)
 {
 	struct gfs2_sbd *sdp = per_node->i_sbd;
 	struct gfs2_meta_header mh;
@@ -233,8 +228,7 @@ build_quota_change(struct gfs2_inode *per_node, unsigned int j)
 	inode_put(ip, updated);
 }
 
-void
-build_per_node(struct gfs2_sbd *sdp)
+void build_per_node(struct gfs2_sbd *sdp)
 {
 	struct gfs2_inode *per_node;
 	unsigned int j;
@@ -256,8 +250,7 @@ build_per_node(struct gfs2_sbd *sdp)
 	inode_put(per_node, updated);
 }
 
-void
-build_inum(struct gfs2_sbd *sdp)
+void build_inum(struct gfs2_sbd *sdp)
 {
 	struct gfs2_inode *ip;
 
@@ -272,8 +265,7 @@ build_inum(struct gfs2_sbd *sdp)
 	sdp->md.inum = ip;
 }
 
-void
-build_statfs(struct gfs2_sbd *sdp)
+void build_statfs(struct gfs2_sbd *sdp)
 {
 	struct gfs2_inode *ip;
 
@@ -288,8 +280,7 @@ build_statfs(struct gfs2_sbd *sdp)
 	sdp->md.statfs = ip;
 }
 
-void
-build_rindex(struct gfs2_sbd *sdp)
+void build_rindex(struct gfs2_sbd *sdp)
 {
 	struct gfs2_inode *ip;
 	osi_list_t *tmp, *head;
@@ -322,8 +313,7 @@ build_rindex(struct gfs2_sbd *sdp)
 	inode_put(ip, updated);
 }
 
-void
-build_quota(struct gfs2_sbd *sdp)
+void build_quota(struct gfs2_sbd *sdp)
 {
 	struct gfs2_inode *ip;
 	struct gfs2_quota qu;
@@ -353,8 +343,7 @@ build_quota(struct gfs2_sbd *sdp)
 	inode_put(ip, updated);
 }
 
-void
-build_root(struct gfs2_sbd *sdp)
+void build_root(struct gfs2_sbd *sdp)
 {
 	struct gfs2_inum inum;
 	uint64_t bn;
@@ -373,8 +362,7 @@ build_root(struct gfs2_sbd *sdp)
 	}
 }
 
-void
-do_init(struct gfs2_sbd *sdp)
+void do_init(struct gfs2_sbd *sdp)
 {
 	{
 		struct gfs2_inode *ip = sdp->md.inum;
@@ -435,32 +423,6 @@ int gfs2_check_meta(struct gfs2_buffer_head *bh, int type)
 	return 0;
 }
 
-/*
- * set_meta - set the meta header of a buffer
- * @bh
- * @type
- *
- * Returns: 0 if ok, -1 on error
- */
-int gfs2_set_meta(struct gfs2_buffer_head *bh, int type, int format)
-{
-	struct gfs2_meta_header header;
-
-	if(!gfs2_check_meta(bh, 0)){
-		((struct gfs2_meta_header *)bh->b_data)->mh_type = cpu_to_be32(type);
-		((struct gfs2_meta_header *)bh->b_data)->mh_format = 
-			cpu_to_be32(format);
-	} else {
-		memset(&header, 0, sizeof(struct gfs2_meta_header));
-		header.mh_magic = GFS2_MAGIC;
-		header.mh_type = type;
-		header.mh_format = format;
-		
-		gfs2_meta_header_out(&header, bh->b_data);
-	}
-	return 0;
-}
-
 /**
  * gfs2_next_rg_meta
  * @rgd:
@@ -506,71 +468,6 @@ int gfs2_next_rg_meta(struct rgrp_list *rgd, uint64_t *block, int first)
 }
 
 /**
- * gfs2_next_rg_meta_free - finds free or used metadata
- * @rgd:
- * @block:
- * @first: if set, start at zero and ignore block
- *
- * The position to start looking from is *block.  When a block
- * is found, it is returned in block.
- *
- * Returns: 0 on success, -1 when finished
- */
-int gfs2_next_rg_meta_free(struct rgrp_list *rgd, uint64_t *block, int first,
-						   int *mfree)
-{
-	gfs2_bitmap_t *bits = NULL;
-	uint32_t length = rgd->ri.ri_length;
-	uint32_t blk = (first)? 0: (uint32_t)((*block+1)-rgd->ri.ri_data0);
-	uint32_t iblk, ublk, fblk;
-	int i;
-	
-	if(!first && (*block < rgd->ri.ri_data0)) {
-		log_err("next_rg_meta_free:  Start block is outside rgrp bounds.\n");
-		exit(1);
-	}
-	for(i=0; i < length; i++){
-		bits = &rgd->bits[i];
-		if(blk < bits->bi_len*GFS2_NBBY)
-			break;
-		blk -= bits->bi_len*GFS2_NBBY;
-	}
-	for(; i < length; i++){
-		bits = &rgd->bits[i];
-
-		iblk = gfs2_bitfit((unsigned char *)rgd->bh[i]->b_data +
-						   bits->bi_offset, bits->bi_len, blk,
-						   GFS2_BLKST_DINODE);
-		ublk = gfs2_bitfit((unsigned char *)rgd->bh[i]->b_data +
-						   bits->bi_offset, bits->bi_len, blk,
-						   GFS2_BLKST_USED);
-		fblk = gfs2_bitfit((unsigned char *)rgd->bh[i]->b_data +
-						   bits->bi_offset, bits->bi_len, blk,
-						   GFS2_BLKST_FREE);
-		if(ublk < fblk) {
-            blk = ublk;
-            *mfree = 0;
-		}
-		else if(iblk < fblk) {
-            blk = iblk;
-            *mfree = 0;
-		} else {
-            blk = fblk;
-            *mfree = 1;
-		}
-		if(blk != BFITNOENT){
-            *block = blk + (bits->bi_start * GFS2_NBBY) + rgd->ri.ri_data0;
-            break;
-		}
-		blk=0;
-	}
-
-	if(i == length)
-		return -1;
-	return 0;
-}
-
-/**
  * next_rg_metatype
  * @rgd:
  * @block:
@@ -580,7 +477,7 @@ int gfs2_next_rg_meta_free(struct rgrp_list *rgd, uint64_t *block, int first,
  * Returns: 0 on success, -1 on error or finished
  */
 int gfs2_next_rg_metatype(struct gfs2_sbd *sdp, struct rgrp_list *rgd,
-						  uint64_t *block, uint32_t type, int first)
+			  uint64_t *block, uint32_t type, int first)
 {
 	struct gfs2_buffer_head *bh = NULL;
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]