]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ocfs2/ocfs2_fs.h
Make initcall_debug a core_param
[linux-2.6-omap-h63xx.git] / fs / ocfs2 / ocfs2_fs.h
index 98e1f8bba0e105d7a16331fa2c1b15da88ace6bc..f24ce3d3f956056c2a1173dd8121076cea3eb079 100644 (file)
@@ -91,7 +91,8 @@
                                         | OCFS2_FEATURE_INCOMPAT_SPARSE_ALLOC \
                                         | OCFS2_FEATURE_INCOMPAT_INLINE_DATA \
                                         | OCFS2_FEATURE_INCOMPAT_EXTENDED_SLOT_MAP \
-                                        | OCFS2_FEATURE_INCOMPAT_USERSPACE_STACK)
+                                        | OCFS2_FEATURE_INCOMPAT_USERSPACE_STACK \
+                                        | OCFS2_FEATURE_INCOMPAT_XATTR)
 #define OCFS2_FEATURE_RO_COMPAT_SUPP   OCFS2_FEATURE_RO_COMPAT_UNWRITTEN
 
 /*
 /* Support for data packed into inode blocks */
 #define OCFS2_FEATURE_INCOMPAT_INLINE_DATA     0x0040
 
-/* Support for the extended slot map */
-#define OCFS2_FEATURE_INCOMPAT_EXTENDED_SLOT_MAP 0x100
-
-
 /*
  * Support for alternate, userspace cluster stacks.  If set, the superblock
  * field s_cluster_info contains a tag for the alternate stack in use as
  */
 #define OCFS2_FEATURE_INCOMPAT_USERSPACE_STACK 0x0080
 
+/* Support for the extended slot map */
+#define OCFS2_FEATURE_INCOMPAT_EXTENDED_SLOT_MAP 0x100
+
+/* Support for extended attributes */
+#define OCFS2_FEATURE_INCOMPAT_XATTR           0x0200
+
 /*
  * backup superblock flag is used to indicate that this volume
  * has backup superblocks.
@@ -578,7 +581,11 @@ struct ocfs2_super_block {
 /*A0*/  struct ocfs2_cluster_info s_cluster_info; /* Selected userspace
                                                     stack.  Only valid
                                                     with INCOMPAT flag. */
-/*B8*/  __le64 s_reserved2[17];                /* Fill out superblock */
+/*B8*/ __le16 s_xattr_inline_size;     /* extended attribute inline size
+                                          for this fs*/
+       __le16 s_reserved0;
+       __le32 s_reserved1;
+/*C0*/  __le64 s_reserved2[16];                /* Fill out superblock */
 /*140*/
 
        /*
@@ -755,8 +762,13 @@ struct ocfs2_xattr_header {
        __le16  xh_count;                       /* contains the count of how
                                                   many records are in the
                                                   local xattr storage. */
-       __le16  xh_reserved1;
-       __le32  xh_reserved2;
+       __le16  xh_free_start;                  /* current offset for storing
+                                                  xattr. */
+       __le16  xh_name_value_len;              /* total length of name/value
+                                                  length in this bucket. */
+       __le16  xh_num_buckets;                 /* bucket nums in one extent
+                                                  record, only valid in the
+                                                  first bucket. */
        __le64  xh_csum;
        struct ocfs2_xattr_entry xh_entries[0]; /* xattr entry list. */
 };
@@ -793,6 +805,10 @@ struct ocfs2_xattr_tree_root {
 #define OCFS2_XATTR_SIZE(size) (((size) + OCFS2_XATTR_ROUND) & \
                                ~(OCFS2_XATTR_ROUND))
 
+#define OCFS2_XATTR_BUCKET_SIZE                        4096
+#define OCFS2_XATTR_MAX_BLOCKS_PER_BUCKET      (OCFS2_XATTR_BUCKET_SIZE \
+                                                / OCFS2_MIN_BLOCKSIZE)
+
 /*
  * On disk structure for xattr block.
  */
@@ -963,6 +979,17 @@ static inline u64 ocfs2_backup_super_blkno(struct super_block *sb, int index)
        return 0;
 
 }
+
+static inline u16 ocfs2_xattr_recs_per_xb(struct super_block *sb)
+{
+       int size;
+
+       size = sb->s_blocksize -
+               offsetof(struct ocfs2_xattr_block,
+                        xb_attrs.xb_root.xt_list.l_recs);
+
+       return size / sizeof(struct ocfs2_extent_rec);
+}
 #else
 static inline int ocfs2_fast_symlink_chars(int blocksize)
 {
@@ -1046,6 +1073,17 @@ static inline uint64_t ocfs2_backup_super_blkno(int blocksize, int index)
 
        return 0;
 }
+
+static inline int ocfs2_xattr_recs_per_xb(int blocksize)
+{
+       int size;
+
+       size = blocksize -
+               offsetof(struct ocfs2_xattr_block,
+                        xb_attrs.xb_root.xt_list.l_recs);
+
+       return size / sizeof(struct ocfs2_extent_rec);
+}
 #endif  /* __KERNEL__ */