require '_h2ph_pre.ph';

unless(defined(&__LINUX_UFS_FS_H)) {
    eval 'sub __LINUX_UFS_FS_H () {1;}' unless defined(&__LINUX_UFS_FS_H);
    require 'linux/types.ph';
    require 'linux/kernel.ph';
    require 'linux/time.ph';
    require 'linux/stat.ph';
    eval 'sub UFS_BBLOCK () {0;}' unless defined(&UFS_BBLOCK);
    eval 'sub UFS_BBSIZE () {8192;}' unless defined(&UFS_BBSIZE);
    eval 'sub UFS_SBLOCK () {8192;}' unless defined(&UFS_SBLOCK);
    eval 'sub UFS_SBSIZE () {8192;}' unless defined(&UFS_SBSIZE);
    eval 'sub UFS_SECTOR_SIZE () {512;}' unless defined(&UFS_SECTOR_SIZE);
    eval 'sub UFS_SECTOR_BITS () {9;}' unless defined(&UFS_SECTOR_BITS);
    eval 'sub UFS_MAGIC () {0x11954;}' unless defined(&UFS_MAGIC);
    eval 'sub UFS_CIGAM () {0x54190100;}' unless defined(&UFS_CIGAM);
    eval 'sub UFS_MAGIC_LFN () {0x95014;}' unless defined(&UFS_MAGIC_LFN);
    eval 'sub UFS_CIGAM_LFN () {0x14500900;}' unless defined(&UFS_CIGAM_LFN);
    eval 'sub UFS_MAGIC_SEC () {0x612195;}' unless defined(&UFS_MAGIC_SEC);
    eval 'sub UFS_CIGAM_SEC () {0x95216100;}' unless defined(&UFS_CIGAM_SEC);
    eval 'sub UFS_MAGIC_FEA () {0x195612;}' unless defined(&UFS_MAGIC_FEA);
    eval 'sub UFS_CIGAM_FEA () {0x12561900;}' unless defined(&UFS_CIGAM_FEA);
    eval 'sub UFS_MAGIC_4GB () {0x5231994;}' unless defined(&UFS_MAGIC_4GB);
    eval 'sub UFS_CIGAM_4GB () {0x94192305;}' unless defined(&UFS_CIGAM_4GB);
    eval 'sub UFS_FSF_LFN () {0x1;}' unless defined(&UFS_FSF_LFN);
    eval 'sub UFS_FSF_B1 () {0x2;}' unless defined(&UFS_FSF_B1);
    eval 'sub UFS_FSF_LFS () {0x2;}' unless defined(&UFS_FSF_LFS);
    eval 'sub UFS_FSF_LUID () {0x4;}' unless defined(&UFS_FSF_LUID);
    eval 'sub UFS_BSIZE () {8192;}' unless defined(&UFS_BSIZE);
    eval 'sub UFS_MINBSIZE () {4096;}' unless defined(&UFS_MINBSIZE);
    eval 'sub UFS_FSIZE () {1024;}' unless defined(&UFS_FSIZE);
    eval 'sub UFS_MAXFRAG () {( &UFS_BSIZE /  &UFS_FSIZE);}' unless defined(&UFS_MAXFRAG);
    eval 'sub UFS_NDADDR () {12;}' unless defined(&UFS_NDADDR);
    eval 'sub UFS_NINDIR () {3;}' unless defined(&UFS_NINDIR);
    eval 'sub UFS_IND_BLOCK () {( &UFS_NDADDR + 0);}' unless defined(&UFS_IND_BLOCK);
    eval 'sub UFS_DIND_BLOCK () {( &UFS_NDADDR + 1);}' unless defined(&UFS_DIND_BLOCK);
    eval 'sub UFS_TIND_BLOCK () {( &UFS_NDADDR + 2);}' unless defined(&UFS_TIND_BLOCK);
    eval 'sub UFS_NDIR_FRAGMENT () {( &UFS_NDADDR <<  ($uspi->{s_fpbshift}));}' unless defined(&UFS_NDIR_FRAGMENT);
    eval 'sub UFS_IND_FRAGMENT () {( &UFS_IND_BLOCK <<  ($uspi->{s_fpbshift}));}' unless defined(&UFS_IND_FRAGMENT);
    eval 'sub UFS_DIND_FRAGMENT () {( &UFS_DIND_BLOCK <<  ($uspi->{s_fpbshift}));}' unless defined(&UFS_DIND_FRAGMENT);
    eval 'sub UFS_TIND_FRAGMENT () {( &UFS_TIND_BLOCK <<  ($uspi->{s_fpbshift}));}' unless defined(&UFS_TIND_FRAGMENT);
    eval 'sub UFS_ROOTINO () {2;}' unless defined(&UFS_ROOTINO);
    eval 'sub UFS_FIRST_INO () {( &UFS_ROOTINO + 1);}' unless defined(&UFS_FIRST_INO);
    eval 'sub UFS_USEEFT () {(65535);}' unless defined(&UFS_USEEFT);
    eval 'sub UFS_FSOK () {0x7c269d38;}' unless defined(&UFS_FSOK);
    eval 'sub UFS_FSACTIVE () {(0x);}' unless defined(&UFS_FSACTIVE);
    eval 'sub UFS_FSCLEAN () {(0x1);}' unless defined(&UFS_FSCLEAN);
    eval 'sub UFS_FSSTABLE () {(0x2);}' unless defined(&UFS_FSSTABLE);
    eval 'sub UFS_FSOSF1 () {(0x3);}' unless defined(&UFS_FSOSF1);
    eval 'sub UFS_FSBAD () {(0xff);}' unless defined(&UFS_FSBAD);
    eval 'sub UFS_BYTESEX () {0x1;}' unless defined(&UFS_BYTESEX);
    if(defined( &__LITTLE_ENDIAN) || defined( &__BIG_ENDIAN)) {
	eval 'sub UFS_NATIVE_ENDIAN () {0x;}' unless defined(&UFS_NATIVE_ENDIAN);
	eval 'sub UFS_SWABBED_ENDIAN () {0x1;}' unless defined(&UFS_SWABBED_ENDIAN);
    } else {
	eval 'sub UFS_LITTLE_ENDIAN () {0x;}' unless defined(&UFS_LITTLE_ENDIAN);
	eval 'sub UFS_BIG_ENDIAN () {0x1;}' unless defined(&UFS_BIG_ENDIAN);
    }
    eval 'sub UFS_DE_MASK () {0x10;}' unless defined(&UFS_DE_MASK);
    eval 'sub UFS_DE_OLD () {0x;}' unless defined(&UFS_DE_OLD);
    eval 'sub UFS_DE_44BSD () {0x10;}' unless defined(&UFS_DE_44BSD);
    eval 'sub UFS_UID_MASK () {0x60;}' unless defined(&UFS_UID_MASK);
    eval 'sub UFS_UID_OLD () {0x;}' unless defined(&UFS_UID_OLD);
    eval 'sub UFS_UID_44BSD () {0x20;}' unless defined(&UFS_UID_44BSD);
    eval 'sub UFS_UID_EFT () {0x40;}' unless defined(&UFS_UID_EFT);
    eval 'sub UFS_ST_MASK () {0x700;}' unless defined(&UFS_ST_MASK);
    eval 'sub UFS_ST_OLD () {0x;}' unless defined(&UFS_ST_OLD);
    eval 'sub UFS_ST_44BSD () {0x100;}' unless defined(&UFS_ST_44BSD);
    eval 'sub UFS_ST_SUN () {0x200;}' unless defined(&UFS_ST_SUN);
    eval 'sub UFS_ST_SUNx86 () {0x400;}' unless defined(&UFS_ST_SUNx86);
    eval 'sub UFS_CG_MASK () {0x3000;}' unless defined(&UFS_CG_MASK);
    eval 'sub UFS_CG_OLD () {0x;}' unless defined(&UFS_CG_OLD);
    eval 'sub UFS_CG_44BSD () {0x2000;}' unless defined(&UFS_CG_44BSD);
    eval 'sub UFS_CG_SUN () {0x1000;}' unless defined(&UFS_CG_SUN);
    eval 'sub UFS_42INODEFMT () {-1;}' unless defined(&UFS_42INODEFMT);
    eval 'sub UFS_44INODEFMT () {2;}' unless defined(&UFS_44INODEFMT);
    eval 'sub UFS_MOUNT_ONERROR () {0xf;}' unless defined(&UFS_MOUNT_ONERROR);
    eval 'sub UFS_MOUNT_ONERROR_PANIC () {0x1;}' unless defined(&UFS_MOUNT_ONERROR_PANIC);
    eval 'sub UFS_MOUNT_ONERROR_LOCK () {0x2;}' unless defined(&UFS_MOUNT_ONERROR_LOCK);
    eval 'sub UFS_MOUNT_ONERROR_UMOUNT () {0x4;}' unless defined(&UFS_MOUNT_ONERROR_UMOUNT);
    eval 'sub UFS_MOUNT_ONERROR_REPAIR () {0x8;}' unless defined(&UFS_MOUNT_ONERROR_REPAIR);
    eval 'sub UFS_MOUNT_UFSTYPE () {0xff0;}' unless defined(&UFS_MOUNT_UFSTYPE);
    eval 'sub UFS_MOUNT_UFSTYPE_OLD () {0x10;}' unless defined(&UFS_MOUNT_UFSTYPE_OLD);
    eval 'sub UFS_MOUNT_UFSTYPE_44BSD () {0x20;}' unless defined(&UFS_MOUNT_UFSTYPE_44BSD);
    eval 'sub UFS_MOUNT_UFSTYPE_SUN () {0x40;}' unless defined(&UFS_MOUNT_UFSTYPE_SUN);
    eval 'sub UFS_MOUNT_UFSTYPE_NEXTSTEP () {0x80;}' unless defined(&UFS_MOUNT_UFSTYPE_NEXTSTEP);
    eval 'sub UFS_MOUNT_UFSTYPE_NEXTSTEP_CD () {0x100;}' unless defined(&UFS_MOUNT_UFSTYPE_NEXTSTEP_CD);
    eval 'sub UFS_MOUNT_UFSTYPE_OPENSTEP () {0x200;}' unless defined(&UFS_MOUNT_UFSTYPE_OPENSTEP);
    eval 'sub UFS_MOUNT_UFSTYPE_SUNx86 () {0x400;}' unless defined(&UFS_MOUNT_UFSTYPE_SUNx86);
    eval 'sub UFS_MOUNT_UFSTYPE_HP () {0x800;}' unless defined(&UFS_MOUNT_UFSTYPE_HP);
    eval 'sub ufs_clear_opt {
        local($o,$opt) = @_;
	    eval q($o &= ~ &UFS_MOUNT_$opt);
    }' unless defined(&ufs_clear_opt);
    eval 'sub ufs_set_opt {
        local($o,$opt) = @_;
	    eval q($o |=  &UFS_MOUNT_$opt);
    }' unless defined(&ufs_set_opt);
    eval 'sub ufs_test_opt {
        local($o,$opt) = @_;
	    eval q((($o) &  &UFS_MOUNT_$opt));
    }' unless defined(&ufs_test_opt);
    eval 'sub UFS_MINFREE () {5;}' unless defined(&UFS_MINFREE);
    eval 'sub UFS_DEFAULTOPT () { &UFS_OPTTIME;}' unless defined(&UFS_DEFAULTOPT);
    eval 'sub ufs_fsbtodb {
        local($uspi, $b) = @_;
	    eval q((($b) << ($uspi)-> &s_fsbtodb));
    }' unless defined(&ufs_fsbtodb);
    eval 'sub ufs_dbtofsb {
        local($uspi, $b) = @_;
	    eval q((($b) >> ($uspi)-> &s_fsbtodb));
    }' unless defined(&ufs_dbtofsb);
    eval 'sub ufs_cgbase {
        local($c) = @_;
	    eval q(( ($uspi->{s_fpg}) * ($c)));
    }' unless defined(&ufs_cgbase);
    eval 'sub ufs_cgstart {
        local($c) = @_;
	    eval q(( &ufs_cgbase($c) +  ($uspi->{s_cgoffset}) * (($c) & ~ ($uspi->{s_cgmask}))));
    }' unless defined(&ufs_cgstart);
    eval 'sub ufs_cgsblock {
        local($c) = @_;
	    eval q(( &ufs_cgstart($c) +  ($uspi->{s_sblkno})));
    }' unless defined(&ufs_cgsblock);
    eval 'sub ufs_cgcmin {
        local($c) = @_;
	    eval q(( &ufs_cgstart($c) +  ($uspi->{s_cblkno})));
    }' unless defined(&ufs_cgcmin);
    eval 'sub ufs_cgimin {
        local($c) = @_;
	    eval q(( &ufs_cgstart($c) +  ($uspi->{s_iblkno})));
    }' unless defined(&ufs_cgimin);
    eval 'sub ufs_cgdmin {
        local($c) = @_;
	    eval q(( &ufs_cgstart($c) +  ($uspi->{s_dblkno})));
    }' unless defined(&ufs_cgdmin);
    eval 'sub ufs_inotocg {
        local($x) = @_;
	    eval q((($x) /  ($uspi->{s_ipg})));
    }' unless defined(&ufs_inotocg);
    eval 'sub ufs_inotocgoff {
        local($x) = @_;
	    eval q((($x) %  ($uspi->{s_ipg})));
    }' unless defined(&ufs_inotocgoff);
    eval 'sub ufs_inotofsba {
        local($x) = @_;
	    eval q(( &ufs_cgimin( &ufs_inotocg($x)) +  &ufs_inotocgoff($x) /  ($uspi->{s_inopf})));
    }' unless defined(&ufs_inotofsba);
    eval 'sub ufs_inotofsbo {
        local($x) = @_;
	    eval q((($x) %  ($uspi->{s_inopf})));
    }' unless defined(&ufs_inotofsbo);
    eval 'sub ufs_dtog {
        local($d) = @_;
	    eval q((($d) /  ($uspi->{s_fpg})));
    }' unless defined(&ufs_dtog);
    eval 'sub ufs_dtogd {
        local($d) = @_;
	    eval q((($d) %  ($uspi->{s_fpg})));
    }' unless defined(&ufs_dtogd);
    eval 'sub ufs_cbtocylno {
        local($bno) = @_;
	    eval q((($bno) *  ($uspi->{s_nspf}) /  ($uspi->{s_spc})));
    }' unless defined(&ufs_cbtocylno);
    eval 'sub ufs_cbtorpos {
        local($bno) = @_;
	    eval q((((($bno) *  ($uspi->{s_nspf}) %  ($uspi->{s_spc}) /  ($uspi->{s_nsect})  *  ($uspi->{s_trackskew}) + ($bno) *  ($uspi->{s_nspf}) %  ($uspi->{s_spc})  %  ($uspi->{s_nsect}) *  ($uspi->{s_interleave})) %  ($uspi->{s_nsect})  *  ($uspi->{s_nrpos})) /  ($uspi->{s_npsect})));
    }' unless defined(&ufs_cbtorpos);
    eval 'sub ufs_blkoff {
        local($loc) = @_;
	    eval q((($loc) &  ($uspi->{s_qbmask})));
    }' unless defined(&ufs_blkoff);
    eval 'sub ufs_fragoff {
        local($loc) = @_;
	    eval q((($loc) &  ($uspi->{s_qfmask})));
    }' unless defined(&ufs_fragoff);
    eval 'sub ufs_lblktosize {
        local($blk) = @_;
	    eval q((($blk) <<  ($uspi->{s_bshift})));
    }' unless defined(&ufs_lblktosize);
    eval 'sub ufs_lblkno {
        local($loc) = @_;
	    eval q((($loc) >>  ($uspi->{s_bshift})));
    }' unless defined(&ufs_lblkno);
    eval 'sub ufs_numfrags {
        local($loc) = @_;
	    eval q((($loc) >>  ($uspi->{s_fshift})));
    }' unless defined(&ufs_numfrags);
    eval 'sub ufs_blkroundup {
        local($size) = @_;
	    eval q(((($size) +  ($uspi->{s_qbmask})) &  ($uspi->{s_bmask})));
    }' unless defined(&ufs_blkroundup);
    eval 'sub ufs_fragroundup {
        local($size) = @_;
	    eval q(((($size) +  ($uspi->{s_qfmask})) &  ($uspi->{s_fmask})));
    }' unless defined(&ufs_fragroundup);
    eval 'sub ufs_fragstoblks {
        local($frags) = @_;
	    eval q((($frags) >>  ($uspi->{s_fpbshift})));
    }' unless defined(&ufs_fragstoblks);
    eval 'sub ufs_blkstofrags {
        local($blks) = @_;
	    eval q((($blks) <<  ($uspi->{s_fpbshift})));
    }' unless defined(&ufs_blkstofrags);
    eval 'sub ufs_fragnum {
        local($fsb) = @_;
	    eval q((($fsb) &  ($uspi->{s_fpbmask})));
    }' unless defined(&ufs_fragnum);
    eval 'sub ufs_blknum {
        local($fsb) = @_;
	    eval q((($fsb) & ~ ($uspi->{s_fpbmask})));
    }' unless defined(&ufs_blknum);
    eval 'sub UFS_MAXNAMLEN () {255;}' unless defined(&UFS_MAXNAMLEN);
    eval 'sub UFS_MAXMNTLEN () {512;}' unless defined(&UFS_MAXMNTLEN);
    eval 'sub UFS_MAXCSBUFS () {31;}' unless defined(&UFS_MAXCSBUFS);
    eval 'sub UFS_LINK_MAX () {32000;}' unless defined(&UFS_LINK_MAX);
    eval 'sub UFS_DIR_PAD () {4;}' unless defined(&UFS_DIR_PAD);
    eval 'sub UFS_DIR_ROUND () {( &UFS_DIR_PAD - 1);}' unless defined(&UFS_DIR_ROUND);
    eval 'sub UFS_DIR_REC_LEN {
        local($name_len) = @_;
	    eval q(((($name_len) + 1+ 8+  &UFS_DIR_ROUND) & ~ &UFS_DIR_ROUND));
    }' unless defined(&UFS_DIR_REC_LEN);
    eval 'sub UFS_OPTTIME () {0;}' unless defined(&UFS_OPTTIME);
    eval 'sub UFS_OPTSPACE () {1;}' unless defined(&UFS_OPTSPACE);
    eval 'sub UFS_42POSTBLFMT () {-1;}' unless defined(&UFS_42POSTBLFMT);
    eval 'sub UFS_DYNAMICPOSTBLFMT () {1;}' unless defined(&UFS_DYNAMICPOSTBLFMT);
    eval 'sub fs_cs {
        local($indx) = @_;
	    eval q( ($u->{ufs_sb}->{s_csp[&(indx)>>uspi}->{s_csshift]})[($indx) & ~ ($uspi->{s_csmask})]);
    }' unless defined(&fs_cs);
    eval 'sub CG_MAGIC () {0x90255;}' unless defined(&CG_MAGIC);
    eval 'sub ufs_cg_chkmagic {
        local($ucg) = @_;
	    eval q(( &SWAB32(($ucg)-> &cg_magic) ==  &CG_MAGIC));
    }' unless defined(&ufs_cg_chkmagic);
    eval 'sub UFS_UF_SETTABLE () {0xffff;}' unless defined(&UFS_UF_SETTABLE);
    eval 'sub UFS_UF_NODUMP () {0x1;}' unless defined(&UFS_UF_NODUMP);
    eval 'sub UFS_UF_IMMUTABLE () {0x2;}' unless defined(&UFS_UF_IMMUTABLE);
    eval 'sub UFS_UF_APPEND () {0x4;}' unless defined(&UFS_UF_APPEND);
    eval 'sub UFS_UF_OPAQUE () {0x8;}' unless defined(&UFS_UF_OPAQUE);
    eval 'sub UFS_UF_NOUNLINK () {0x10;}' unless defined(&UFS_UF_NOUNLINK);
    eval 'sub UFS_SF_SETTABLE () {0xffff0000;}' unless defined(&UFS_SF_SETTABLE);
    eval 'sub UFS_SF_ARCHIVED () {0x10000;}' unless defined(&UFS_SF_ARCHIVED);
    eval 'sub UFS_SF_IMMUTABLE () {0x20000;}' unless defined(&UFS_SF_IMMUTABLE);
    eval 'sub UFS_SF_APPEND () {0x40000;}' unless defined(&UFS_SF_APPEND);
    eval 'sub UFS_SF_NOUNLINK () {0x100000;}' unless defined(&UFS_SF_NOUNLINK);
}
1;
