GFS2: Improve statfs and quota usability
[safe/jmp/linux-2.6] / fs / gfs2 / incore.h
index 3f29bd2..c239b0f 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <linux/fs.h>
 #include <linux/workqueue.h>
+#include <linux/slow-work.h>
 #include <linux/dlm.h>
 #include <linux/buffer_head.h>
 
@@ -63,9 +64,12 @@ struct gfs2_log_element {
        const struct gfs2_log_operations *le_ops;
 };
 
+#define GBF_FULL 1
+
 struct gfs2_bitmap {
        struct buffer_head *bi_bh;
        char *bi_clone;
+       unsigned long bi_flags;
        u32 bi_offset;
        u32 bi_start;
        u32 bi_len;
@@ -90,10 +94,11 @@ struct gfs2_rgrpd {
        struct gfs2_sbd *rd_sbd;
        unsigned int rd_bh_count;
        u32 rd_last_alloc;
-       unsigned char rd_flags;
-#define GFS2_RDF_CHECK        0x01      /* Need to check for unlinked inodes */
-#define GFS2_RDF_NOALLOC      0x02      /* rg prohibits allocation */
-#define GFS2_RDF_UPTODATE     0x04      /* rg is up to date */
+       u32 rd_flags;
+#define GFS2_RDF_CHECK         0x10000000 /* check for unlinked inodes */
+#define GFS2_RDF_UPTODATE      0x20000000 /* rg is up to date */
+#define GFS2_RDF_ERROR         0x40000000 /* error in rg */
+#define GFS2_RDF_MASK          0xf0000000 /* mask for internal flags */
 };
 
 enum gfs2_state_bits {
@@ -154,6 +159,7 @@ struct gfs2_glock_operations {
        int (*go_lock) (struct gfs2_holder *gh);
        void (*go_unlock) (struct gfs2_holder *gh);
        int (*go_dump)(struct seq_file *seq, const struct gfs2_glock *gl);
+       void (*go_callback) (struct gfs2_glock *gl);
        const int go_type;
        const unsigned long go_min_hold_time;
 };
@@ -203,6 +209,7 @@ struct gfs2_glock {
        unsigned int gl_target;
        unsigned int gl_reply;
        unsigned int gl_hash;
+       unsigned int gl_req;
        unsigned int gl_demote_state; /* state requested by remote node */
        unsigned long gl_demote_time; /* time of first demote request */
        struct list_head gl_holders;
@@ -222,6 +229,7 @@ struct gfs2_glock {
        struct list_head gl_ail_list;
        atomic_t gl_ail_count;
        struct delayed_work gl_work;
+       struct work_struct gl_delete;
 };
 
 #define GFS2_MIN_LVB_SIZE 32   /* Min size of LVB that gfs2 supports */
@@ -375,11 +383,11 @@ struct gfs2_journal_extent {
 struct gfs2_jdesc {
        struct list_head jd_list;
        struct list_head extent_list;
-
+       struct slow_work jd_work;
        struct inode *jd_inode;
+       unsigned long jd_flags;
+#define JDF_RECOVERY 1
        unsigned int jd_jid;
-       int jd_dirty;
-
        unsigned int jd_blocks;
 };
 
@@ -389,9 +397,6 @@ struct gfs2_statfs_change_host {
        s64 sc_dinodes;
 };
 
-#define GFS2_GLOCKD_DEFAULT    1
-#define GFS2_GLOCKD_MAX                16
-
 #define GFS2_QUOTA_DEFAULT     GFS2_QUOTA_OFF
 #define GFS2_QUOTA_OFF         0
 #define GFS2_QUOTA_ACCOUNT     1
@@ -401,6 +406,12 @@ struct gfs2_statfs_change_host {
 #define GFS2_DATA_WRITEBACK    1
 #define GFS2_DATA_ORDERED      2
 
+#define GFS2_ERRORS_DEFAULT     GFS2_ERRORS_WITHDRAW
+#define GFS2_ERRORS_WITHDRAW    0
+#define GFS2_ERRORS_CONTINUE    1 /* place holder for future feature */
+#define GFS2_ERRORS_RO          2 /* place holder for future feature */
+#define GFS2_ERRORS_PANIC       3
+
 struct gfs2_args {
        char ar_lockproto[GFS2_LOCKNAME_LEN];   /* Name of the Lock Protocol */
        char ar_locktable[GFS2_LOCKNAME_LEN];   /* Name of the Lock Table */
@@ -417,6 +428,11 @@ struct gfs2_args {
        unsigned int ar_data:2;                 /* ordered/writeback */
        unsigned int ar_meta:1;                 /* mount metafs */
        unsigned int ar_discard:1;              /* discard requests */
+       unsigned int ar_errors:2;               /* errors=withdraw | panic */
+       int ar_commit;                          /* Commit interval */
+       int ar_statfs_quantum;                  /* The fast statfs interval */
+       int ar_quota_quantum;                   /* The quota interval */
+       int ar_statfs_percent;                  /* The % change to force sync */
 };
 
 struct gfs2_tune {
@@ -425,7 +441,6 @@ struct gfs2_tune {
        unsigned int gt_incore_log_blocks;
        unsigned int gt_log_flush_secs;
 
-       unsigned int gt_recoverd_secs;
        unsigned int gt_logd_secs;
 
        unsigned int gt_quota_simul_sync; /* Max quotavals to sync at once */
@@ -446,6 +461,7 @@ enum {
        SDF_JOURNAL_LIVE        = 1,
        SDF_SHUTDOWN            = 2,
        SDF_NOBARRIERS          = 3,
+       SDF_NORECOVERY          = 4,
 };
 
 #define GFS2_FSNAME_LEN                256
@@ -470,6 +486,7 @@ struct gfs2_sb_host {
 
        char sb_lockproto[GFS2_LOCKNAME_LEN];
        char sb_locktable[GFS2_LOCKNAME_LEN];
+       u8 sb_uuid[16];
 };
 
 /*
@@ -482,7 +499,6 @@ struct gfs2_sb_host {
  */
 
 struct lm_lockstruct {
-       u32 ls_id;
        unsigned int ls_jid;
        unsigned int ls_first;
        unsigned int ls_first_done;
@@ -491,7 +507,6 @@ struct lm_lockstruct {
        unsigned long ls_flags;
        dlm_lockspace_t *ls_dlm;
 
-       int ls_recover_jid;
        int ls_recover_jid_done;
        int ls_recover_jid_status;
 };
@@ -535,23 +550,18 @@ struct gfs2_sbd {
        struct dentry *sd_root_dir;
 
        struct inode *sd_jindex;
-       struct inode *sd_inum_inode;
        struct inode *sd_statfs_inode;
-       struct inode *sd_ir_inode;
        struct inode *sd_sc_inode;
        struct inode *sd_qc_inode;
        struct inode *sd_rindex;
        struct inode *sd_quota_inode;
 
-       /* Inum stuff */
-
-       struct mutex sd_inum_mutex;
-
        /* StatFS stuff */
 
        spinlock_t sd_statfs_spin;
        struct gfs2_statfs_change_host sd_statfs_master;
        struct gfs2_statfs_change_host sd_statfs_local;
+       int sd_statfs_force_sync;
 
        /* Resource group stuff */
 
@@ -574,13 +584,11 @@ struct gfs2_sbd {
        struct gfs2_holder sd_journal_gh;
        struct gfs2_holder sd_jinode_gh;
 
-       struct gfs2_holder sd_ir_gh;
        struct gfs2_holder sd_sc_gh;
        struct gfs2_holder sd_qc_gh;
 
        /* Daemon stuff */
 
-       struct task_struct *sd_recoverd_process;
        struct task_struct *sd_logd_process;
        struct task_struct *sd_quotad_process;