diff options
| author | Jan Kara <jack@suse.cz> | 2002-05-19 19:34:20 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@penguin.transmeta.com> | 2002-05-19 19:34:20 -0700 |
| commit | b5abbc1f844d101615d6d2c5abac8a692f028d01 (patch) | |
| tree | bcfdc6ca07103e209a5416bc0c18cba8c5a01c20 /include/linux/quotaops.h | |
| parent | ce9fb13943c8e4d932f152dbd08097ed36c62a54 (diff) | |
[PATCH] [7/13] quota-7-quotactl
This is probably the largest chunk in quota patches. It removes old quotactl interface
and implements new one. New interface should not need arch specific conversions so they
are removed. All quota interface stuff is moved to quota.c so we can
easily separate things which should be compiled even if quota is disabled (mainly
because XFS needs some interface even if standard VFS quota is disabled).
Callbacks to filesystem on quota_on() and quota_off() are implemented (needed by Ext3),
quota operations callbacks are now set in super.c on superblock initialization and
not on quota_on(). This way it starts to make sense to have callbacks on alloc_space(),
alloc_inode() etc. as filesystem can override them on read_super(). This will be used
later for implementing journalled quota.
Diffstat (limited to 'include/linux/quotaops.h')
| -rw-r--r-- | include/linux/quotaops.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index b5da5ff5bb9a..0cd58a4fa275 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h @@ -20,10 +20,10 @@ /* * declaration of quota_function calls in kernel. */ +extern int sync_dquots(kdev_t dev, short type); + extern void dquot_initialize(struct inode *inode, short type); extern void dquot_drop(struct inode *inode); -extern int quota_off(struct super_block *sb, short type); -extern int sync_dquots(struct super_block *sb, short type); extern int dquot_alloc_space(struct inode *inode, qsize_t number, int prealloc); extern int dquot_alloc_inode(const struct inode *inode, unsigned long number); @@ -36,7 +36,11 @@ extern int dquot_transfer(struct inode *inode, struct iattr *iattr); /* * Operations supported for diskquotas. */ -#define sb_any_quota_enabled(sb) ((sb)->s_dquot.flags & (DQUOT_USR_ENABLED | DQUOT_GRP_ENABLED)) +extern struct dquot_operations dquot_operations; +extern struct quotactl_ops vfs_quotactl_ops; + +#define sb_dquot_ops (&dquot_operations) +#define sb_quotactl_ops (&vfs_quotactl_ops) static __inline__ void DQUOT_INIT(struct inode *inode) { @@ -160,13 +164,25 @@ static __inline__ int DQUOT_TRANSFER(struct inode *inode, struct iattr *iattr) } #define DQUOT_SYNC(sb) sync_dquots(sb, -1) -#define DQUOT_OFF(sb) quota_off(sb, -1) + +static __inline__ int DQUOT_OFF(struct super_block *sb) +{ + int ret = -ENOSYS; + + lock_kernel(); + if (sb->s_qcop && sb->s_qcop->quota_off) + ret = sb->s_qcop->quota_off(sb, -1); + unlock_kernel(); + return ret; +} #else /* * NO-OP when quota not configured. */ +#define sb_dquot_ops (NULL) +#define sb_quotactl_ops (NULL) #define DQUOT_INIT(inode) do { } while(0) #define DQUOT_DROP(inode) do { } while(0) #define DQUOT_ALLOC_INODE(inode) (0) |
