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>