cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: swhiteho@redhat.com <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 12/24] GFS2: Banish struct gfs2_rgrpd_host
Date: Wed, 17 Dec 2008 11:30:11 +0000	[thread overview]
Message-ID: <1229513423-19105-13-git-send-email-swhiteho@redhat.com> (raw)
In-Reply-To: <1229513423-19105-12-git-send-email-swhiteho@redhat.com>

From: Steven Whitehouse <swhiteho@redhat.com>

This patch moves the final field so that we can get rid
of struct gfs2_rgrpd_host, as promised some time ago. Also
by rearranging the fields slightly, we are able to reduce
the size of the gfs2_rgrpd structure at the same time.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index f8d9773..9e3b613 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -68,10 +68,6 @@ struct gfs2_bitmap {
 	u32 bi_len;
 };
 
-struct gfs2_rgrp_host {
-	u32 rg_dinodes;
-};
-
 struct gfs2_rgrpd {
 	struct list_head rd_list;	/* Link with superblock */
 	struct list_head rd_list_mru;
@@ -82,15 +78,15 @@ struct gfs2_rgrpd {
 	u32 rd_data;			/* num of data blocks in rgrp */
 	u32 rd_bitbytes;		/* number of bytes in data bitmaps */
 	u32 rd_free;
-	struct gfs2_rgrp_host rd_rg;
+	u32 rd_free_clone;
+	u32 rd_dinodes;
 	u64 rd_igeneration;
 	struct gfs2_bitmap *rd_bits;
-	unsigned int rd_bh_count;
 	struct mutex rd_mutex;
-	u32 rd_free_clone;
 	struct gfs2_log_element rd_le;
-	u32 rd_last_alloc;
 	struct gfs2_sbd *rd_sbd;
+	unsigned int rd_bh_count;
+	u32 rd_last_alloc;
 	unsigned char rd_flags;
 #define GFS2_RDF_CHECK        0x01      /* Need to check for unlinked inodes */
 #define GFS2_RDF_NOALLOC      0x02      /* rg prohibits allocation */
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index bab9cfa..8b01c63 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -276,9 +276,7 @@ void gfs2_rgrp_verify(struct gfs2_rgrpd *rgd)
 		return;
 	}
 
-	tmp = rgd->rd_data -
-		rgd->rd_free -
-		rgd->rd_rg.rg_dinodes;
+	tmp = rgd->rd_data - rgd->rd_free - rgd->rd_dinodes;
 	if (count[1] + count[2] != tmp) {
 		if (gfs2_consist_rgrpd(rgd))
 			fs_err(sdp, "used data mismatch:  %u != %u\n",
@@ -286,10 +284,10 @@ void gfs2_rgrp_verify(struct gfs2_rgrpd *rgd)
 		return;
 	}
 
-	if (count[3] != rgd->rd_rg.rg_dinodes) {
+	if (count[3] != rgd->rd_dinodes) {
 		if (gfs2_consist_rgrpd(rgd))
 			fs_err(sdp, "used metadata mismatch:  %u != %u\n",
-			       count[3], rgd->rd_rg.rg_dinodes);
+			       count[3], rgd->rd_dinodes);
 		return;
 	}
 
@@ -692,7 +690,6 @@ int gfs2_rindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ri_gh)
 static void gfs2_rgrp_in(struct gfs2_rgrpd *rgd, const void *buf)
 {
 	const struct gfs2_rgrp *str = buf;
-	struct gfs2_rgrp_host *rg = &rgd->rd_rg;
 	u32 rg_flags;
 
 	rg_flags = be32_to_cpu(str->rg_flags);
@@ -701,21 +698,20 @@ static void gfs2_rgrp_in(struct gfs2_rgrpd *rgd, const void *buf)
 	else
 		rgd->rd_flags &= ~GFS2_RDF_NOALLOC;
 	rgd->rd_free = be32_to_cpu(str->rg_free);
-	rg->rg_dinodes = be32_to_cpu(str->rg_dinodes);
+	rgd->rd_dinodes = be32_to_cpu(str->rg_dinodes);
 	rgd->rd_igeneration = be64_to_cpu(str->rg_igeneration);
 }
 
 static void gfs2_rgrp_out(struct gfs2_rgrpd *rgd, void *buf)
 {
 	struct gfs2_rgrp *str = buf;
-	struct gfs2_rgrp_host *rg = &rgd->rd_rg;
 	u32 rg_flags = 0;
 
 	if (rgd->rd_flags & GFS2_RDF_NOALLOC)
 		rg_flags |= GFS2_RGF_NOALLOC;
 	str->rg_flags = cpu_to_be32(rg_flags);
 	str->rg_free = cpu_to_be32(rgd->rd_free);
-	str->rg_dinodes = cpu_to_be32(rg->rg_dinodes);
+	str->rg_dinodes = cpu_to_be32(rgd->rd_dinodes);
 	str->__pad = cpu_to_be32(0);
 	str->rg_igeneration = cpu_to_be64(rgd->rd_igeneration);
 	memset(&str->rg_reserved, 0, sizeof(str->rg_reserved));
@@ -1447,7 +1443,7 @@ u64 gfs2_alloc_di(struct gfs2_inode *dip, u64 *generation)
 
 	gfs2_assert_withdraw(sdp, rgd->rd_free);
 	rgd->rd_free--;
-	rgd->rd_rg.rg_dinodes++;
+	rgd->rd_dinodes++;
 	*generation = rgd->rd_igeneration++;
 	gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1);
 	gfs2_rgrp_out(rgd, rgd->rd_bits[0].bi_bh->b_data);
@@ -1546,9 +1542,9 @@ static void gfs2_free_uninit_di(struct gfs2_rgrpd *rgd, u64 blkno)
 		return;
 	gfs2_assert_withdraw(sdp, rgd == tmp_rgd);
 
-	if (!rgd->rd_rg.rg_dinodes)
+	if (!rgd->rd_dinodes)
 		gfs2_consist_rgrpd(rgd);
-	rgd->rd_rg.rg_dinodes--;
+	rgd->rd_dinodes--;
 	rgd->rd_free++;
 
 	gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1);
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index e769076..b858770 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -469,7 +469,7 @@ static int statfs_slow_fill(struct gfs2_rgrpd *rgd,
 	gfs2_rgrp_verify(rgd);
 	sc->sc_total += rgd->rd_data;
 	sc->sc_free += rgd->rd_free;
-	sc->sc_dinodes += rgd->rd_rg.rg_dinodes;
+	sc->sc_dinodes += rgd->rd_dinodes;
 	return 0;
 }
 
-- 
1.6.0.3



  reply	other threads:[~2008-12-17 11:30 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-17 11:29 [Cluster-devel] GFS2: Pre-pull patch posting swhiteho
2008-12-17 11:30 ` [Cluster-devel] [PATCH 01/24] GFS2: Support for FIEMAP ioctl swhiteho
2008-12-17 11:30   ` [Cluster-devel] [PATCH 02/24] GFS2: Rationalise header files swhiteho
2008-12-17 11:30     ` [Cluster-devel] [PATCH 03/24] GFS2: Fix up jdata writepage/delete_inode swhiteho
2008-12-17 11:30       ` [Cluster-devel] [PATCH 04/24] GFS2: sparse annotation of gl->gl_spin swhiteho
2008-12-17 11:30         ` [Cluster-devel] [PATCH 05/24] GFS2: Move generation number into "proper" part of inode swhiteho
2008-12-17 11:30           ` [Cluster-devel] [PATCH 06/24] GFS2: Move "entries" into "proper" inode swhiteho
2008-12-17 11:30             ` [Cluster-devel] [PATCH 07/24] GFS2: Move di_eattr " swhiteho
2008-12-17 11:30               ` [Cluster-devel] [PATCH 08/24] GFS2: Move i_size from gfs2_dinode_host and rename it to i_disksize swhiteho
2008-12-17 11:30                 ` [Cluster-devel] [PATCH 09/24] GFS2: Banish struct gfs2_dinode_host swhiteho
2008-12-17 11:30                   ` [Cluster-devel] [PATCH 10/24] GFS2: Move rg_igeneration into struct gfs2_rgrpd swhiteho
2008-12-17 11:30                     ` [Cluster-devel] [PATCH 11/24] GFS2: Move rg_free from gfs2_rgrpd_host to gfs2_rgrpd swhiteho
2008-12-17 11:30                       ` swhiteho [this message]
2008-12-17 11:30                         ` [Cluster-devel] [PATCH 13/24] GFS2: Add more detail to debugfs glock dumps swhiteho
2008-12-17 11:30                           ` [Cluster-devel] [PATCH 14/24] GFS2: Clean up & move gfs2_quotad swhiteho
2008-12-17 11:30                             ` [Cluster-devel] [PATCH 15/24] GFS2: Fix "truncate in progress" hang swhiteho
2008-12-17 11:30                               ` [Cluster-devel] [PATCH 16/24] GFS2: Move gfs2_recoverd into recovery.c swhiteho
2008-12-17 11:30                                 ` [Cluster-devel] [PATCH 17/24] GFS2: Kill two daemons with one patch swhiteho
2008-12-17 11:30                                   ` [Cluster-devel] [PATCH 18/24] GFS2: Send some sensible sysfs stuff swhiteho
2008-12-17 11:30                                     ` [Cluster-devel] [PATCH 19/24] GFS2: Fix bug in gfs2_lock_fs_check_clean() swhiteho
2008-12-17 11:30                                       ` [Cluster-devel] [PATCH 20/24] GFS2: Move four functions from super.c swhiteho
2008-12-17 11:30                                         ` [Cluster-devel] [PATCH 21/24] GFS2: Remove ancient, unused code swhiteho
2008-12-17 11:30                                           ` [Cluster-devel] [PATCH 22/24] GFS2: Fix use-after-free bug on umount swhiteho
2008-12-17 11:30                                             ` [Cluster-devel] [PATCH 23/24] GFS2: Send useful information with uevent messages swhiteho
2008-12-17 11:30                                               ` [Cluster-devel] [PATCH 24/24] GFS2: Streamline alloc calculations for writes swhiteho
2008-12-18  1:22   ` [Cluster-devel] Re: [PATCH 01/24] GFS2: Support for FIEMAP ioctl Andrew Morton
2008-12-18 10:29     ` Steven Whitehouse
2008-12-18 19:04       ` Andrew Morton

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=1229513423-19105-13-git-send-email-swhiteho@redhat.com \
    --to=swhiteho@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).