From: Vasily Averin <vvs@virtuozzo.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-fsdevel@vger.kernel.org, Maxim Patlasov <maximvp@gmail.com>,
Kirill Tkhai <ktkhai@virtuozzo.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fuse_writepages_fill: simplified "if-else if" constuction
Date: Tue, 14 Jul 2020 21:53:18 +0300 [thread overview]
Message-ID: <0bf36680-d659-9466-9634-92328d1be082@virtuozzo.com> (raw)
In-Reply-To: <CAJfpegv_7nvWoigY-eCX0ny+phWYOz3kEZvYsuGb=u65yMLGHg@mail.gmail.com>
On 7/14/20 3:24 PM, Miklos Szeredi wrote:
> On Thu, Jun 25, 2020 at 11:30 AM Vasily Averin <vvs@virtuozzo.com> wrote:
>>
>> fuse_writepages_fill uses following construction:
>> if (wpa && ap->num_pages &&
>> (A || B || C)) {
>> action;
>> } else if (wpa && D) {
>> if (E) {
>> the same action;
>> }
>> }
>>
>> - ap->num_pages check is always true and can be removed
>> - "if" and "else if" calls the same action and can be merged.
>
> Makes sense. Attached patch goes further and moves checking the
> conditions to a separate helper for clarity.
This looks perfect for me, thank you
Vasily Averin
next prev parent reply other threads:[~2020-07-14 18:53 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200615005036.GU12456@shao2-debian>
2020-06-15 5:59 ` [fuse] 6b2fb79963: WARNING:at_fs/fuse/file.c:#tree_insert[fuse] Vasily Averin
2020-06-16 12:35 ` Miklos Szeredi
2020-06-18 10:29 ` Kirill Tkhai
2020-06-25 7:48 ` Vasily Averin
2020-06-25 9:02 ` [PATCH] fuse_writepages_fill() optimization to avoid WARN_ON in tree_insert Vasily Averin
2020-06-27 10:31 ` Sedat Dilek
2020-06-29 21:11 ` Vivek Goyal
2020-07-11 4:01 ` Miklos Szeredi
2020-07-13 8:02 ` Vasily Averin
2020-07-13 16:14 ` Miklos Szeredi
2020-07-14 6:18 ` Vasily Averin
2020-07-14 12:40 ` Sedat Dilek
2020-07-14 12:52 ` Miklos Szeredi
2020-07-14 12:57 ` Sedat Dilek
2020-07-15 7:48 ` Sedat Dilek
2020-06-25 9:30 ` [PATCH] fuse_writepages_fill: simplified "if-else if" constuction Vasily Averin
2020-07-14 12:24 ` Miklos Szeredi
2020-07-14 18:53 ` Vasily Averin [this message]
2020-06-25 9:39 ` [PATCH] fuse_writepages ignores errors from fuse_writepages_fill Vasily Averin
2020-07-14 12:44 ` Miklos Szeredi
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=0bf36680-d659-9466-9634-92328d1be082@virtuozzo.com \
--to=vvs@virtuozzo.com \
--cc=ktkhai@virtuozzo.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maximvp@gmail.com \
--cc=miklos@szeredi.hu \
/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
all inboxes | Powered by JetHome®