cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Abhijith Das <adas@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [GFS2 PATCH] GFS2: Simplify iterative add loop in foreach_descriptor
Date: Wed, 8 Aug 2018 17:59:29 -0400 (EDT)	[thread overview]
Message-ID: <136577368.55746140.1533765569892.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <183182471.770089.1533754323408.JavaMail.zimbra@redhat.com>


----- Original Message -----
> From: "Bob Peterson" <rpeterso@redhat.com>
> To: "cluster-devel" <cluster-devel@redhat.com>
> Sent: Wednesday, August 8, 2018 1:52:03 PM
> Subject: [Cluster-devel] [GFS2 PATCH] GFS2: Simplify iterative add loop in foreach_descriptor
> 
> Hi,
> 
> Before this patch, function foreach_descriptor repeatedly called
> function gfs2_replay_incr_blk which just incremented the value while
> decrementing another, and checked for wrap. This is a waste of time.
> This patch just adds the value and adjusts it if a wrap occurred.
> 
> Signed-off-by: Bob Peterson <rpeterso@redhat.com>

Hi,

Looks good. ACK.

Cheers!
--Abhi

Reviewed-by: Abhi Das <adas@redhat.com>

> ---
>  fs/gfs2/recovery.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/gfs2/recovery.c b/fs/gfs2/recovery.c
> index 0f501f938d1c..6c6b19263b82 100644
> --- a/fs/gfs2/recovery.c
> +++ b/fs/gfs2/recovery.c
> @@ -354,8 +354,9 @@ static int foreach_descriptor(struct gfs2_jdesc *jd,
> unsigned int start,
>  			return error;
>  		}
>  
> -		while (length--)
> -			gfs2_replay_incr_blk(jd, &start);
> +		start += length;
> +		if (start >= jd->jd_blocks)
> +			start -= jd->jd_blocks;
>  
>  		brelse(bh);
>  	}
> 
> 



  parent reply	other threads:[~2018-08-08 21:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <17883672.769837.1533754253446.JavaMail.zimbra@redhat.com>
2018-08-08 18:52 ` [Cluster-devel] [GFS2 PATCH] GFS2: Simplify iterative add loop in foreach_descriptor Bob Peterson
2018-08-08 19:21   ` Andreas Gruenbacher
2018-08-08 21:59   ` Abhijith Das [this message]
2018-08-09  9:35   ` Steven Whitehouse
2018-08-09 12:15     ` Bob Peterson
2018-08-10 12:13     ` Andreas Gruenbacher
2018-08-10 12:21       ` Steven Whitehouse
2018-08-10 14:26         ` Abhijith Das

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=136577368.55746140.1533765569892.JavaMail.zimbra@redhat.com \
    --to=adas@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).