LINUX: Rearrange afs_linux_lookup cleanup
commit5dd2ce2043f53e80e1ded25abcfd565b4071a3ad
authorAndrew Deason <adeason@sinenomine.net>
Thu, 15 Jun 2017 20:29:48 +0000 (15 15:29 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Wed, 5 Jul 2017 15:59:08 +0000 (5 11:59 -0400)
tree47ef99b8f0d5fcb3bfcc4af2ad6f414372b83059
parentd0b64a4a1b61b5e22f0e3fe509f8facd30bc2b74
LINUX: Rearrange afs_linux_lookup cleanup

Currently, the cleanup and error handling in afs_linux_lookup is
structured similar to this pseudocode:

    if (!code) {
        if (!IS_ERR(newdp)) {
            return no_error;
        } else {
            return newdp_error;
        }
    } else {
        return code_error;
    }

The multiple different nested error cases make this a little complex.
To make this easier to follow for subsequent changes, alter this
structure to be more like this:

    if (IS_ERR(newdp)) {
        return newdp_error;
    }

    if (code) {
        return code_error;
    }

    return no_error;

There should be no functional change in this commit; it is just code
reorganization.

Technically the ordering of these checks is changed, but there is no
combination of conditions that actually results in different code
being hit. That is, if 'code' is nonzero and IS_ERR(newdp) is true,
then we would go through a different path. But that cannot happen,
since if 'code' is nonzero, we have no inode and so IS_ERR(newdp)
cannot be true (d_splice_alias cannot return an error for a NULL
inode). So there is no functional change.

Change-Id: I94a3aef5239358c3d13fe5314044dcc85914d0a4
Reviewed-on: https://gerrit.openafs.org/12636
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Joe Gorse <jhgorse@gmail.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
src/afs/LINUX/osi_vnodeops.c