All of lore.kernel.org
 help / color / mirror / Atom feed
From: rpeterso@sourceware.org <rpeterso@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/gfs2 fsck/initialize.c libgfs2/fs_ops. ...
Date: 26 Jun 2007 01:51:45 -0000	[thread overview]
Message-ID: <20070626015145.4709.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	rpeterso at 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);



             reply	other threads:[~2007-06-26  1:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-26  1:51 rpeterso [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-06-26  1:43 [Cluster-devel] cluster/gfs2 fsck/initialize.c libgfs2/fs_ops. rpeterso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070626015145.4709.qmail@sourceware.org \
    --to=rpeterso@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.