[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
Branch: 	RHEL5
Changes by:	rpeterso sourceware org	2007-06-26 01:51:45

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&only_with_tag=RHEL5&r1=1.6.2.2&r2=1.6.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/libgfs2/fs_ops.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4.2.5&r2=1.4.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/libgfs2/libgfs2.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.7.2.7&r2=1.7.2.8
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/libgfs2/misc.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2.2.1&r2=1.2.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/libgfs2/structures.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.5.2.4&r2=1.5.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mkfs/main_jadd.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.10.2.1&r2=1.10.2.2

--- cluster/gfs2/fsck/initialize.c	2007/05/01 18:20:49	1.6.2.2
+++ cluster/gfs2/fsck/initialize.c	2007/06/26 01:51:44	1.6.2.3
@@ -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:50:44	1.4.2.5
+++ cluster/gfs2/libgfs2/fs_ops.c	2007/06/26 01:51:44	1.4.2.6
@@ -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:50:00	1.7.2.7
+++ cluster/gfs2/libgfs2/libgfs2.h	2007/06/26 01:51:44	1.7.2.8
@@ -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/11 16:53:32	1.2.2.1
+++ cluster/gfs2/libgfs2/misc.c	2007/06/26 01:51:44	1.2.2.2
@@ -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:21:12	1.5.2.4
+++ cluster/gfs2/libgfs2/structures.c	2007/06/26 01:51:44	1.5.2.5
@@ -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/11 16:53:32	1.10.2.1
+++ cluster/gfs2/mkfs/main_jadd.c	2007/06/26 01:51:45	1.10.2.2
@@ -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]