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 <agrue...@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

Reply via email to