Rename the minext parameters which represent extent lengths to minlen to
avoid confusion with maxext, which are actual extents.

Signed-off-by: Andreas Gruenbacher <agrue...@redhat.com>
---
 fs/gfs2/rgrp.c | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index cb87560c7bcbc..cfef8cc5fa155 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -73,7 +73,7 @@ static const char valid_change[16] = {
                1, 0, 0, 0
 };
 
-static int gfs2_rbm_find(struct gfs2_rbm *rbm, u8 state, u32 *minext,
+static int gfs2_rbm_find(struct gfs2_rbm *rbm, u8 state, u32 *minlen,
                         const struct gfs2_inode *ip, bool nowrap);
 
 
@@ -1318,7 +1318,8 @@ 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)
+                            const struct gfs2_bitmap *bi, unsigned minlen,
+                            u64 *ptrimmed)
 {
        struct super_block *sb = sdp->sd_vfs;
        u64 blk;
@@ -1653,7 +1654,7 @@ static u64 gfs2_next_unreserved_block(struct gfs2_rgrpd 
*rgd, u64 block,
  * gfs2_reservation_check_and_update - Check for reservations during block 
alloc
  * @rbm: The current position in the resource group
  * @ip: The inode for which we are searching for blocks
- * @minext: The minimum extent length
+ * @minlen: The minimum extent length
  * @maxext: A pointer to the maximum extent structure
  *
  * This checks the current position in the rgrp to see whether there is
@@ -1667,7 +1668,7 @@ static u64 gfs2_next_unreserved_block(struct gfs2_rgrpd 
*rgd, u64 block,
 
 static int gfs2_reservation_check_and_update(struct gfs2_rbm *rbm,
                                             const struct gfs2_inode *ip,
-                                            u32 minext,
+                                            u32 minlen,
                                             struct gfs2_extent *maxext)
 {
        u64 block = gfs2_rbm_to_block(rbm);
@@ -1679,8 +1680,8 @@ static int gfs2_reservation_check_and_update(struct 
gfs2_rbm *rbm,
         * If we have a minimum extent length, then skip over any extent
         * which is less than the min extent length in size.
         */
-       if (minext) {
-               extlen = gfs2_free_extlen(rbm, minext);
+       if (minlen) {
+               extlen = gfs2_free_extlen(rbm, minlen);
                if (extlen <= maxext->len)
                        goto fail;
        }
@@ -1691,7 +1692,7 @@ static int gfs2_reservation_check_and_update(struct 
gfs2_rbm *rbm,
         */
        nblock = gfs2_next_unreserved_block(rbm->rgd, block, extlen, ip);
        if (nblock == block) {
-               if (!minext || extlen >= minext)
+               if (!minlen || extlen >= minlen)
                        return 0;
 
                if (extlen > maxext->len) {
@@ -1711,7 +1712,7 @@ static int gfs2_reservation_check_and_update(struct 
gfs2_rbm *rbm,
  * gfs2_rbm_find - Look for blocks of a particular state
  * @rbm: Value/result starting position and final position
  * @state: The state which we want to find
- * @minext: Pointer to the requested extent length (NULL for a single block)
+ * @minlen: Pointer to the requested extent length (NULL for a single block)
  *          This is updated to be the actual reservation size.
  * @ip: If set, check for reservations
  * @nowrap: Stop looking at the end of the rgrp, rather than wrapping
@@ -1726,7 +1727,7 @@ static int gfs2_reservation_check_and_update(struct 
gfs2_rbm *rbm,
  * Returns: 0 on success, -ENOSPC if there is no block of the requested state
  */
 
-static int gfs2_rbm_find(struct gfs2_rbm *rbm, u8 state, u32 *minext,
+static int gfs2_rbm_find(struct gfs2_rbm *rbm, u8 state, u32 *minlen,
                         const struct gfs2_inode *ip, bool nowrap)
 {
        struct buffer_head *bh;
@@ -1772,7 +1773,7 @@ static int gfs2_rbm_find(struct gfs2_rbm *rbm, u8 state, 
u32 *minext,
 
                initial_bii = rbm->bii;
                ret = gfs2_reservation_check_and_update(rbm, ip,
-                                                       minext ? *minext : 0,
+                                                       minlen ? *minlen : 0,
                                                        &maxext);
                if (ret == 0)
                        return 0;
@@ -1802,21 +1803,21 @@ static int gfs2_rbm_find(struct gfs2_rbm *rbm, u8 
state, u32 *minext,
                        break;
        }
 
-       if (minext == NULL || state != GFS2_BLKST_FREE)
+       if (minlen == NULL || state != GFS2_BLKST_FREE)
                return -ENOSPC;
 
        /* If the extent was too small, and it's smaller than the smallest
           to have failed before, remember for future reference that it's
           useless to search this rgrp again for this amount or more. */
        if ((first_offset == 0) && (first_bii == 0) &&
-           (*minext < rbm->rgd->rd_extfail_pt))
-               rbm->rgd->rd_extfail_pt = *minext;
+           (*minlen < rbm->rgd->rd_extfail_pt))
+               rbm->rgd->rd_extfail_pt = *minlen;
 
        /* If the maximum extent we found is big enough to fulfill the
           minimum requirements, use it anyway. */
        if (maxext.len) {
                *rbm = maxext.rbm;
-               *minext = maxext.len;
+               *minlen = maxext.len;
                return 0;
        }
 
-- 
2.20.1

Reply via email to