fuse: clean up condition for writepage sending
authorMiklos Szeredi <mszeredi@redhat.com>
Tue, 14 Jul 2020 12:45:41 +0000 (14:45 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Tue, 14 Jul 2020 12:45:41 +0000 (14:45 +0200)
commit6ddf3af93e32b996cfc30477ea1509960d4ba669
tree8583e700803dfb749470fd99c0286674e6660bf0
parentb330966f79fb4fdc49183f58db113303695a750f
fuse: clean up condition for writepage sending

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.

Move checking A, B, C, D, E conditions to a helper, add comments.

Original-patch-by: Vasily Averin <vvs@virtuozzo.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/file.c