Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / include / linux / quota.h
index ac5b90f..2dab71e 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/spinlock.h>
+#include <linux/mutex.h>
 
 #define __DQUOT_VERSION__      "dquot_6.5.1"
 #define __DQUOT_NUM_VERSION__  6*10000+5*100+1
@@ -138,8 +139,11 @@ struct if_dqinfo {
 #include <linux/dqblk_v2.h>
 
 /* Maximal numbers of writes for quota operation (insert/delete/update)
- * (over all formats) - info block, 4 pointer blocks, data block */
-#define DQUOT_MAX_WRITES       6
+ * (over VFS all formats) */
+#define DQUOT_INIT_ALLOC max(V1_INIT_ALLOC, V2_INIT_ALLOC)
+#define DQUOT_INIT_REWRITE max(V1_INIT_REWRITE, V2_INIT_REWRITE)
+#define DQUOT_DEL_ALLOC max(V1_DEL_ALLOC, V2_DEL_ALLOC)
+#define DQUOT_DEL_REWRITE max(V1_DEL_REWRITE, V2_DEL_REWRITE)
 
 /*
  * Data for one user/group kept in memory
@@ -205,14 +209,13 @@ extern struct dqstats dqstats;
 #define DQ_FAKE_B      3       /* no limits only usage */
 #define DQ_READ_B      4       /* dquot was read into memory */
 #define DQ_ACTIVE_B    5       /* dquot is active (dquot_release not called) */
-#define DQ_WAITFREE_B  6       /* dquot being waited (by invalidate_dquots) */
 
 struct dquot {
        struct hlist_node dq_hash;      /* Hash list in memory */
        struct list_head dq_inuse;      /* List of all quotas */
        struct list_head dq_free;       /* Free list element */
        struct list_head dq_dirty;      /* List of dirty dquots */
-       struct semaphore dq_lock;       /* dquot IO lock */
+       struct mutex dq_lock;           /* dquot IO lock */
        atomic_t dq_count;              /* Use count */
        wait_queue_head_t dq_wait_unused;       /* Wait queue for dquot to become unused */
        struct super_block *dq_sb;      /* superblock this applies to */
@@ -282,11 +285,10 @@ struct quota_format_type {
 
 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 dqonoff_sem;           /* Serialize quotaon & quotaoff */
+       struct mutex dqio_mutex;                /* lock device while I/O in progress */
+       struct mutex dqonoff_mutex;             /* Serialize quotaon & quotaoff */
        struct rw_semaphore dqptr_sem;          /* serialize ops using quota_info struct, pointers from inode to dquots */
        struct inode *files[MAXQUOTAS];         /* inodes of quotafiles */
-       struct vfsmount *mnt[MAXQUOTAS];        /* mountpoint entries of filesystems with quota files */
        struct mem_dqinfo info[MAXQUOTAS];      /* Information for each quota type */
        struct quota_format_ops *ops[MAXQUOTAS];        /* Operations for each type */
 };