]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/quota.h
Driver core: fix coding style issues in device.h
[linux-2.6-omap-h63xx.git] / include / linux / quota.h
index f33aeb22c26a321c211b1de244427c50be1db6fb..6e0393a5b2eafd4c98ec08fae1a0d83372a03672 100644 (file)
@@ -37,7 +37,6 @@
 
 #include <linux/errno.h>
 #include <linux/types.h>
-#include <linux/spinlock.h>
 
 #define __DQUOT_VERSION__      "dquot_6.5.1"
 #define __DQUOT_NUM_VERSION__  6*10000+5*100+1
@@ -45,8 +44,6 @@
 typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */
 typedef __u64 qsize_t;          /* Type in which we store sizes */
 
-extern spinlock_t dq_data_lock;
-
 /* Size of blocks in which are counted size limits */
 #define QUOTABLOCK_BITS 10
 #define QUOTABLOCK_SIZE (1 << QUOTABLOCK_BITS)
@@ -131,12 +128,48 @@ struct if_dqinfo {
        __u32 dqi_valid;
 };
 
+/*
+ * Definitions for quota netlink interface
+ */
+#define QUOTA_NL_NOWARN 0
+#define QUOTA_NL_IHARDWARN 1           /* Inode hardlimit reached */
+#define QUOTA_NL_ISOFTLONGWARN 2       /* Inode grace time expired */
+#define QUOTA_NL_ISOFTWARN 3           /* Inode softlimit reached */
+#define QUOTA_NL_BHARDWARN 4           /* Block hardlimit reached */
+#define QUOTA_NL_BSOFTLONGWARN 5       /* Block grace time expired */
+#define QUOTA_NL_BSOFTWARN 6           /* Block softlimit reached */
+
+enum {
+       QUOTA_NL_C_UNSPEC,
+       QUOTA_NL_C_WARNING,
+       __QUOTA_NL_C_MAX,
+};
+#define QUOTA_NL_C_MAX (__QUOTA_NL_C_MAX - 1)
+
+enum {
+       QUOTA_NL_A_UNSPEC,
+       QUOTA_NL_A_QTYPE,
+       QUOTA_NL_A_EXCESS_ID,
+       QUOTA_NL_A_WARNING,
+       QUOTA_NL_A_DEV_MAJOR,
+       QUOTA_NL_A_DEV_MINOR,
+       QUOTA_NL_A_CAUSED_ID,
+       __QUOTA_NL_A_MAX,
+};
+#define QUOTA_NL_A_MAX (__QUOTA_NL_A_MAX - 1)
+
+
 #ifdef __KERNEL__
+#include <linux/spinlock.h>
+#include <linux/rwsem.h>
+#include <linux/mutex.h>
 
 #include <linux/dqblk_xfs.h>
 #include <linux/dqblk_v1.h>
 #include <linux/dqblk_v2.h>
 
+extern spinlock_t dq_data_lock;
+
 /* Maximal numbers of writes for quota operation (insert/delete/update)
  * (over VFS all formats) */
 #define DQUOT_INIT_ALLOC max(V1_INIT_ALLOC, V2_INIT_ALLOC)
@@ -208,14 +241,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 */
@@ -285,8 +317,8 @@ 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 mem_dqinfo info[MAXQUOTAS];      /* Information for each quota type */