]> err.no Git - linux-2.6/blobdiff - fs/gfs2/incore.h
[GFS2] Allow mounting of gfs2 and gfs2meta at the same time
[linux-2.6] / fs / gfs2 / incore.h
index fc4a983e3c8936eb84a639a4dd6a9ec8ef74087f..77f0903d2f3ebbf7511b976c85953fc7ec45535e 100644 (file)
@@ -33,7 +33,6 @@ struct gfs2_inode;
 struct gfs2_file;
 struct gfs2_revoke;
 struct gfs2_revoke_replay;
-struct gfs2_unlinked;
 struct gfs2_quota_data;
 struct gfs2_log_buf;
 struct gfs2_trans;
@@ -183,6 +182,8 @@ struct gfs2_glock {
        spinlock_t gl_spin;
 
        unsigned int gl_state;
+       struct task_struct *gl_owner;
+       unsigned long gl_ip;
        struct list_head gl_holders;
        struct list_head gl_waiters1;   /* HIF_MUTEX */
        struct list_head gl_waiters2;   /* HIF_DEMOTE, HIF_GREEDY */
@@ -215,47 +216,39 @@ struct gfs2_glock {
 struct gfs2_alloc {
        /* Quota stuff */
 
-       unsigned int al_qd_num;
        struct gfs2_quota_data *al_qd[4];
        struct gfs2_holder al_qd_ghs[4];
+       unsigned int al_qd_num;
 
-       /* Filled in by the caller to gfs2_inplace_reserve() */
-
-       uint32_t al_requested;
+       u32 al_requested; /* Filled in by caller of gfs2_inplace_reserve() */
+       u32 al_alloced; /* Filled in by gfs2_alloc_*() */
 
        /* Filled in by gfs2_inplace_reserve() */
 
-       char *al_file;
        unsigned int al_line;
+       char *al_file;
        struct gfs2_holder al_ri_gh;
        struct gfs2_holder al_rgd_gh;
        struct gfs2_rgrpd *al_rgd;
 
-       /* Filled in by gfs2_alloc_*() */
-
-       uint32_t al_alloced;
 };
 
 enum {
-       GIF_MIN_INIT            = 0,
        GIF_QD_LOCKED           = 1,
        GIF_PAGED               = 2,
        GIF_SW_PAGED            = 3,
 };
 
 struct gfs2_inode {
+       struct inode i_inode;
        struct gfs2_inum i_num;
 
-       atomic_t i_count;
        unsigned long i_flags;          /* GIF_... */
 
        uint64_t i_vn;
-       struct gfs2_dinode i_di;
-
-       struct gfs2_glock *i_gl;
-       struct gfs2_sbd *i_sbd;
-       struct inode *i_vnode;
+       struct gfs2_dinode i_di; /* To be replaced by ref to block */
 
+       struct gfs2_glock *i_gl; /* Move into i_gh? */
        struct gfs2_holder i_iopen_gh;
        struct gfs2_holder i_gh; /* for prepare/commit_write only */
        struct gfs2_alloc i_alloc;
@@ -263,15 +256,30 @@ struct gfs2_inode {
 
        spinlock_t i_spin;
        struct rw_semaphore i_rw_mutex;
-
        unsigned int i_greedy;
        unsigned long i_last_pfault;
 
        struct buffer_head *i_cache[GFS2_MAX_META_HEIGHT];
 };
 
+/*
+ * Since i_inode is the first element of struct gfs2_inode,
+ * this is effectively a cast.
+ */
+static inline struct gfs2_inode *GFS2_I(struct inode *inode)
+{
+       return container_of(inode, struct gfs2_inode, i_inode);
+}
+
+/* To be removed? */
+static inline struct gfs2_sbd *GFS2_SB(struct inode *inode)
+{
+       return inode->i_sb->s_fs_info;
+}
+
 enum {
        GFF_DID_DIRECT_ALLOC    = 0,
+       GFF_EXLOCK = 1,
 };
 
 struct gfs2_file {
@@ -291,18 +299,6 @@ struct gfs2_revoke_replay {
        unsigned int rr_where;
 };
 
-enum {
-       ULF_LOCKED              = 0,
-};
-
-struct gfs2_unlinked {
-       struct list_head ul_list;
-       unsigned int ul_count;
-       struct gfs2_unlinked_tag ul_ut;
-       unsigned long ul_flags;         /* ULF_... */
-       unsigned int ul_slot;
-};
-
 enum {
        QDF_USER                = 0,
        QDF_CHANGE              = 1,
@@ -432,7 +428,6 @@ struct gfs2_tune {
        unsigned int gt_recoverd_secs;
        unsigned int gt_logd_secs;
        unsigned int gt_quotad_secs;
-       unsigned int gt_inoded_secs;
 
        unsigned int gt_quota_simul_sync; /* Max quotavals to sync at once */
        unsigned int gt_quota_warn_period; /* Secs between quota warn msgs */
@@ -477,6 +472,7 @@ enum {
 
 struct gfs2_sbd {
        struct super_block *sd_vfs;
+       struct super_block *sd_vfs_meta;
        struct kobject sd_kobj;
        unsigned long sd_flags; /* SDF_... */
        struct gfs2_sb sd_sb;
@@ -491,7 +487,6 @@ struct gfs2_sbd {
        uint32_t sd_hash_bsize; /* sizeof(exhash block) */
        uint32_t sd_hash_bsize_shift;
        uint32_t sd_hash_ptrs;  /* Number of pointers in a hash block */
-       uint32_t sd_ut_per_block;
        uint32_t sd_qc_per_block;
        uint32_t sd_max_dirres; /* Max blocks needed to add a directory entry */
        uint32_t sd_max_height; /* Max height of a file's metadata tree */
@@ -513,7 +508,6 @@ struct gfs2_sbd {
        struct gfs2_holder sd_live_gh;
        struct gfs2_glock *sd_rename_gl;
        struct gfs2_glock *sd_trans_gl;
-       struct mutex sd_invalidate_inodes_mutex;
 
        /* Inode Stuff */
 
@@ -523,7 +517,6 @@ struct gfs2_sbd {
        struct inode *sd_statfs_inode;
        struct inode *sd_ir_inode;
        struct inode *sd_sc_inode;
-       struct inode *sd_ut_inode;
        struct inode *sd_qc_inode;
        struct inode *sd_rindex;
        struct inode *sd_quota_inode;
@@ -565,7 +558,6 @@ struct gfs2_sbd {
 
        struct gfs2_holder sd_ir_gh;
        struct gfs2_holder sd_sc_gh;
-       struct gfs2_holder sd_ut_gh;
        struct gfs2_holder sd_qc_gh;
 
        /* Daemon stuff */
@@ -574,21 +566,9 @@ struct gfs2_sbd {
        struct task_struct *sd_recoverd_process;
        struct task_struct *sd_logd_process;
        struct task_struct *sd_quotad_process;
-       struct task_struct *sd_inoded_process;
        struct task_struct *sd_glockd_process[GFS2_GLOCKD_MAX];
        unsigned int sd_glockd_num;
 
-       /* Unlinked inode stuff */
-
-       struct list_head sd_unlinked_list;
-       atomic_t sd_unlinked_count;
-       spinlock_t sd_unlinked_spin;
-       struct mutex sd_unlinked_mutex;
-
-       unsigned int sd_unlinked_slots;
-       unsigned int sd_unlinked_chunks;
-       unsigned char **sd_unlinked_bitmap;
-
        /* Quota stuff */
 
        struct list_head sd_quota_list;
@@ -673,6 +653,7 @@ struct gfs2_sbd {
        /* Debugging crud */
 
        unsigned long sd_last_warning;
+       struct vfsmount *sd_gfs2mnt;
 };
 
 #endif /* __INCORE_DOT_H__ */