]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Provide a means for loaders to control which file system to use. This
authormarcel <marcel@FreeBSD.org>
Wed, 30 Jul 2014 16:08:16 +0000 (16:08 +0000)
committermarcel <marcel@FreeBSD.org>
Wed, 30 Jul 2014 16:08:16 +0000 (16:08 +0000)
commitd8a11be2f49dfce473c25414ca2679945573b969
tree6dcae4d7486b406338a3dd38cf5f6f7538f6efb2
parent149d25e0606a9dc893480869e217ec049cf3d5ea
Provide a means for loaders to control which file system to use. This
to counteract the default behaviour of always trying each and every
file system until one succeeds, or the open fails. The problem with the
loader is that we've implemented features based on this behavior. The
handling of compressed files is a good example of this. However, it is
in general highly undesirable to not have a one-time probe (or taste
in the geom lingo), followed by something similar to a mount whenever
we (first) read from a device. Everytime we go to the same device, we
can reasonably assume it (still) has the same file system. For file
systems that need to do far more that a trivial read of a super block,
not having something similar to a mount operation is disastrous from
a performance (and thus usability) perspective.

But, again, since we've implemented features based on this stateless
approach, things can get complicated quickly if and when we want to
change this. And yet, we sometimes do need stateful behaviour.

For this reason, this change simply introduces exclusive_file_system.
When set to the fsops of the file system to use, the open call will
only try this file system. Setting it to NULL restores the default
behaviour. It's a low-cost (low-brow?) approach to provide enough
control without re-implementing the guts of the loader.

A good example of when this is useful is when we're trying to load
files out of a container (say, a software packaga) that itself lives
on a file system or is fetched over the network. While opening the
container can be done in the normal stateless manner, once it is
opened, subsequent opens should only consider the container.

Obtained from: Juniper Networks, Inc.
lib/libstand/open.c
lib/libstand/stand.h