require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_NFS_NFSNODE_H_)) {
    eval 'sub _NFS_NFSNODE_H_ () {1;}' unless defined(&_NFS_NFSNODE_H_);
    require 'sys/condvar.ph';
    require 'sys/mutex.ph';
    unless(defined(&_NFS_NFS_H_)) {
	require 'nfs/nfs.ph';
    }
    require 'miscfs/genfs/genfs.ph';
    require 'miscfs/genfs/genfs_node.ph';
    eval 'sub NFSDC_INVALID () {1;}' unless defined(&NFSDC_INVALID);
    eval 'sub NFSDC_BLKNO {
        my($ndp) = @_;
	    eval q((( &daddr_t)($ndp)-> &dc_blkcookie));
    }' unless defined(&NFSDC_BLKNO);
    eval 'sub n_mtim () { ($n_un1->{nu_spec}->{nspec_mtim});}' unless defined(&n_mtim);
    eval 'sub n_atim () { ($n_un1->{nu_spec}->{nspec_atim});}' unless defined(&n_atim);
    eval 'sub n_pushedlo () { ($n_un1->{nu_reg}->{nreg_pushedlo});}' unless defined(&n_pushedlo);
    eval 'sub n_pushedhi () { ($n_un1->{nu_reg}->{nreg_pushedhi});}' unless defined(&n_pushedhi);
    eval 'sub n_pushlo () { ($n_un1->{nu_reg}->{nreg_pushlo});}' unless defined(&n_pushlo);
    eval 'sub n_pushhi () { ($n_un1->{nu_reg}->{nreg_pushhi});}' unless defined(&n_pushhi);
    eval 'sub n_commitlock () { ($n_un1->{nu_reg}->{nreg_commitlock});}' unless defined(&n_commitlock);
    eval 'sub n_commitflags () { ($n_un1->{nu_reg}->{nreg_commitflags});}' unless defined(&n_commitflags);
    eval 'sub n_error () { ($n_un1->{nu_reg}->{nreg_error});}' unless defined(&n_error);
    eval 'sub n_direofoffset () { ($n_un1->{nu_dir}->{ndir_direof});}' unless defined(&n_direofoffset);
    eval 'sub n_cookieverf () { ($n_un1->{nu_dir}->{ndir_cookieverf});}' unless defined(&n_cookieverf);
    eval 'sub n_dircache () { ($n_un1->{nu_dir}->{ndir_dircache});}' unless defined(&n_dircache);
    eval 'sub n_dirchain () { ($n_un1->{nu_dir}->{ndir_dirchain});}' unless defined(&n_dirchain);
    eval 'sub n_nctime () { ($n_un1->{nu_dir}->{ndir_nctime});}' unless defined(&n_nctime);
    eval 'sub n_dircachesize () { ($n_un1->{nu_dir}->{ndir_dircachesize});}' unless defined(&n_dircachesize);
    eval 'sub n_sillyrename () { ($n_un2->{nf_silly});}' unless defined(&n_sillyrename);
    eval 'sub n_dirgens () { ($n_un2->{ndir_dirgens});}' unless defined(&n_dirgens);
    eval 'sub NFS_COMMIT_PUSH_VALID () {0x1;}' unless defined(&NFS_COMMIT_PUSH_VALID);
    eval 'sub NFS_COMMIT_PUSHED_VALID () {0x2;}' unless defined(&NFS_COMMIT_PUSHED_VALID);
    eval 'sub NFLUSHWANT () {0x1;}' unless defined(&NFLUSHWANT);
    eval 'sub NFLUSHINPROG () {0x2;}' unless defined(&NFLUSHINPROG);
    eval 'sub NMODIFIED () {0x4;}' unless defined(&NMODIFIED);
    eval 'sub NWRITEERR () {0x8;}' unless defined(&NWRITEERR);
    eval 'sub NACC () {0x100;}' unless defined(&NACC);
    eval 'sub NUPD () {0x200;}' unless defined(&NUPD);
    eval 'sub NCHG () {0x400;}' unless defined(&NCHG);
    eval 'sub NTRUNCDELAYED () {0x1000;}' unless defined(&NTRUNCDELAYED);
    eval 'sub NREMOVED () {0x2000;}' unless defined(&NREMOVED);
    eval 'sub NUSEOPENCRED () {0x4000;}' unless defined(&NUSEOPENCRED);
    eval 'sub NEOFVALID () {0x8000;}' unless defined(&NEOFVALID);
    eval 'sub NFS_EOFVALID {
        my($ndp) = @_;
	    eval q((($ndp)-> &n_flag &  &NEOFVALID));
    }' unless defined(&NFS_EOFVALID);
    eval 'sub VTONFS {
        my($vp) = @_;
	    eval q((($vp)-> &v_data));
    }' unless defined(&VTONFS);
    eval 'sub NFSTOV {
        my($np) = @_;
	    eval q((($np)-> &n_vnode));
    }' unless defined(&NFSTOV);
    if(defined(&_KERNEL)) {
	require 'sys/workqueue.ph';
	eval 'sub NFS_INVALIDATE_ATTRCACHE {
	    my($np) = @_;
    	    eval q(($np)-> &n_attrstamp = 0);
	}' unless defined(&NFS_INVALIDATE_ATTRCACHE);
    }
}
1;
