diff --git a/fs/compat.c b/fs/compat.c index 6c4741a..4f983e2 100644 --- a/fs/compat.c +++ b/fs/compat.c @@ -56,6 +56,10 @@ #include #include +#ifdef CONFIG_QUOTA_COMPAT +#include +#endif + extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat); int compat_log = 1; diff --git a/fs/quota.c b/fs/quota.c index e037b78..ca7a9be 100644 --- a/fs/quota.c +++ b/fs/quota.c @@ -18,6 +18,10 @@ #include #include +#ifdef CONFIG_QUOTA_COMPAT +#include +#endif + /* Check validity of generic quotactl commands */ static int generic_quotactl_valid(struct super_block *sb, int type, int cmd, qid_t id) { diff --git a/include/linux/quota-compat.h b/include/linux/quota-compat.h new file mode 100644 index 0000000..c2f3435 --- /dev/null +++ b/include/linux/quota-compat.h @@ -0,0 +1,60 @@ +/* + * include/linux/quota-compat.h + * + * Copyright (C) 2008 SWsoft + * All rights reserved. + * + * Licensing governed by "linux/COPYING.SWsoft" file. + * + */ + +#ifndef _LINUX_QUOTA_COMPAT_ +#define _LINUX_QUOTA_COMPAT_ + +#include + +#define QC_QUOTAON 0x0100 /* enable quotas */ +#define QC_QUOTAOFF 0x0200 /* disable quotas */ + +/* GETQUOTA, SETQUOTA and SETUSE which were at 0x0300-0x0500 has now + * other parameteres + */ +#define QC_SYNC 0x0600 /* sync disk copy of a filesystems quotas */ +#define QC_SETQLIM 0x0700 /* set limits */ +/* GETSTATS at 0x0800 is now longer... */ +#define QC_GETINFO 0x0900 /* get info about quotas - graces, flags... */ +#define QC_SETINFO 0x0A00 /* set info about quotas */ +#define QC_SETGRACE 0x0B00 /* set inode and block grace */ +#define QC_SETFLAGS 0x0C00 /* set flags for quota */ +#define QC_GETQUOTA 0x0D00 /* get limits and usage */ +#define QC_SETQUOTA 0x0E00 /* set limits and usage */ +#define QC_SETUSE 0x0F00 /* set usage */ +/* 0x1000 used by old RSQUASH */ +#define QC_GETSTATS 0x1100 /* get collected stats */ + +struct compat_v2_dqblk { + unsigned int dqb_ihardlimit; + unsigned int dqb_isoftlimit; + unsigned int dqb_curinodes; + unsigned int dqb_bhardlimit; + unsigned int dqb_bsoftlimit; + qsize_t dqb_curspace; + __kernel_time_t dqb_btime; + __kernel_time_t dqb_itime; +}; + +#ifdef CONFIG_COMPAT +struct compat_v2_dqblk_32 { + unsigned int dqb_ihardlimit; + unsigned int dqb_isoftlimit; + unsigned int dqb_curinodes; + unsigned int dqb_bhardlimit; + unsigned int dqb_bsoftlimit; + qsize_t dqb_curspace; + compat_time_t dqb_btime; + compat_time_t dqb_itime; +} __attribute__ ((packed)); +#endif + +#endif /* _LINUX_QUOTA_COMPAT_ */ + diff --git a/include/linux/quota.h b/include/linux/quota.h index c8ae394..55afad9 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h @@ -321,53 +321,6 @@ int mark_dquot_dirty(struct dquot *dquot); int register_quota_format(struct quota_format_type *fmt); void unregister_quota_format(struct quota_format_type *fmt); -#ifdef CONFIG_QUOTA_COMPAT -#include - -#define QC_QUOTAON 0x0100 /* enable quotas */ -#define QC_QUOTAOFF 0x0200 /* disable quotas */ - -/* GETQUOTA, SETQUOTA and SETUSE which were at 0x0300-0x0500 has now - * other parameteres - */ -#define QC_SYNC 0x0600 /* sync disk copy of a filesystems quotas */ -#define QC_SETQLIM 0x0700 /* set limits */ -/* GETSTATS at 0x0800 is now longer... */ -#define QC_GETINFO 0x0900 /* get info about quotas - graces, flags... */ -#define QC_SETINFO 0x0A00 /* set info about quotas */ -#define QC_SETGRACE 0x0B00 /* set inode and block grace */ -#define QC_SETFLAGS 0x0C00 /* set flags for quota */ -#define QC_GETQUOTA 0x0D00 /* get limits and usage */ -#define QC_SETQUOTA 0x0E00 /* set limits and usage */ -#define QC_SETUSE 0x0F00 /* set usage */ -/* 0x1000 used by old RSQUASH */ -#define QC_GETSTATS 0x1100 /* get collected stats */ - -struct compat_v2_dqblk { - unsigned int dqb_ihardlimit; - unsigned int dqb_isoftlimit; - unsigned int dqb_curinodes; - unsigned int dqb_bhardlimit; - unsigned int dqb_bsoftlimit; - qsize_t dqb_curspace; - __kernel_time_t dqb_btime; - __kernel_time_t dqb_itime; -}; - -#ifdef CONFIG_COMPAT -struct compat_v2_dqblk_32 { - unsigned int dqb_ihardlimit; - unsigned int dqb_isoftlimit; - unsigned int dqb_curinodes; - unsigned int dqb_bhardlimit; - unsigned int dqb_bsoftlimit; - qsize_t dqb_curspace; - compat_time_t dqb_btime; - compat_time_t dqb_itime; -} __attribute__ ((packed)); -#endif -#endif - struct quota_module_name { int qm_fmt_id; char *qm_mod_name;