ocfs2: Morph the haphazard OCFS2_IS_VALID_DINODE() checks.
[safe/jmp/linux-2.6] / fs / ocfs2 / ocfs2.h
index 4d6e200..467bdb6 100644 (file)
 #include <linux/workqueue.h>
 #include <linux/kref.h>
 #include <linux/mutex.h>
-#include <linux/jbd.h>
+#ifndef CONFIG_OCFS2_COMPAT_JBD
+# include <linux/jbd2.h>
+#else
+# include <linux/jbd.h>
+# include "ocfs2_jbd_compat.h"
+#endif
 
 /* For union ocfs2_dlm_lksb */
 #include "stackglue.h"
@@ -80,7 +85,7 @@ enum ocfs2_unlock_action {
 };
 
 /* ocfs2_lock_res->l_flags flags. */
-#define OCFS2_LOCK_ATTACHED      (0x00000001) /* have we initialized
+#define OCFS2_LOCK_ATTACHED      (0x00000001) /* we have initialized
                                               * the lvb */
 #define OCFS2_LOCK_BUSY          (0x00000002) /* we are currently in
                                               * dlm_lock */
@@ -188,6 +193,9 @@ enum ocfs2_mount_options
        OCFS2_MOUNT_ERRORS_PANIC = 1 << 3, /* Panic on errors */
        OCFS2_MOUNT_DATA_WRITEBACK = 1 << 4, /* No data ordering */
        OCFS2_MOUNT_LOCALFLOCKS = 1 << 5, /* No cluster aware user file locks */
+       OCFS2_MOUNT_NOUSERXATTR = 1 << 6, /* No user xattr */
+       OCFS2_MOUNT_INODE64 = 1 << 7,   /* Allow inode numbers > 2^32 */
+       OCFS2_MOUNT_POSIX_ACL = 1 << 8, /* POSIX access control lists */
 };
 
 #define OCFS2_OSB_SOFT_RO      0x0001
@@ -218,6 +226,7 @@ struct ocfs2_super
        u32 bitmap_cpg;
        u8 *uuid;
        char *uuid_str;
+       u32 uuid_hash;
        u8 *vol_label;
        u64 first_cluster_group_blkno;
        u32 fs_generation;
@@ -245,6 +254,7 @@ struct ocfs2_super
        int s_sectsize_bits;
        int s_clustersize;
        int s_clustersize_bits;
+       unsigned int s_xattr_inline_size;
 
        atomic_t vol_state;
        struct mutex recovery_lock;
@@ -272,6 +282,11 @@ struct ocfs2_super
 
        u64 la_last_gd;
 
+#ifdef CONFIG_OCFS2_FS_STATS
+       struct dentry *local_alloc_debug;
+       char *local_alloc_debug_buf;
+#endif
+
        /* Next two fields are for local node slot recovery during
         * mount. */
        int dirty;
@@ -355,6 +370,13 @@ static inline int ocfs2_supports_inline_data(struct ocfs2_super *osb)
        return 0;
 }
 
+static inline int ocfs2_supports_xattr(struct ocfs2_super *osb)
+{
+       if (osb->s_feature_incompat & OCFS2_FEATURE_INCOMPAT_XATTR)
+               return 1;
+       return 0;
+}
+
 /* set / clear functions because cluster events can make these happen
  * in parallel so we want the transitions to be atomic. this also
  * means that any future flags osb_flags must be protected by spinlock
@@ -422,14 +444,6 @@ static inline int ocfs2_uses_extended_slot_map(struct ocfs2_super *osb)
 #define OCFS2_IS_VALID_DINODE(ptr)                                     \
        (!strcmp((ptr)->i_signature, OCFS2_INODE_SIGNATURE))
 
-#define OCFS2_RO_ON_INVALID_DINODE(__sb, __di) do {                    \
-       typeof(__di) ____di = (__di);                                   \
-       ocfs2_error((__sb),                                             \
-               "Dinode # %llu has bad signature %.*s",                 \
-               (unsigned long long)le64_to_cpu((____di)->i_blkno), 7,  \
-               (____di)->i_signature);                                 \
-} while (0)
-
 #define OCFS2_IS_VALID_EXTENT_BLOCK(ptr)                               \
        (!strcmp((ptr)->h_signature, OCFS2_EXTENT_BLOCK_SIGNATURE))
 
@@ -452,6 +466,9 @@ static inline int ocfs2_uses_extended_slot_map(struct ocfs2_super *osb)
                (____gd)->bg_signature);                                \
 } while (0)
 
+#define OCFS2_IS_VALID_XATTR_BLOCK(ptr)                                        \
+       (!strcmp((ptr)->xb_signature, OCFS2_XATTR_BLOCK_SIGNATURE))
+
 static inline unsigned long ino_from_blkno(struct super_block *sb,
                                           u64 blkno)
 {