require '_h2ph_pre.ph';

unless(defined(&_LINUX_FS_H)) {
    eval 'sub _LINUX_FS_H () {1;}' unless defined(&_LINUX_FS_H);
    require 'linux/config.ph';
    require 'linux/linkage.ph';
    require 'linux/limits.ph';
    require 'linux/wait.ph';
    require 'linux/types.ph';
    require 'linux/vfs.ph';
    require 'linux/net.ph';
    require 'linux/kdev_t.ph';
    require 'linux/ioctl.ph';
    require 'linux/list.ph';
    require 'linux/dcache.ph';
    require 'linux/stat.ph';
    require 'linux/cache.ph';
    require 'linux/stddef.ph';
    require 'linux/string.ph';
    undef(&NR_OPEN) if defined(&NR_OPEN);
    eval 'sub NR_OPEN () {(1024*1024);}' unless defined(&NR_OPEN);
    eval 'sub INR_OPEN () {1024;}' unless defined(&INR_OPEN);
    eval 'sub BLOCK_SIZE_BITS () {10;}' unless defined(&BLOCK_SIZE_BITS);
    eval 'sub BLOCK_SIZE () {(1<< &BLOCK_SIZE_BITS);}' unless defined(&BLOCK_SIZE);
    eval 'sub NR_FILE () {8192;}' unless defined(&NR_FILE);
    eval 'sub NR_RESERVED_FILES () {10;}' unless defined(&NR_RESERVED_FILES);
    eval 'sub NR_SUPER () {256;}' unless defined(&NR_SUPER);
    eval 'sub MAY_EXEC () {1;}' unless defined(&MAY_EXEC);
    eval 'sub MAY_WRITE () {2;}' unless defined(&MAY_WRITE);
    eval 'sub MAY_READ () {4;}' unless defined(&MAY_READ);
    eval 'sub FMODE_READ () {1;}' unless defined(&FMODE_READ);
    eval 'sub FMODE_WRITE () {2;}' unless defined(&FMODE_WRITE);
    eval 'sub READ () {0;}' unless defined(&READ);
    eval 'sub WRITE () {1;}' unless defined(&WRITE);
    eval 'sub READA () {2;}' unless defined(&READA);
    eval 'sub SPECIAL () {4;}' unless defined(&SPECIAL);
    eval 'sub SEL_IN () {1;}' unless defined(&SEL_IN);
    eval 'sub SEL_OUT () {2;}' unless defined(&SEL_OUT);
    eval 'sub SEL_EX () {4;}' unless defined(&SEL_EX);
    eval 'sub FS_REQUIRES_DEV () {1;}' unless defined(&FS_REQUIRES_DEV);
    eval 'sub FS_NO_DCACHE () {2;}' unless defined(&FS_NO_DCACHE);
    eval 'sub FS_NO_PRELIM () {4;}' unless defined(&FS_NO_PRELIM);
    eval 'sub FS_SINGLE () {8;}' unless defined(&FS_SINGLE);
    eval 'sub FS_NOMOUNT () {16;}' unless defined(&FS_NOMOUNT);
    eval 'sub FS_LITTER () {32;}' unless defined(&FS_LITTER);
    eval 'sub FS_ODD_RENAME () {32768;}' unless defined(&FS_ODD_RENAME);
    eval 'sub MS_RDONLY () {1;}' unless defined(&MS_RDONLY);
    eval 'sub MS_NOSUID () {2;}' unless defined(&MS_NOSUID);
    eval 'sub MS_NODEV () {4;}' unless defined(&MS_NODEV);
    eval 'sub MS_NOEXEC () {8;}' unless defined(&MS_NOEXEC);
    eval 'sub MS_SYNCHRONOUS () {16;}' unless defined(&MS_SYNCHRONOUS);
    eval 'sub MS_REMOUNT () {32;}' unless defined(&MS_REMOUNT);
    eval 'sub MS_MANDLOCK () {64;}' unless defined(&MS_MANDLOCK);
    eval 'sub MS_NOATIME () {1024;}' unless defined(&MS_NOATIME);
    eval 'sub MS_NODIRATIME () {2048;}' unless defined(&MS_NODIRATIME);
    eval 'sub MS_BIND () {4096;}' unless defined(&MS_BIND);
    eval 'sub MS_NOUSER () {(1<<31);}' unless defined(&MS_NOUSER);
    eval 'sub MS_RMT_MASK () {( &MS_RDONLY| &MS_SYNCHRONOUS| &MS_MANDLOCK| &MS_NOATIME|  &MS_NODIRATIME);}' unless defined(&MS_RMT_MASK);
    eval 'sub MS_MGC_VAL () {0xc0ed0000;}' unless defined(&MS_MGC_VAL);
    eval 'sub MS_MGC_MSK () {0xffff0000;}' unless defined(&MS_MGC_MSK);
    eval 'sub S_SYNC () {1;}' unless defined(&S_SYNC);
    eval 'sub S_NOATIME () {2;}' unless defined(&S_NOATIME);
    eval 'sub S_QUOTA () {4;}' unless defined(&S_QUOTA);
    eval 'sub S_APPEND () {8;}' unless defined(&S_APPEND);
    eval 'sub S_IMMUTABLE () {16;}' unless defined(&S_IMMUTABLE);
    eval 'sub S_DEAD () {32;}' unless defined(&S_DEAD);
    eval 'sub S_NOQUOTA () {64;}' unless defined(&S_NOQUOTA);
    eval 'sub __IS_FLG {
        local($inode,$flg) = @_;
	    eval q((($inode)-> ($i_sb->{s_flags}) & ($flg)));
    }' unless defined(&__IS_FLG);
    eval 'sub IS_RDONLY {
        local($inode) = @_;
	    eval q((($inode)-> ($i_sb->{s_flags}) &  &MS_RDONLY));
    }' unless defined(&IS_RDONLY);
    eval 'sub IS_SYNC {
        local($inode) = @_;
	    eval q(( &__IS_FLG($inode,  &MS_SYNCHRONOUS) || (($inode)-> &i_flags &  &S_SYNC)));
    }' unless defined(&IS_SYNC);
    eval 'sub IS_MANDLOCK {
        local($inode) = @_;
	    eval q( &__IS_FLG($inode,  &MS_MANDLOCK));
    }' unless defined(&IS_MANDLOCK);
    eval 'sub IS_QUOTAINIT {
        local($inode) = @_;
	    eval q((($inode)-> &i_flags &  &S_QUOTA));
    }' unless defined(&IS_QUOTAINIT);
    eval 'sub IS_NOQUOTA {
        local($inode) = @_;
	    eval q((($inode)-> &i_flags &  &S_NOQUOTA));
    }' unless defined(&IS_NOQUOTA);
    eval 'sub IS_APPEND {
        local($inode) = @_;
	    eval q((($inode)-> &i_flags &  &S_APPEND));
    }' unless defined(&IS_APPEND);
    eval 'sub IS_IMMUTABLE {
        local($inode) = @_;
	    eval q((($inode)-> &i_flags &  &S_IMMUTABLE));
    }' unless defined(&IS_IMMUTABLE);
    eval 'sub IS_NOATIME {
        local($inode) = @_;
	    eval q(( &__IS_FLG($inode,  &MS_NOATIME) || (($inode)-> &i_flags &  &S_NOATIME)));
    }' unless defined(&IS_NOATIME);
    eval 'sub IS_NODIRATIME {
        local($inode) = @_;
	    eval q( &__IS_FLG($inode,  &MS_NODIRATIME));
    }' unless defined(&IS_NODIRATIME);
    eval 'sub IS_DEADDIR {
        local($inode) = @_;
	    eval q((($inode)-> &i_flags &  &S_DEAD));
    }' unless defined(&IS_DEADDIR);
    eval 'sub BLKROSET () { &_IO(0x12,93);}' unless defined(&BLKROSET);
    eval 'sub BLKROGET () { &_IO(0x12,94);}' unless defined(&BLKROGET);
    eval 'sub BLKRRPART () { &_IO(0x12,95);}' unless defined(&BLKRRPART);
    eval 'sub BLKGETSIZE () { &_IO(0x12,96);}' unless defined(&BLKGETSIZE);
    eval 'sub BLKFLSBUF () { &_IO(0x12,97);}' unless defined(&BLKFLSBUF);
    eval 'sub BLKRASET () { &_IO(0x12,98);}' unless defined(&BLKRASET);
    eval 'sub BLKRAGET () { &_IO(0x12,99);}' unless defined(&BLKRAGET);
    eval 'sub BLKFRASET () { &_IO(0x12,100);}' unless defined(&BLKFRASET);
    eval 'sub BLKFRAGET () { &_IO(0x12,101);}' unless defined(&BLKFRAGET);
    eval 'sub BLKSECTSET () { &_IO(0x12,102);}' unless defined(&BLKSECTSET);
    eval 'sub BLKSECTGET () { &_IO(0x12,103);}' unless defined(&BLKSECTGET);
    eval 'sub BLKSSZGET () { &_IO(0x12,104);}' unless defined(&BLKSSZGET);
    if(0) {
	eval 'sub BLKPG () { &_IO(0x12,105);}' unless defined(&BLKPG);
	eval 'sub BLKELVGET () { &_IOR(0x12,106,$sizeof{ &blkelv_ioctl_arg_t});}' unless defined(&BLKELVGET);
	eval 'sub BLKELVSET () { &_IOW(0x12,107,$sizeof{ &blkelv_ioctl_arg_t});}' unless defined(&BLKELVSET);
    }
    eval 'sub BLKGETLASTSECT () { &_IO(0x12,108);}' unless defined(&BLKGETLASTSECT);
    eval 'sub BLKSETLASTSECT () { &_IO(0x12,109);}' unless defined(&BLKSETLASTSECT);
    eval 'sub BLKBSZGET () { &_IOR(0x12,112,$sizeof{\'int\'});}' unless defined(&BLKBSZGET);
    eval 'sub BLKBSZSET () { &_IOW(0x12,113,$sizeof{\'int\'});}' unless defined(&BLKBSZSET);
    eval 'sub BMAP_IOCTL () {1;}' unless defined(&BMAP_IOCTL);
    eval 'sub FIBMAP () { &_IO(0x,1);}' unless defined(&FIBMAP);
    eval 'sub FIGETBSZ () { &_IO(0x,2);}' unless defined(&FIGETBSZ);
}
1;
