linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Freemyer <greg.freemyer@gmail.com>
To: andre@bsrsoft.com.br
Cc: Andreas Dilger <adilger.kernel@dilger.ca>,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] fs: Small refactoring of the code in ext4 2.6.37-rc1
Date: Thu, 4 Nov 2010 18:44:26 -0400	[thread overview]
Message-ID: <AANLkTikkAL-ZzxLfa+POoyv4qCE0LUq1h+nfE2_Bn7Ji@mail.gmail.com> (raw)
In-Reply-To: <250707.83204.qm@web110504.mail.gq1.yahoo.com>

2010/11/4 André Luis Pereira dos Santos - BSRSoft <andre@bsrsoft.com.br>:
> From: Andre Luis Pereira dos Santos <andre@bsrsoft.com.br>
>
> Hi.
> Small refactoring of the code in order to make minor enhancements to critical areas.
> The notation x + 1 has been replaced by more efficient notation x + +.
>
> Signed-off-by: Andre Luis Pereira dos Santos <andre@bsrsoft.com.br>
> ---
> Signed-off-by: Andre Luis Pereira dos Santos <andre@bsrsoft.com.br>
> --- linux-2.6.37-rc1/fs/ext4/extents.c  2010-11-01 09:54:12.000000000 -0200
> +++ linux-2.6.37-rc1-patched/fs/ext4/extents.c  2010-11-04 19:54:26.000000000 -0200
> @@ -555,9 +555,9 @@ ext4_ext_binsearch(struct inode *inode,
>        while (l <= r) {
>                m = l + (r - l) / 2;
>                if (block < le32_to_cpu(m->ee_block))
> -                       r = m - 1;
> +                       r = m--;
>                else
> -                       l = m + 1;
> +                       l = m++;
>                ext_debug("%p(%u):%p(%u):%p(%u) ", l, le32_to_cpu(l->ee_block),
>                                m, le32_to_cpu(m->ee_block),
>                                r, le32_to_cpu(r->ee_block));
> @@ -1557,7 +1557,7 @@ static int ext4_ext_try_to_merge(struct
>                if (ext4_ext_is_uninitialized(ex))
>                        uninitialized = 1;
>                ex->ee_len = cpu_to_le16(ext4_ext_get_actual_len(ex)
> -                               + ext4_ext_get_actual_len(ex + 1));
> +                               + ext4_ext_get_actual_len(ex++));
>                if (uninitialized)
>                        ext4_ext_mark_uninitialized(ex);

But

                   r = m - 1;
is not equivalent to
                   r = m--;

At a minimum your code no longer passes the same value to of m to ext_debug.

NAK

Greg
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2010-11-04 22:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-04 22:07 [PATCH 1/1] fs: Small refactoring of the code in ext4 2.6.37-rc1 André Luis Pereira dos Santos - BSRSoft
2010-11-04 22:31 ` Jesper Juhl
2010-11-04 22:44 ` Greg Freemyer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-11-04 23:34 André Luis Pereira dos Santos - BSRSoft
2010-11-05 12:52 ` Ted Ts'o

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=AANLkTikkAL-ZzxLfa+POoyv4qCE0LUq1h+nfE2_Bn7Ji@mail.gmail.com \
    --to=greg.freemyer@gmail.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=andre@bsrsoft.com.br \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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).