Add atomic_and() and atomic_or() functions

Signed-off-by: Alex Smith <alex@alex-smith.me.uk>
Minor code style cleanups

Signed-off-by: Alex Smith <alex@alex-smith.me.uk>
Rewrite of the FS layer

Rewritten and cleaned up the filesystem layer. This only changes the
internal implementation, the public FS API is (almost) entirely unchanged.

Previously, the FS layer itself only had knowledge of nodes, and completely
relied on filesystem implementations to provide directory hierarchy
information (and cache that information). Now, the directory hierarchy is
managed by the core FS layer and cached there.

There are several benefits to this. Path lookup is simplified and requires
fewer calls out to the filesystem implementation. It is now much easier to
calculate a path string to a filesystem entry: this can be done by simply
iterating back through the directory entry tree. File handles store the
directory entry they were opened with as well as the node meaning we can
easily get the path to an open file. Previously, this was only possible on
directories and required working back through the .. entries in each
directory and then finding the name of the child entries within them.
Finally, having a centrally managed directory cache rather than separate
caches spread throughout each filesystem means that it will be easier in
future to free up unused entries when the system is under memory pressure.

A few things aren't implemented yet: kern_fs_unmount(), kern_fs_unlink(),
kern_fs_link(), kern_fs_rename() and kern_fs_path(). The latter 3 were
not implemented prior to the rewrite, but will be added soon.

Signed-off-by: Alex Smith <alex@alex-smith.me.uk>
Remove old entry cache code

This was used prior to the FS rewrite for directory caching by filesystem
implementations and is no longer needed, as this is now done in the FS
layer.

Signed-off-by: Alex Smith <alex@alex-smith.me.uk>
Add kern_fs_curr_dir() wrapper around kern_fs_path() to libkernel

The former was previously implemented by the kernel, its functionality
can now be implemented using kern_fs_path(). It is convenient to still
have this function, but there is no need for it to be a system call so
implement it as a wrapper function in libkernel.

Signed-off-by: Alex Smith <alex@alex-smith.me.uk>