icon Top 9 categories map      RocketAware > man pages >

mount_null(8)

Tips: Browse or Search all pages for efficient awareness of more than 6000 of the most popular reusable and open source applications, functions, libraries, and FAQs.


The "RKT couplings" below include links to source code, updates, additional information, advice, FAQs, and overviews.


Home

Search all pages


Subjects

By activity
Professions, Sciences, Humanities, Business, ...

User Interface
Text-based, GUI, Audio, Video, Keyboards, Mouse, Images,...

Text Strings
Conversions, tests, processing, manipulation,...

Math
Integer, Floating point, Matrix, Statistics, Boolean, ...

Processing
Algorithms, Memory, Process control, Debugging, ...

Stored Data
Data storage, Integrity, Encryption, Compression, ...

Communications
Networks, protocols, Interprocess, Remote, Client Server, ...

Hard World
Timing, Calendar and Clock, Audio, Video, Printer, Controls...

File System
Management, Filtering, File & Directory access, Viewers, ...

    

RocketLink!--> Man page versions: OpenBSD FreeBSD NetBSD Others



MOUNT_NULL(8)           OpenBSD System Manager's Manual          MOUNT_NULL(8)

NAME
     mount_null - demonstrate the use of a null file system layer



SYNOPSIS
     mount_null [-o options] target mount-point

DESCRIPTION
     The mount_null command creates a null layer, duplicating a sub-tree of
     the file system name space under another part of the global file system
     namespace.  It is implemented using a stackable layers technique, and its
     ``null-nodes'' stack above all lower-layer vnodes (not just above direc-
     tory vnodes).

     The options are as follows:

     -o      Options are specified with a -o flag followed by a comma separat-
             ed string of options.  See the mount(8) man page for possible op-
             tions and their meanings.

     The null layer has two purposes.  First, it serves as a demonstration of
     layering by proving a layer which does nothing.  Second, the null layer
     can serve as a prototype layer.  Since it provides all necessary layer
     framework, new file system layers can be created very easily be starting
     with a null layer.

     The remainder of this man page examines the null layer as a basis for
     constructing new layers.

INSTANTIATING NEW NULL LAYERS
     New null layers are created with mount_null(8).  Mount_null(8) takes two
     arguments, the pathname of the lower vfs (target-pn) and the pathname
     where the null layer will appear in the namespace (mount-point-pn).  Af-
     ter the null layer is put into place, the contents of target-pn subtree
     will be aliased under mount-point-pn.

OPERATION OF A NULL LAYER
     The null layer is the minimum file system layer, simply bypassing all
     possible operations to the lower layer for processing there.  The majori-
     ty of its activity centers on the bypass routine, though which nearly all
     vnode operations pass.

     The bypass routine accepts arbitrary vnode operations for handling by the
     lower layer.  It begins by examing vnode operation arguments and replac-
     ing any null-nodes by their lower-layer equivalents.  It then invokes the
     operation on the lower layer.  Finally, it replaces the null-nodes in the
     arguments and, if a vnode is returned by the operation, stacks a null-
     node on top of the returned vnode.

     Although bypass handles most operations, vop_getattr, vop_inactive,
     vop_reclaim, and vop_print are not bypassed.  Vop_getattr must change the
     fsid being returned.  Vop_inactive and vop_reclaim are not bypassed so
     that they can handle freeing null-layer specific data.  Vop_print is not
     bypassed to avoid excessive debugging information.

INSTANTIATING VNODE STACKS
     Mounting associates the null layer with a lower layer, in effect stacking
     two VFSes.  Vnode stacks are instead created on demand as files are ac-
     cessed.

     The initial mount creates a single vnode stack for the root of the new
     null layer.  All other vnode stacks are created as a result of vnode op-
     erations on this or other null vnode stacks.


     New vnode stacks come into existence as a result of an operation which
     returns a vnode.  The bypass routine stacks a null-node above the new vn-
     ode before returning it to the caller.

     For example, imagine mounting a null layer with

           mount_null /usr/include /dev/layer/null
     Changing directory to /dev/layer/null will assign the root null-node
     (which was created when the null layer was mounted).  Now consider open-
     ing sys. A vop_lookup would be done on the root null-node.  This opera-
     tion would bypass through to the lower layer which would return a vnode
     representing the UFS sys. Null_bypass then builds a null-node aliasing
     the UFS sys and returns this to the caller.  Later operations on the
     null-node sys will repeat this process when constructing other vnode
     stacks.

CREATING OTHER FILE SYSTEM LAYERS
     One of the easiest ways to construct new file system layers is to make a
     copy of the null layer, rename all files and variables, and then begin
     modifyng the copy.  Sed can be used to easily rename all variables.

     The umap layer is an example of a layer descended from the null layer.

INVOKING OPERATIONS ON LOWER LAYERS
     There are two techniques to invoke operations on a lower layer when the
     operation cannot be completely bypassed.  Each method is appropriate in
     different situations.  In both cases, it is the responsibility of the
     aliasing layer to make the operation arguments "correct" for the lower
     layer by mapping an vnode arguments to the lower layer.

     The first approach is to call the aliasing layer's bypass routine.  This
     method is most suitable when you wish to invoke the operation currently
     being handled on the lower layer.  It has the advantage the bypass rou-
     tine already must do argument mapping.  An example of this is
     null_getattrs in the null layer.

     A second approach is to directly invoked vnode operations on the lower
     layer with the VOP_OPERATIONNAME interface.  The advantage of this method
     is that it is easy to invoke arbitrary operations on the lower layer.
     The disadvantage is that vnodes arguments must be manually mapped.

SEE ALSO
     mount(8)

     UCLA Technical Report CSD-910056, Stackable Layers: an Architecture for
     File System Development.

HISTORY
     The mount_null utility first appeared in 4.4BSD.

4.4BSD                          April 19, 1994                               2

Source: OpenBSD 2.6 man pages. Copyright: Portions are copyrighted by BERKELEY
SOFTWARE DESIGN, INC., The Regents of the University of California, Massachusetts
Institute of Technology, Free Software Foundation, FreeBSD Inc., and others.



(Corrections, notes, and links courtesy of RocketAware.com)


[Detailed Topics]
FreeBSD Sources for mount_null(8)
OpenBSD sources for mount_null(8)


[Overview Topics]

Up to: Specific Types of File Systems - Specific forms of file systems. DFS, NFS, MS-DOS, etc.
Up to: File System Operations - Operations for entire file-systems (quotas, configuration, consistency, mount, unmount, et al)


RocketLink!--> Man page versions: OpenBSD FreeBSD NetBSD Others






Rapid-Links: Search | About | Comments | Submit Path: RocketAware > man pages > mount_null.8/
RocketAware.com is a service of Mib Software
Copyright 1999, Forrest J. Cavalier III. All Rights Reserved.
We welcome submissions and comments