Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
[pandora-kernel.git] / fs / ocfs2 / ocfs2.h
index 7006aba..1cb814b 100644 (file)
 #include <linux/mutex.h>
 #include <linux/jbd.h>
 
-#include "cluster/nodemanager.h"
-#include "cluster/heartbeat.h"
-#include "cluster/tcp.h"
-
 /* For union ocfs2_dlm_lksb */
 #include "stackglue.h"
 
@@ -102,6 +98,9 @@ enum ocfs2_unlock_action {
                                               * dropped. */
 #define OCFS2_LOCK_QUEUED        (0x00000100) /* queued for downconvert */
 #define OCFS2_LOCK_NOCACHE       (0x00000200) /* don't use a holder count */
+#define OCFS2_LOCK_PENDING       (0x00000400) /* This lockres is pending a
+                                                call to dlm_lock.  Only
+                                                exists with BUSY set. */
 
 struct ocfs2_lock_res_ops;
 
@@ -128,10 +127,23 @@ struct ocfs2_lock_res {
        enum ocfs2_unlock_action l_unlock_action;
        int                      l_requested;
        int                      l_blocking;
+       unsigned int             l_pending_gen;
 
        wait_queue_head_t        l_event;
 
        struct list_head         l_debug_list;
+
+#ifdef CONFIG_OCFS2_FS_STATS
+       unsigned long long       l_lock_num_prmode;        /* PR acquires */
+       unsigned long long       l_lock_num_exmode;        /* EX acquires */
+       unsigned int             l_lock_num_prmode_failed; /* Failed PR gets */
+       unsigned int             l_lock_num_exmode_failed; /* Failed EX gets */
+       unsigned long long       l_lock_total_prmode;      /* Tot wait for PR */
+       unsigned long long       l_lock_total_exmode;      /* Tot wait for EX */
+       unsigned int             l_lock_max_prmode;        /* Max wait for PR */
+       unsigned int             l_lock_max_exmode;        /* Max wait for EX */
+       unsigned int             l_lock_refresh;           /* Disk refreshes */
+#endif
 };
 
 struct ocfs2_dlm_debug {
@@ -208,11 +220,14 @@ struct ocfs2_super
        u32 s_feature_incompat;
        u32 s_feature_ro_compat;
 
-       /* Protects s_next_generaion, osb_flags. Could protect more on
-        * osb as it's very short lived. */
+       /* Protects s_next_generation, osb_flags and s_inode_steal_slot.
+        * Could protect more on osb as it's very short lived.
+        */
        spinlock_t osb_lock;
        u32 s_next_generation;
        unsigned long osb_flags;
+       s16 s_inode_steal_slot;
+       atomic_t s_num_inodes_stolen;
 
        unsigned long s_mount_opt;
        unsigned int s_atime_quantum;
@@ -248,6 +263,7 @@ struct ocfs2_super
        struct ocfs2_alloc_stats alloc_stats;
        char dev_str[20];               /* "major,minor" of the device */
 
+       char osb_cluster_stack[OCFS2_STACK_LABEL_LEN + 1];
        struct ocfs2_cluster_connection *cconn;
        struct ocfs2_lock_res osb_super_lockres;
        struct ocfs2_lock_res osb_rename_lockres;
@@ -368,6 +384,12 @@ static inline int ocfs2_is_soft_readonly(struct ocfs2_super *osb)
        return ret;
 }
 
+static inline int ocfs2_userspace_stack(struct ocfs2_super *osb)
+{
+       return (osb->s_feature_incompat &
+               OCFS2_FEATURE_INCOMPAT_USERSPACE_STACK);
+}
+
 static inline int ocfs2_mount_local(struct ocfs2_super *osb)
 {
        return (osb->s_feature_incompat & OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT);
@@ -530,6 +552,33 @@ static inline unsigned int ocfs2_pages_per_cluster(struct super_block *sb)
        return pages_per_cluster;
 }
 
+static inline void ocfs2_init_inode_steal_slot(struct ocfs2_super *osb)
+{
+       spin_lock(&osb->osb_lock);
+       osb->s_inode_steal_slot = OCFS2_INVALID_SLOT;
+       spin_unlock(&osb->osb_lock);
+       atomic_set(&osb->s_num_inodes_stolen, 0);
+}
+
+static inline void ocfs2_set_inode_steal_slot(struct ocfs2_super *osb,
+                                             s16 slot)
+{
+       spin_lock(&osb->osb_lock);
+       osb->s_inode_steal_slot = slot;
+       spin_unlock(&osb->osb_lock);
+}
+
+static inline s16 ocfs2_get_inode_steal_slot(struct ocfs2_super *osb)
+{
+       s16 slot;
+
+       spin_lock(&osb->osb_lock);
+       slot = osb->s_inode_steal_slot;
+       spin_unlock(&osb->osb_lock);
+
+       return slot;
+}
+
 #define ocfs2_set_bit ext2_set_bit
 #define ocfs2_clear_bit ext2_clear_bit
 #define ocfs2_test_bit ext2_test_bit