summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2002-05-19 19:34:39 -0700
committerLinus Torvalds <torvalds@penguin.transmeta.com>2002-05-19 19:34:39 -0700
commit736e690ebc2f1b885eb0182432c9f9d753e51b6f (patch)
treea53e08a210d6531ac508d60d787c476acad20424 /include/linux
parent0c532315fb1317ce45be1af9f8b32586b4bc95e9 (diff)
[PATCH] [11/13] quota-11-sync
Implemented proper syncing of dquots - ie. also global information about quota files are synced. We find info to sync by walking through all superblocks...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fs.h12
-rw-r--r--include/linux/quota.h31
-rw-r--r--include/linux/quotaops.h2
3 files changed, 25 insertions, 20 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index f30905c9a4f1..9a5c7d4bb2a4 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -617,18 +617,6 @@ struct nameidata {
struct vfsmount *old_mnt;
};
-#define DQUOT_USR_ENABLED 0x01 /* User diskquotas enabled */
-#define DQUOT_GRP_ENABLED 0x02 /* Group diskquotas enabled */
-
-struct quota_info {
- unsigned int flags; /* Flags for diskquotas on this device */
- struct semaphore dqio_sem; /* lock device while I/O in progress */
- struct semaphore dqoff_sem; /* serialize quota_off() and quota_on() on device */
- struct file *files[MAXQUOTAS]; /* fp's to quotafiles */
- struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */
- struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */
-};
-
/*
* Umount options
*/
diff --git a/include/linux/quota.h b/include/linux/quota.h
index 544c4531e69a..0a36a5e59caf 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -170,6 +170,7 @@ struct mem_dqinfo {
#define DQF_MASK 0xffff /* Mask for format specific flags */
#define DQF_INFO_DIRTY 0x10000 /* Is info dirty? */
+#define DQF_ANY_DQUOT_DIRTY 0x20000 /* Is any dquot dirty? */
extern inline void mark_info_dirty(struct mem_dqinfo *info)
{
@@ -178,6 +179,9 @@ extern inline void mark_info_dirty(struct mem_dqinfo *info)
#define info_dirty(info) ((info)->dqi_flags & DQF_INFO_DIRTY)
+#define info_any_dirty(info) ((info)->dqi_flags & DQF_INFO_DIRTY ||\
+ (info)->dqi_flags & DQF_ANY_DQUOT_DIRTY)
+
#define sb_dqopt(sb) (&(sb)->s_dquot)
extern int nr_dquots, nr_free_dquots;
@@ -224,13 +228,6 @@ struct dquot {
struct mem_dqblk dq_dqb; /* Diskquota usage */
};
-extern inline void mark_dquot_dirty(struct dquot *dquot)
-{
- dquot->dq_flags |= DQ_MOD;
-}
-
-#define dquot_dirty(dquot) ((dquot)->dq_flags & DQ_MOD)
-
#define NODQUOT (struct dquot *)NULL
#define QUOTA_OK 0
@@ -279,6 +276,26 @@ struct quota_format_type {
struct quota_format_type *qf_next;
};
+#define DQUOT_USR_ENABLED 0x01 /* User diskquotas enabled */
+#define DQUOT_GRP_ENABLED 0x02 /* Group diskquotas enabled */
+
+struct quota_info {
+ unsigned int flags; /* Flags for diskquotas on this device */
+ struct semaphore dqio_sem; /* lock device while I/O in progress */
+ struct semaphore dqoff_sem; /* serialize quota_off() and quota_on() on device */
+ struct file *files[MAXQUOTAS]; /* fp's to quotafiles */
+ struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */
+ struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */
+};
+
+/* Inline would be better but we need to dereference super_block which is not defined yet */
+#define mark_dquot_dirty(dquot) do {\
+ dquot->dq_flags |= DQ_MOD;\
+ sb_dqopt(dquot->dq_sb)->info[dquot->dq_type].dqi_flags |= DQF_ANY_DQUOT_DIRTY;\
+} while (0)
+
+#define dquot_dirty(dquot) ((dquot)->dq_flags & DQ_MOD)
+
static inline int is_enabled(struct quota_info *dqopt, int type)
{
switch (type) {
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index fac031c896c1..31b24e37c159 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -20,7 +20,7 @@
/*
* declaration of quota_function calls in kernel.
*/
-extern int sync_dquots(kdev_t dev, int type);
+extern void sync_dquots(struct super_block *sb, int type);
extern void dquot_initialize(struct inode *inode, int type);
extern void dquot_drop(struct inode *inode);