cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Andreas Gruenbacher <agruenba@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 03/11] gfs2: Don't use struct gfs2_rbm in struct gfs2_extent
Date: Fri, 11 Jan 2019 17:05:40 +0100	[thread overview]
Message-ID: <20190111160548.9423-4-agruenba@redhat.com> (raw)
In-Reply-To: <20190111160548.9423-1-agruenba@redhat.com>

Don't use struct gfs2_rbm in struct gfs2_extent: the extent will always
be in the same resource group, so there is no need to track the resource
group separately.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
 fs/gfs2/rgrp.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index cfef8cc5fa155..2ce46e372b020 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -61,7 +61,8 @@
  */
 
 struct gfs2_extent {
-	struct gfs2_rbm rbm;
+	int bii;
+	u32 offset;
 	u32 len;
 };
 
@@ -1696,8 +1697,9 @@ static int gfs2_reservation_check_and_update(struct gfs2_rbm *rbm,
 			return 0;
 
 		if (extlen > maxext->len) {
+			maxext->bii = rbm->bii;
+			maxext->offset = rbm->offset;
 			maxext->len = extlen;
-			maxext->rbm = *rbm;
 		}
 fail:
 		nblock = block + extlen;
@@ -1740,7 +1742,7 @@ static int gfs2_rbm_find(struct gfs2_rbm *rbm, u8 state, u32 *minlen,
 	int iters = rbm->rgd->rd_length;
 	int ret;
 	struct gfs2_bitmap *bi;
-	struct gfs2_extent maxext = { .rbm.rgd = rbm->rgd, };
+	struct gfs2_extent maxext = { };
 
 	/* If we are not starting at the beginning of a bitmap, then we
 	 * need to add one to the bitmap count to ensure that we search
@@ -1816,7 +1818,8 @@ static int gfs2_rbm_find(struct gfs2_rbm *rbm, u8 state, u32 *minlen,
 	/* If the maximum extent we found is big enough to fulfill the
 	   minimum requirements, use it anyway. */
 	if (maxext.len) {
-		*rbm = maxext.rbm;
+		rbm->bii = maxext.bii;
+		rbm->offset = maxext.offset;
 		*minlen = maxext.len;
 		return 0;
 	}
-- 
2.20.1



  parent reply	other threads:[~2019-01-11 16:05 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-11 16:05 [Cluster-devel] [PATCH 00/11] Read bitmap buffers on demand Andreas Gruenbacher
2019-01-11 16:05 ` [Cluster-devel] [PATCH 01/11] gfs2: Fix setting GBF_FULL in gfs2_rbm_find Andreas Gruenbacher
2019-01-11 16:05 ` [Cluster-devel] [PATCH 02/11] gfs2: Rename minext => minlen Andreas Gruenbacher
2019-01-11 16:05 ` Andreas Gruenbacher [this message]
2019-01-11 16:05 ` [Cluster-devel] [PATCH 04/11] gfs2: Minor gfs2_free_extlen cleanup Andreas Gruenbacher
2019-01-11 16:05 ` [Cluster-devel] [PATCH 05/11] gfs2: Only use struct gfs2_rbm for bitmap manipulations Andreas Gruenbacher
2019-01-11 16:05 ` [Cluster-devel] [PATCH 06/11] gfs2: Minor gfs2_adjust_reservation and gfs2_alloc_extent cleanups Andreas Gruenbacher
2019-01-11 16:05 ` [Cluster-devel] [PATCH 07/11] gfs2: Minor gfs2_rgrp_send_discards cleanup Andreas Gruenbacher
2019-01-11 16:05 ` [Cluster-devel] [PATCH 08/11] gfs2: Add buffer head to struct gfs2_rgrpd Andreas Gruenbacher
2019-01-11 16:05 ` [Cluster-devel] [PATCH 09/11] gfs2: Read bitmap buffers on demand Andreas Gruenbacher
2019-01-14 17:12   ` Bob Peterson
2019-01-14 18:41     ` Andreas Gruenbacher
2019-01-14 22:08       ` Andreas Gruenbacher
2019-01-11 16:05 ` [Cluster-devel] [PATCH 10/11] gfs2: Clean up assertion, consistency check, and error reporting functions Andreas Gruenbacher
2019-01-14 16:27   ` Bob Peterson
2019-01-11 16:05 ` [Cluster-devel] [PATCH 11/11] gfs2: Skip gfs2_metatype_check for cached buffers Andreas Gruenbacher
2019-01-14 16:40   ` Bob Peterson

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=20190111160548.9423-4-agruenba@redhat.com \
    --to=agruenba@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).