require '_h2ph_pre.ph';

no warnings qw(redefine misc);

require 'miscfs/genfs/layer.ph';
eval 'sub MAPFILEENTRIES () {64;}' unless defined(&MAPFILEENTRIES);
eval 'sub GMAPFILEENTRIES () {16;}' unless defined(&GMAPFILEENTRIES);
eval 'sub NOBODY () {32767;}' unless defined(&NOBODY);
eval 'sub NULLGROUP () {65534;}' unless defined(&NULLGROUP);
eval 'sub umap_target () { ($la->{target});}' unless defined(&umap_target);
eval 'sub umap_export () { ($la->{export});}' unless defined(&umap_export);
if(defined(&_KERNEL)) {
    eval 'sub umapm_rootvp () { ($lm->{layerm_rootvp});}' unless defined(&umapm_rootvp);
    eval 'sub umapm_export () { ($lm->{layerm_export});}' unless defined(&umapm_export);
    eval 'sub umapm_flags () { ($lm->{layerm_flags});}' unless defined(&umapm_flags);
    eval 'sub umapm_size () { ($lm->{layerm_size});}' unless defined(&umapm_size);
    eval 'sub umapm_tag () { ($lm->{layerm_tag});}' unless defined(&umapm_tag);
    eval 'sub umapm_bypass () { ($lm->{layerm_bypass});}' unless defined(&umapm_bypass);
    eval 'sub umapm_alloc () { ($lm->{layerm_alloc});}' unless defined(&umapm_alloc);
    eval 'sub umapm_vnodeop_p () { ($lm->{layerm_vnodeop_p});}' unless defined(&umapm_vnodeop_p);
    eval 'sub umapm_node_hashtbl () { ($lm->{layerm_node_hashtbl});}' unless defined(&umapm_node_hashtbl);
    eval 'sub umapm_node_hash () { ($lm->{layerm_node_hash});}' unless defined(&umapm_node_hash);
    eval 'sub umapm_hashlock () { ($lm->{layerm_hashlock});}' unless defined(&umapm_hashlock);
    eval 'sub umap_hash () { ($ln->{layer_hash});}' unless defined(&umap_hash);
    eval 'sub umap_lowervp () { ($ln->{layer_lowervp});}' unless defined(&umap_lowervp);
    eval 'sub umap_vnode () { ($ln->{layer_vnode});}' unless defined(&umap_vnode);
    eval 'sub umap_flags () { ($ln->{layer_flags});}' unless defined(&umap_flags);
    eval 'sub MOUNTTOUMAPMOUNT {
        my($mp) = @_;
	    eval q(((($mp)-> &mnt_data)));
    }' unless defined(&MOUNTTOUMAPMOUNT);
    eval 'sub VTOUMAP {
        my($vp) = @_;
	    eval q((($vp)-> &v_data));
    }' unless defined(&VTOUMAP);
    eval 'sub UMAPTOV {
        my($xp) = @_;
	    eval q((($xp)-> &umap_vnode));
    }' unless defined(&UMAPTOV);
    if(defined(&UMAPFS_DIAGNOSTIC)) {
	eval 'sub UMAPVPTOLOWERVP {
	    my($vp) = @_;
    	    eval q( &layer_checkvp(($vp),  &__FILE__,  &__LINE__));
	}' unless defined(&UMAPVPTOLOWERVP);
    } else {
	eval 'sub UMAPVPTOLOWERVP {
	    my($vp) = @_;
    	    eval q(( &VTOUMAP($vp)-> &umap_lowervp));
	}' unless defined(&UMAPVPTOLOWERVP);
    }
    eval 'sub NUMAPNODECACHE () {16;}' unless defined(&NUMAPNODECACHE);
}
1;
