require '_h2ph_pre.ph';

unless(defined(&_LINUX_QUOTAOPS_)) {
    eval 'sub _LINUX_QUOTAOPS_ () {1;}' unless defined(&_LINUX_QUOTAOPS_);
    require 'linux/config.ph';
    require 'linux/smp_lock.ph';
    if(defined( &CONFIG_QUOTA)) {
	require 'linux/fs.ph';
	eval 'sub sb_any_quota_enabled {
	    local($sb) = @_;
    	    eval q((($sb)-> ($s_dquot->{flags}) & ( &DQUOT_USR_ENABLED |  &DQUOT_GRP_ENABLED)));
	}' unless defined(&sb_any_quota_enabled);
	eval 'sub DQUOT_SYNC {
	    local($dev) = @_;
    	    eval q( &sync_dquots($dev, -1));
	}' unless defined(&DQUOT_SYNC);
	eval 'sub DQUOT_OFF {
	    local($sb) = @_;
    	    eval q( &quota_off($sb, -1));
	}' unless defined(&DQUOT_OFF);
    } else {
	eval 'sub DQUOT_INIT {
	    local($inode) = @_;
    	    eval q( &do { }  &while(0));
	}' unless defined(&DQUOT_INIT);
	eval 'sub DQUOT_DROP {
	    local($inode) = @_;
    	    eval q( &do { }  &while(0));
	}' unless defined(&DQUOT_DROP);
	eval 'sub DQUOT_ALLOC_INODE {
	    local($inode) = @_;
    	    eval q((0));
	}' unless defined(&DQUOT_ALLOC_INODE);
	eval 'sub DQUOT_FREE_INODE {
	    local($inode) = @_;
    	    eval q( &do { }  &while(0));
	}' unless defined(&DQUOT_FREE_INODE);
	eval 'sub DQUOT_SYNC {
	    local($dev) = @_;
    	    eval q( &do { }  &while(0));
	}' unless defined(&DQUOT_SYNC);
	eval 'sub DQUOT_OFF {
	    local($sb) = @_;
    	    eval q( &do { }  &while(0));
	}' unless defined(&DQUOT_OFF);
	eval 'sub DQUOT_TRANSFER {
	    local($inode, $iattr) = @_;
    	    eval q((0));
	}' unless defined(&DQUOT_TRANSFER);
    }
    eval 'sub DQUOT_ALLOC_BLOCK_NODIRTY {
        local($inode, $nr) = @_;
	    eval q( &DQUOT_ALLOC_SPACE_NODIRTY(, (($nr)) << ($inode)-> ($i_sb->{s_blocksize_bits})));
    }' unless defined(&DQUOT_ALLOC_BLOCK_NODIRTY);
    eval 'sub DQUOT_ALLOC_BLOCK {
        local($inode, $nr) = @_;
	    eval q( &DQUOT_ALLOC_SPACE(, (($nr)) << ($inode)-> ($i_sb->{s_blocksize_bits})));
    }' unless defined(&DQUOT_ALLOC_BLOCK);
    eval 'sub DQUOT_PREALLOC_BLOCK_NODIRTY {
        local($inode, $nr) = @_;
	    eval q( &DQUOT_PREALLOC_SPACE_NODIRTY(, (($nr)) << ($inode)-> ($i_sb->{s_blocksize_bits})));
    }' unless defined(&DQUOT_PREALLOC_BLOCK_NODIRTY);
    eval 'sub DQUOT_PREALLOC_BLOCK {
        local($inode, $nr) = @_;
	    eval q( &DQUOT_PREALLOC_SPACE(, (($nr)) << ($inode)-> ($i_sb->{s_blocksize_bits})));
    }' unless defined(&DQUOT_PREALLOC_BLOCK);
    eval 'sub DQUOT_FREE_BLOCK_NODIRTY {
        local($inode, $nr) = @_;
	    eval q( &DQUOT_FREE_SPACE_NODIRTY(, (($nr)) << ($inode)-> ($i_sb->{s_blocksize_bits})));
    }' unless defined(&DQUOT_FREE_BLOCK_NODIRTY);
    eval 'sub DQUOT_FREE_BLOCK {
        local($inode, $nr) = @_;
	    eval q( &DQUOT_FREE_SPACE(, (($nr)) << ($inode)-> ($i_sb->{s_blocksize_bits})));
    }' unless defined(&DQUOT_FREE_BLOCK);
}
1;
