Ryan Houdek e2db607769 FM: Removes double syscall issue with GetEmulatedFDPath
In the case that the symlink following would immediately fail (Due to
the first query not existing or not being a symlink), then FEX would
immediately return the first query. Then the resulting syscall using
this result would try to run the syscall on that file, immediately
error, and try again on the file outside of the rootfs. This gives us
three syscalls for the price of one.

This adds an additional syscall cost to every syscall that that takes
the `FollowSymlink` code path, which is quite a few.

Instead now, check to see if the filepath exists at all, and if the
filepath doesn't even exist for the first fstatat, return a `NoEntry`
immediately. This will cause the resulting syscall waiting for the
result to skip the EmulatedFDPath check and run regular syscall.

If the filepath is symlink it will still loop to track through the
entire symlink tree to find the one that is in the rootfs.

If the filepath is just a file, then the `IsLink` step will fail,
returning the filepath to the file inside of the rootfs. (Getting this
step wrong will make wine/proton immediately break).

With this resolved, this converts a lot of three syscall operations down
to two.
2023-04-26 02:13:29 -07:00
..
2023-03-16 03:21:45 -07:00
2023-03-16 03:21:45 -07:00
2023-03-30 16:28:33 -07:00