[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/gfs2 fsck/initialize.c libgfs2/fs_ops. ...



CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	rpeterso sourceware org	2007-06-26 01:43:17

Modified files:
	gfs2/fsck      : initialize.c 
	gfs2/libgfs2   : fs_ops.c libgfs2.h misc.c structures.c 
	gfs2/mkfs      : main_jadd.c 

Log message:
	Resolves: bz 245360: GFS2: userland tools have problems with small
	block sizes

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/fsck/initialize.c.diff?cvsroot=cluster&r1=1.8&r2=1.9
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/libgfs2/fs_ops.c.diff?cvsroot=cluster&r1=1.9&r2=1.10
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/libgfs2/libgfs2.h.diff?cvsroot=cluster&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/libgfs2/misc.c.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/libgfs2/structures.c.diff?cvsroot=cluster&r1=1.9&r2=1.10
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mkfs/main_jadd.c.diff?cvsroot=cluster&r1=1.11&r2=1.12

--- cluster/gfs2/fsck/initialize.c	2007/05/01 16:43:38	1.8
+++ cluster/gfs2/fsck/initialize.c	2007/06/26 01:43:17	1.9
@@ -215,7 +215,7 @@
 	log_info("Initializing lists...\n");
 	osi_list_init(&sdp->rglist);
 	osi_list_init(&sdp->buf_list);
-	for(i = 0; i < FSCK_HASH_SIZE; i++) {
+	for(i = 0; i < BUF_HASH_SIZE; i++) {
 		osi_list_init(&dir_hash[i]);
 		osi_list_init(&inode_hash[i]);
 		osi_list_init(&sdp->buf_hash[i]);
--- cluster/gfs2/libgfs2/fs_ops.c	2007/06/22 20:49:10	1.9
+++ cluster/gfs2/libgfs2/fs_ops.c	2007/06/26 01:43:17	1.10
@@ -463,7 +463,7 @@
 		lblock = offset;
 		o = do_div(lblock, sdp->sd_jbsize);
 	} else {
-		lblock = offset >> sdp->bsize_shift;
+		lblock = offset >> sdp->sd_sb.sb_bsize_shift;
 		o = offset & (sdp->bsize - 1);
 	}
 
@@ -534,7 +534,7 @@
 		lblock = offset;
 		o = do_div(lblock, sdp->sd_jbsize);
 	} else {
-		lblock = offset >> sdp->bsize_shift;
+		lblock = offset >> sdp->sd_sb.sb_bsize_shift;
 		o = offset & (sdp->bsize - 1);
 	}
 
@@ -596,8 +596,8 @@
 		die("get_file_buf\n");
 
 	if (!prealloc && new &&
-	    ip->i_di.di_size < (lbn + 1) << sdp->bsize_shift)
-		ip->i_di.di_size = (lbn + 1) << sdp->bsize_shift;
+	    ip->i_di.di_size < (lbn + 1) << sdp->sd_sb.sb_bsize_shift)
+		ip->i_di.di_size = (lbn + 1) << sdp->sd_sb.sb_bsize_shift;
 
 	if (new)
 		return bget(sdp, dbn);
--- cluster/gfs2/libgfs2/libgfs2.h	2007/06/18 21:35:58	1.14
+++ cluster/gfs2/libgfs2/libgfs2.h	2007/06/26 01:43:17	1.15
@@ -170,7 +170,6 @@
 
 	/* Constants */
 
-	unsigned int bsize_shift;
 	uint32_t sd_fsb2bb;
 	uint32_t sd_fsb2bb_shift;
 	uint32_t sd_diptrs;
@@ -534,6 +533,7 @@
 int gfs2_next_rg_metatype(struct gfs2_sbd *sdp, struct rgrp_list *rgd,
 						  uint64_t *block, uint32_t type, int first);
 /* super.c */
+int check_sb(struct gfs2_sb *sb);
 int read_sb(struct gfs2_sbd *sdp);
 int ji_update(struct gfs2_sbd *sdp);
 int rindex_read(struct gfs2_sbd *sdp, int fd, int *count1);
--- cluster/gfs2/libgfs2/misc.c	2007/05/10 15:47:44	1.3
+++ cluster/gfs2/libgfs2/misc.c	2007/06/26 01:43:17	1.4
@@ -37,10 +37,10 @@
 
 	sdp->md.next_inum = 1;
 
-	sdp->bsize_shift = ffs(sdp->bsize) - 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->bsize_shift -
+	sdp->sd_fsb2bb_shift = sdp->sd_sb.sb_bsize_shift -
 		GFS2_BASIC_BLOCK_SHIFT;
 	sdp->sd_fsb2bb = 1 << sdp->sd_fsb2bb_shift;
 	sdp->sd_diptrs = (sdp->bsize - sizeof(struct gfs2_dinode)) /
@@ -49,7 +49,7 @@
 		sizeof(uint64_t);
 	sdp->sd_jbsize = sdp->bsize - sizeof(struct gfs2_meta_header);
 	sdp->sd_hash_bsize = sdp->bsize / 2;
-	sdp->sd_hash_bsize_shift = sdp->bsize_shift - 1;
+	sdp->sd_hash_bsize_shift = sdp->sd_sb.sb_bsize_shift - 1;
 	sdp->sd_hash_ptrs = sdp->sd_hash_bsize / sizeof(uint64_t);
 
 	/*  Compute maximum reservation required to add a entry to a directory  */
--- cluster/gfs2/libgfs2/structures.c	2007/06/06 15:19:55	1.9
+++ cluster/gfs2/libgfs2/structures.c	2007/06/26 01:43:17	1.10
@@ -67,7 +67,7 @@
 	sb.sb_fs_format = GFS2_FORMAT_FS;
 	sb.sb_multihost_format = GFS2_FORMAT_MULTI;
 	sb.sb_bsize = sdp->bsize;
-	sb.sb_bsize_shift = sdp->bsize_shift;
+	sb.sb_bsize_shift = ffs(sdp->bsize) - 1;
 	sb.sb_master_dir = sdp->master_dir->i_di.di_num;
 	sb.sb_root_dir = sdp->md.rooti->i_di.di_num;
 	strcpy(sb.sb_lockproto, sdp->lockproto);
@@ -147,7 +147,8 @@
 
 		sprintf(name, "journal%u", j);
 		ip = createi(jindex, name, S_IFREG | 0600, GFS2_DIF_SYSTEM);
-		write_journal(sdp, ip, j, sdp->jsize << 20 >> sdp->bsize_shift);
+		write_journal(sdp, ip, j,
+			      sdp->jsize << 20 >> sdp->sd_sb.sb_bsize_shift);
 		inode_put(ip, updated);
 	}
 
@@ -206,7 +207,7 @@
 	struct gfs2_meta_header mh;
 	char name[256];
 	struct gfs2_inode *ip;
-	unsigned int blocks = sdp->qcsize << (20 - sdp->bsize_shift);
+	unsigned int blocks = sdp->qcsize << (20 - sdp->sd_sb.sb_bsize_shift);
 	unsigned int x;
 
 	memset(&mh, 0, sizeof(struct gfs2_meta_header));
@@ -219,7 +220,7 @@
 		     GFS2_DIF_SYSTEM);
 
 	for (x = 0; x < blocks; x++) {
-		struct gfs2_buffer_head *bh = get_file_buf(ip, ip->i_di.di_size >> sdp->bsize_shift, FALSE);
+		struct gfs2_buffer_head *bh = get_file_buf(ip, ip->i_di.di_size >> sdp->sd_sb.sb_bsize_shift, FALSE);
 		if (!bh)
 			die("build_quota_change\n");
 
--- cluster/gfs2/mkfs/main_jadd.c	2007/05/10 15:47:45	1.11
+++ cluster/gfs2/mkfs/main_jadd.c	2007/06/26 01:43:17	1.12
@@ -295,7 +295,8 @@
 
 	{
 		char buf[sdp->bsize];
-		unsigned int blocks = sdp->qcsize << (20 - sdp->bsize_shift);
+		unsigned int blocks =
+			sdp->qcsize << (20 - sdp->sd_sb.sb_bsize_shift);
 		unsigned int x;
 		struct gfs2_meta_header mh;
 
@@ -418,7 +419,8 @@
 
 	{
 		char buf[sdp->bsize];
-		unsigned int blocks = sdp->jsize << (20 - sdp->bsize_shift);
+		unsigned int blocks =
+			sdp->jsize << (20 - sdp->sd_sb.sb_bsize_shift);
 		unsigned int x;
 		struct gfs2_log_header lh;
 		uint64_t seq = RANDOM(blocks);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]