aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir2_data.h
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-23 23:44:19 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-23 23:44:19 -0500
commit1ebbe2b20091d306453a5cf480a87e6cd28ae76f (patch)
treef5cd7a0fa69b8b1938cb5a0faed2e7b0628072a5 /fs/xfs/xfs_dir2_data.h
parentac58c9059da8886b5e8cde012a80266b18ca146e (diff)
parent674a396c6d2ba0341ebdd7c1c9950f32f018e2dd (diff)
Merge branch 'linus'
Diffstat (limited to 'fs/xfs/xfs_dir2_data.h')
-rw-r--r--fs/xfs/xfs_dir2_data.h26
1 files changed, 12 insertions, 14 deletions
diff --git a/fs/xfs/xfs_dir2_data.h b/fs/xfs/xfs_dir2_data.h
index 5e3a7f9ec735..0847cbb53e17 100644
--- a/fs/xfs/xfs_dir2_data.h
+++ b/fs/xfs/xfs_dir2_data.h
@@ -65,8 +65,8 @@ struct xfs_trans;
65 * The freespace will be formatted as a xfs_dir2_data_unused_t. 65 * The freespace will be formatted as a xfs_dir2_data_unused_t.
66 */ 66 */
67typedef struct xfs_dir2_data_free { 67typedef struct xfs_dir2_data_free {
68 xfs_dir2_data_off_t offset; /* start of freespace */ 68 __be16 offset; /* start of freespace */
69 xfs_dir2_data_off_t length; /* length of freespace */ 69 __be16 length; /* length of freespace */
70} xfs_dir2_data_free_t; 70} xfs_dir2_data_free_t;
71 71
72/* 72/*
@@ -75,7 +75,7 @@ typedef struct xfs_dir2_data_free {
75 * The code knows that XFS_DIR2_DATA_FD_COUNT is 3. 75 * The code knows that XFS_DIR2_DATA_FD_COUNT is 3.
76 */ 76 */
77typedef struct xfs_dir2_data_hdr { 77typedef struct xfs_dir2_data_hdr {
78 __uint32_t magic; /* XFS_DIR2_DATA_MAGIC */ 78 __be32 magic; /* XFS_DIR2_DATA_MAGIC */
79 /* or XFS_DIR2_BLOCK_MAGIC */ 79 /* or XFS_DIR2_BLOCK_MAGIC */
80 xfs_dir2_data_free_t bestfree[XFS_DIR2_DATA_FD_COUNT]; 80 xfs_dir2_data_free_t bestfree[XFS_DIR2_DATA_FD_COUNT];
81} xfs_dir2_data_hdr_t; 81} xfs_dir2_data_hdr_t;
@@ -97,10 +97,10 @@ typedef struct xfs_dir2_data_entry {
97 * Tag appears as the last 2 bytes. 97 * Tag appears as the last 2 bytes.
98 */ 98 */
99typedef struct xfs_dir2_data_unused { 99typedef struct xfs_dir2_data_unused {
100 __uint16_t freetag; /* XFS_DIR2_DATA_FREE_TAG */ 100 __be16 freetag; /* XFS_DIR2_DATA_FREE_TAG */
101 xfs_dir2_data_off_t length; /* total free length */ 101 __be16 length; /* total free length */
102 /* variable offset */ 102 /* variable offset */
103 xfs_dir2_data_off_t tag; /* starting offset of us */ 103 __be16 tag; /* starting offset of us */
104} xfs_dir2_data_unused_t; 104} xfs_dir2_data_unused_t;
105 105
106typedef union { 106typedef union {
@@ -134,12 +134,11 @@ static inline int xfs_dir2_data_entsize(int n)
134 * Pointer to an entry's tag word. 134 * Pointer to an entry's tag word.
135 */ 135 */
136#define XFS_DIR2_DATA_ENTRY_TAG_P(dep) xfs_dir2_data_entry_tag_p(dep) 136#define XFS_DIR2_DATA_ENTRY_TAG_P(dep) xfs_dir2_data_entry_tag_p(dep)
137static inline xfs_dir2_data_off_t * 137static inline __be16 *
138xfs_dir2_data_entry_tag_p(xfs_dir2_data_entry_t *dep) 138xfs_dir2_data_entry_tag_p(xfs_dir2_data_entry_t *dep)
139{ 139{
140 return (xfs_dir2_data_off_t *) \ 140 return (__be16 *)((char *)dep +
141 ((char *)(dep) + XFS_DIR2_DATA_ENTSIZE((dep)->namelen) - \ 141 XFS_DIR2_DATA_ENTSIZE(dep->namelen) - sizeof(__be16));
142 (uint)sizeof(xfs_dir2_data_off_t));
143} 142}
144 143
145/* 144/*
@@ -147,12 +146,11 @@ xfs_dir2_data_entry_tag_p(xfs_dir2_data_entry_t *dep)
147 */ 146 */
148#define XFS_DIR2_DATA_UNUSED_TAG_P(dup) \ 147#define XFS_DIR2_DATA_UNUSED_TAG_P(dup) \
149 xfs_dir2_data_unused_tag_p(dup) 148 xfs_dir2_data_unused_tag_p(dup)
150static inline xfs_dir2_data_off_t * 149static inline __be16 *
151xfs_dir2_data_unused_tag_p(xfs_dir2_data_unused_t *dup) 150xfs_dir2_data_unused_tag_p(xfs_dir2_data_unused_t *dup)
152{ 151{
153 return (xfs_dir2_data_off_t *) \ 152 return (__be16 *)((char *)dup +
154 ((char *)(dup) + INT_GET((dup)->length, ARCH_CONVERT) \ 153 be16_to_cpu(dup->length) - sizeof(__be16));
155 - (uint)sizeof(xfs_dir2_data_off_t));
156} 154}
157 155
158/* 156/*