require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_MISCFS_GENFS_LAYER_H_)) {
    eval 'sub _MISCFS_GENFS_LAYER_H_ () {1;}' unless defined(&_MISCFS_GENFS_LAYER_H_);
    if(defined(&_KERNEL)) {
	eval 'sub LAYERFS_MFLAGS () {0xfff;}' unless defined(&LAYERFS_MFLAGS);
	eval 'sub LAYERFS_MBYPASSDEBUG () {0x1;}' unless defined(&LAYERFS_MBYPASSDEBUG);
	eval 'sub LAYERFS_RESFLAGS () {0xfff;}' unless defined(&LAYERFS_RESFLAGS);
	eval 'sub LAYERFS_REMOVED () {0x1;}' unless defined(&LAYERFS_REMOVED);
	eval 'sub LAYERFS_DO_BYPASS {
	    my($vp, $ap) = @_;
    	    eval q((* &MOUNTTOLAYERMOUNT(($vp)-> &v_mount)-> &layerm_bypass)(($ap)));
	}' unless defined(&LAYERFS_DO_BYPASS);
	eval 'sub MOUNTTOLAYERMOUNT {
	    my($mp) = @_;
    	    eval q(((($mp)-> &mnt_data)));
	}' unless defined(&MOUNTTOLAYERMOUNT);
	eval 'sub VTOLAYER {
	    my($vp) = @_;
    	    eval q((($vp)-> &v_data));
	}' unless defined(&VTOLAYER);
	eval 'sub LAYERTOV {
	    my($xp) = @_;
    	    eval q((($xp)-> &layer_vnode));
	}' unless defined(&LAYERTOV);
	if(defined(&LAYERFS_DIAGNOSTIC)) {
	    eval 'sub LAYERVPTOLOWERVP {
	        my($vp) = @_;
    		eval q( &layer_checkvp(($vp),  &__FILE__,  &__LINE__));
	    }' unless defined(&LAYERVPTOLOWERVP);
	} else {
	    eval 'sub LAYERVPTOLOWERVP {
	        my($vp) = @_;
    		eval q(( &VTOLAYER($vp)-> &layer_lowervp));
	    }' unless defined(&LAYERVPTOLOWERVP);
	}
    }
}
1;
