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 07/11] gfs2: Minor gfs2_rgrp_send_discards cleanup
Date: Fri, 11 Jan 2019 17:05:44 +0100	[thread overview]
Message-ID: <20190111160548.9423-8-agruenba@redhat.com> (raw)
In-Reply-To: <20190111160548.9423-1-agruenba@redhat.com>

Pass the resource group and bitmap index to gfs2_rgrp_send_discards
separately: one of the next patches will remove bi_bh from struct
gfs2_bitmap, so we'll need to get it from the resource group in the
future.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
 fs/gfs2/lops.c |  3 ++-
 fs/gfs2/rgrp.c | 11 +++++------
 fs/gfs2/rgrp.h |  3 ++-
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c
index 94dcab655bc02..2db478768b229 100644
--- a/fs/gfs2/lops.c
+++ b/fs/gfs2/lops.c
@@ -81,7 +81,8 @@ static void maybe_release_space(struct gfs2_bufdata *bd)
 	if (bi->bi_clone == NULL)
 		return;
 	if (sdp->sd_args.ar_discard)
-		gfs2_rgrp_send_discards(sdp, rgd->rd_data0, bd->bd_bh, bi, 1, NULL);
+		gfs2_rgrp_send_discards(sdp, rgd->rd_data0, bd->bd_bh, rgd,
+					index, 1, NULL);
 	memcpy(bi->bi_clone + bi->bi_offset,
 	       bd->bd_bh->b_data + bi->bi_offset, bi->bi_bytes);
 	clear_bit(GBF_FULL, &bi->bi_flags);
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 7a93568fdc709..a86358afb33e7 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -1343,10 +1343,10 @@ void gfs2_rgrp_go_unlock(struct gfs2_holder *gh)
 }
 
 int gfs2_rgrp_send_discards(struct gfs2_sbd *sdp, u64 offset,
-			     struct buffer_head *bh,
-			     const struct gfs2_bitmap *bi, unsigned minlen,
-			     u64 *ptrimmed)
+			    struct buffer_head *bh, struct gfs2_rgrpd *rgd,
+			    unsigned int bii, unsigned minlen, u64 *ptrimmed)
 {
+	struct gfs2_bitmap *bi = rgd->rd_bits + bii;
 	struct super_block *sb = sdp->sd_vfs;
 	u64 blk;
 	sector_t start = 0;
@@ -1472,10 +1472,9 @@ int gfs2_fitrim(struct file *filp, void __user *argp)
 		if (!(rgd->rd_flags & GFS2_RGF_TRIMMED)) {
 			/* Trim each bitmap in the rgrp */
 			for (x = 0; x < rgd->rd_length; x++) {
-				struct gfs2_bitmap *bi = rgd->rd_bits + x;
 				ret = gfs2_rgrp_send_discards(sdp,
-						rgd->rd_data0, NULL, bi, minlen,
-						&amt);
+						rgd->rd_data0, NULL, rgd, x,
+						minlen, &amt);
 				if (ret) {
 					gfs2_glock_dq_uninit(&gh);
 					goto out;
diff --git a/fs/gfs2/rgrp.h b/fs/gfs2/rgrp.h
index 499079a9dbbed..4af09a548c358 100644
--- a/fs/gfs2/rgrp.h
+++ b/fs/gfs2/rgrp.h
@@ -75,7 +75,8 @@ extern u64 gfs2_ri_total(struct gfs2_sbd *sdp);
 extern void gfs2_rgrp_dump(struct seq_file *seq, struct gfs2_glock *gl);
 extern int gfs2_rgrp_send_discards(struct gfs2_sbd *sdp, u64 offset,
 				   struct buffer_head *bh,
-				   const struct gfs2_bitmap *bi, unsigned minlen, u64 *ptrimmed);
+				   struct gfs2_rgrpd *rgd, unsigned int bii,
+				   unsigned minlen, u64 *ptrimmed);
 extern int gfs2_fitrim(struct file *filp, void __user *argp);
 
 /* This is how to tell if a reservation is in the rgrp tree: */
-- 
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 ` [Cluster-devel] [PATCH 03/11] gfs2: Don't use struct gfs2_rbm in struct gfs2_extent Andreas Gruenbacher
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 ` Andreas Gruenbacher [this message]
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-8-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).