require '_h2ph_pre.ph';

unless(defined(&_LINUX_BFS_FS_H)) {
    eval 'sub _LINUX_BFS_FS_H () {1;}' unless defined(&_LINUX_BFS_FS_H);
    eval 'sub BFS_BSIZE_BITS () {9;}' unless defined(&BFS_BSIZE_BITS);
    eval 'sub BFS_BSIZE () {(1<< &BFS_BSIZE_BITS);}' unless defined(&BFS_BSIZE);
    eval 'sub BFS_MAGIC () {0x1badface;}' unless defined(&BFS_MAGIC);
    eval 'sub BFS_ROOT_INO () {2;}' unless defined(&BFS_ROOT_INO);
    eval 'sub BFS_INODES_PER_BLOCK () {8;}' unless defined(&BFS_INODES_PER_BLOCK);
    eval 'sub BFS_VDIR () {2;}' unless defined(&BFS_VDIR);
    eval 'sub BFS_VREG () {1;}' unless defined(&BFS_VREG);
    eval 'sub BFS_NAMELEN () {14;}' unless defined(&BFS_NAMELEN);
    eval 'sub BFS_DIRENT_SIZE () {16;}' unless defined(&BFS_DIRENT_SIZE);
    eval 'sub BFS_DIRS_PER_BLOCK () {32;}' unless defined(&BFS_DIRS_PER_BLOCK);
    eval 'sub BFS_NZFILESIZE {
        local($ip) = @_;
	    eval q(((($ip)-> &i_eoffset + 1) - ($ip)-> &i_sblock *  &BFS_BSIZE));
    }' unless defined(&BFS_NZFILESIZE);
    eval 'sub BFS_FILESIZE {
        local($ip) = @_;
	    eval q((($ip)-> &i_sblock == 0? 0:  &BFS_NZFILESIZE($ip)));
    }' unless defined(&BFS_FILESIZE);
    eval 'sub BFS_FILEBLOCKS {
        local($ip) = @_;
	    eval q((($ip)-> &i_sblock == 0? 0: (($ip)-> &i_eblock + 1) - ($ip)-> &i_sblock));
    }' unless defined(&BFS_FILEBLOCKS);
    eval 'sub BFS_OFF2INO {
        local($offset) = @_;
	    eval q((((($offset) -  &BFS_BSIZE) / $sizeof{\'struct bfs_inode\'}) +  &BFS_ROOT_INO));
    }' unless defined(&BFS_OFF2INO);
    eval 'sub BFS_INO2OFF {
        local($ino) = @_;
	    eval q((((($ino) -  &BFS_ROOT_INO) * $sizeof{\'struct bfs_inode\'}) +  &BFS_BSIZE));
    }' unless defined(&BFS_INO2OFF);
    eval 'sub BFS_UNCLEAN {
        local($bfs_sb, $sb) = @_;
	    eval q((( ($bfs_sb->{s_from}) != -1)  && ( ($bfs_sb->{s_to}) != -1)  && !( ($sb->{s_flags}) &  &MS_RDONLY)));
    }' unless defined(&BFS_UNCLEAN);
}
1;
