require '_h2ph_pre.ph';

unless(defined(&_LINUX_QUOTA_)) {
    eval 'sub _LINUX_QUOTA_ () {1;}' unless defined(&_LINUX_QUOTA_);
    require 'linux/errno.ph';
    require 'linux/types.ph';
    require 'asm/posix_types.ph';
    eval 'sub MAXQUOTAS () {2;}' unless defined(&MAXQUOTAS);
    eval 'sub USRQUOTA () {0;}' unless defined(&USRQUOTA);
    eval 'sub GRPQUOTA () {1;}' unless defined(&GRPQUOTA);
    eval 'sub INITQFNAMES () {{ "user", "group", "undefined", };}' unless defined(&INITQFNAMES);
    eval 'sub INITQMAGICS () {{ 0xd9c01f11, 0xd9c01927 };}' unless defined(&INITQMAGICS);
    eval 'sub INITQVERSIONS () {{ 0, 0};}' unless defined(&INITQVERSIONS);
    eval 'sub QUOTAFILENAME () {"aquota";}' unless defined(&QUOTAFILENAME);
    eval 'sub QUOTAGROUP () {"staff";}' unless defined(&QUOTAGROUP);
    eval 'sub QUOTABLOCK_BITS () {10;}' unless defined(&QUOTABLOCK_BITS);
    eval 'sub QUOTABLOCK_SIZE () {(1<<  &QUOTABLOCK_BITS);}' unless defined(&QUOTABLOCK_SIZE);
    eval 'sub qb2kb {
        local($x) = @_;
	    eval q((($x) << ( &QUOTABLOCK_BITS-10)));
    }' unless defined(&qb2kb);
    eval 'sub kb2qb {
        local($x) = @_;
	    eval q((($x) >> ( &QUOTABLOCK_BITS-10)));
    }' unless defined(&kb2qb);
    eval 'sub toqb {
        local($x) = @_;
	    eval q(((($x) +  &QUOTABLOCK_SIZE - 1) >>  &QUOTABLOCK_BITS));
    }' unless defined(&toqb);
    eval 'sub SUBCMDMASK () {0xff;}' unless defined(&SUBCMDMASK);
    eval 'sub SUBCMDSHIFT () {8;}' unless defined(&SUBCMDSHIFT);
    eval 'sub QCMD {
        local($cmd, $type) = @_;
	    eval q(((($cmd) <<  &SUBCMDSHIFT) | (($type) &  &SUBCMDMASK)));
    }' unless defined(&QCMD);
    eval 'sub Q_QUOTAON () {0x100;}' unless defined(&Q_QUOTAON);
    eval 'sub Q_QUOTAOFF () {0x200;}' unless defined(&Q_QUOTAOFF);
    eval 'sub Q_SYNC () {0x600;}' unless defined(&Q_SYNC);
    eval 'sub Q_SETQLIM () {0x700;}' unless defined(&Q_SETQLIM);
    eval 'sub Q_GETINFO () {0x900;}' unless defined(&Q_GETINFO);
    eval 'sub Q_SETINFO () {0xa00;}' unless defined(&Q_SETINFO);
    eval 'sub Q_SETGRACE () {0xb00;}' unless defined(&Q_SETGRACE);
    eval 'sub Q_SETFLAGS () {0xc00;}' unless defined(&Q_SETFLAGS);
    eval 'sub Q_GETQUOTA () {0xd00;}' unless defined(&Q_GETQUOTA);
    eval 'sub Q_SETQUOTA () {0xe00;}' unless defined(&Q_SETQUOTA);
    eval 'sub Q_SETUSE () {0xf00;}' unless defined(&Q_SETUSE);
    eval 'sub Q_GETSTATS () {0x1100;}' unless defined(&Q_GETSTATS);
    eval 'sub DQF_MASK () {0x;}' unless defined(&DQF_MASK);
    eval 'sub DQINFOOFF () {$sizeof{\'struct disk_dqheader\'};}' unless defined(&DQINFOOFF);
    eval 'sub DQBLKSIZE_BITS () {10;}' unless defined(&DQBLKSIZE_BITS);
    eval 'sub DQBLKSIZE () {(1<<  &DQBLKSIZE_BITS);}' unless defined(&DQBLKSIZE);
    eval 'sub DQTREEOFF () {1;}' unless defined(&DQTREEOFF);
    eval 'sub DQTREEDEPTH () {4;}' unless defined(&DQTREEDEPTH);
    eval 'sub DQSTRINBLK () {(( &DQBLKSIZE - $sizeof{\'struct disk_dqdbheader\'}) / $sizeof{\'struct disk_dqblk\'});}' unless defined(&DQSTRINBLK);
}
1;
