Before NetBSD 1.5, most NetBSD layered file systems other than UNIONFS were based on copies of NULLFS. Typically the NULLFS files were copied and renamed, the routine names were changed (the ``null_'' prefix changed to reflect the new file system name), and then new features were added. This behavior represents a duplication of code. In order to reduce this duplication, there is now a library of common files, ``layerfs,'' which provide most of the NULL layer functionality. For instance the NULL layer now consists of a mount routine and vnode interface structures. The rest of the routines are in the layerfs library. The UMAP layer now shares most all of these routines, with the only difference being that it has some customized routines (bypass, lookup, and a few others) which perform its credential mapping. DMFS also uses this library of routines. Of the 19 vnode operations handled by DMFS, 20% consist solely of calls into this library.