aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2006-06-09 00:48:37 -0400
committerNathan Scott <nathans@sgi.com>2006-06-09 00:48:37 -0400
commitff9901c1e7c7be06a99c59cfc3133d2316cbc957 (patch)
treed9cae983cf713d07ff65566e56beca52c21412d1 /fs
parent3e57ecf640428c01ba1ed8c8fc538447ada1715b (diff)
[XFS] endianess annotations for xfs_dir2_data_entry_t
SGI-PV: 943272 SGI-Modid: xfs-linux-melb:xfs-kern:25806a Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/xfs_dir2_block.c16
-rw-r--r--fs/xfs/xfs_dir2_data.c2
-rw-r--r--fs/xfs/xfs_dir2_data.h8
-rw-r--r--fs/xfs/xfs_dir2_leaf.c10
-rw-r--r--fs/xfs/xfs_dir2_node.c8
-rw-r--r--fs/xfs/xfs_dir2_sf.c10
6 files changed, 27 insertions, 27 deletions
diff --git a/fs/xfs/xfs_dir2_block.c b/fs/xfs/xfs_dir2_block.c
index 972ded595476..2621ff521dbd 100644
--- a/fs/xfs/xfs_dir2_block.c
+++ b/fs/xfs/xfs_dir2_block.c
@@ -400,7 +400,7 @@ xfs_dir2_block_addname(
400 /* 400 /*
401 * Create the new data entry. 401 * Create the new data entry.
402 */ 402 */
403 INT_SET(dep->inumber, ARCH_CONVERT, args->inumber); 403 dep->inumber = cpu_to_be64(args->inumber);
404 dep->namelen = args->namelen; 404 dep->namelen = args->namelen;
405 memcpy(dep->name, args->name, args->namelen); 405 memcpy(dep->name, args->name, args->namelen);
406 tagp = XFS_DIR2_DATA_ENTRY_TAG_P(dep); 406 tagp = XFS_DIR2_DATA_ENTRY_TAG_P(dep);
@@ -508,7 +508,7 @@ xfs_dir2_block_getdents(
508 508
509 p.cook = XFS_DIR2_DB_OFF_TO_DATAPTR(mp, mp->m_dirdatablk, 509 p.cook = XFS_DIR2_DB_OFF_TO_DATAPTR(mp, mp->m_dirdatablk,
510 ptr - (char *)block); 510 ptr - (char *)block);
511 p.ino = INT_GET(dep->inumber, ARCH_CONVERT); 511 p.ino = be64_to_cpu(dep->inumber);
512#if XFS_BIG_INUMS 512#if XFS_BIG_INUMS
513 p.ino += mp->m_inoadd; 513 p.ino += mp->m_inoadd;
514#endif 514#endif
@@ -626,7 +626,7 @@ xfs_dir2_block_lookup(
626 /* 626 /*
627 * Fill in inode number, release the block. 627 * Fill in inode number, release the block.
628 */ 628 */
629 args->inumber = INT_GET(dep->inumber, ARCH_CONVERT); 629 args->inumber = be64_to_cpu(dep->inumber);
630 xfs_da_brelse(args->trans, bp); 630 xfs_da_brelse(args->trans, bp);
631 return XFS_ERROR(EEXIST); 631 return XFS_ERROR(EEXIST);
632} 632}
@@ -844,11 +844,11 @@ xfs_dir2_block_replace(
844 */ 844 */
845 dep = (xfs_dir2_data_entry_t *) 845 dep = (xfs_dir2_data_entry_t *)
846 ((char *)block + XFS_DIR2_DATAPTR_TO_OFF(mp, be32_to_cpu(blp[ent].address))); 846 ((char *)block + XFS_DIR2_DATAPTR_TO_OFF(mp, be32_to_cpu(blp[ent].address)));
847 ASSERT(INT_GET(dep->inumber, ARCH_CONVERT) != args->inumber); 847 ASSERT(be64_to_cpu(dep->inumber) != args->inumber);
848 /* 848 /*
849 * Change the inode number to the new value. 849 * Change the inode number to the new value.
850 */ 850 */
851 INT_SET(dep->inumber, ARCH_CONVERT, args->inumber); 851 dep->inumber = cpu_to_be64(args->inumber);
852 xfs_dir2_data_log_entry(args->trans, bp, dep); 852 xfs_dir2_data_log_entry(args->trans, bp, dep);
853 xfs_dir2_data_check(dp, bp); 853 xfs_dir2_data_check(dp, bp);
854 xfs_da_buf_done(bp); 854 xfs_da_buf_done(bp);
@@ -1130,7 +1130,7 @@ xfs_dir2_sf_to_block(
1130 */ 1130 */
1131 dep = (xfs_dir2_data_entry_t *) 1131 dep = (xfs_dir2_data_entry_t *)
1132 ((char *)block + XFS_DIR2_DATA_DOT_OFFSET); 1132 ((char *)block + XFS_DIR2_DATA_DOT_OFFSET);
1133 INT_SET(dep->inumber, ARCH_CONVERT, dp->i_ino); 1133 dep->inumber = cpu_to_be64(dp->i_ino);
1134 dep->namelen = 1; 1134 dep->namelen = 1;
1135 dep->name[0] = '.'; 1135 dep->name[0] = '.';
1136 tagp = XFS_DIR2_DATA_ENTRY_TAG_P(dep); 1136 tagp = XFS_DIR2_DATA_ENTRY_TAG_P(dep);
@@ -1144,7 +1144,7 @@ xfs_dir2_sf_to_block(
1144 */ 1144 */
1145 dep = (xfs_dir2_data_entry_t *) 1145 dep = (xfs_dir2_data_entry_t *)
1146 ((char *)block + XFS_DIR2_DATA_DOTDOT_OFFSET); 1146 ((char *)block + XFS_DIR2_DATA_DOTDOT_OFFSET);
1147 INT_SET(dep->inumber, ARCH_CONVERT, XFS_DIR2_SF_GET_INUMBER(sfp, &sfp->hdr.parent)); 1147 dep->inumber = cpu_to_be64(XFS_DIR2_SF_GET_INUMBER(sfp, &sfp->hdr.parent));
1148 dep->namelen = 2; 1148 dep->namelen = 2;
1149 dep->name[0] = dep->name[1] = '.'; 1149 dep->name[0] = dep->name[1] = '.';
1150 tagp = XFS_DIR2_DATA_ENTRY_TAG_P(dep); 1150 tagp = XFS_DIR2_DATA_ENTRY_TAG_P(dep);
@@ -1193,7 +1193,7 @@ xfs_dir2_sf_to_block(
1193 * Copy a real entry. 1193 * Copy a real entry.
1194 */ 1194 */
1195 dep = (xfs_dir2_data_entry_t *)((char *)block + newoffset); 1195 dep = (xfs_dir2_data_entry_t *)((char *)block + newoffset);
1196 INT_SET(dep->inumber, ARCH_CONVERT, XFS_DIR2_SF_GET_INUMBER(sfp, 1196 dep->inumber = cpu_to_be64(XFS_DIR2_SF_GET_INUMBER(sfp,
1197 XFS_DIR2_SF_INUMBERP(sfep))); 1197 XFS_DIR2_SF_INUMBERP(sfep)));
1198 dep->namelen = sfep->namelen; 1198 dep->namelen = sfep->namelen;
1199 memcpy(dep->name, sfep->name, dep->namelen); 1199 memcpy(dep->name, sfep->name, dep->namelen);
diff --git a/fs/xfs/xfs_dir2_data.c b/fs/xfs/xfs_dir2_data.c
index bb3d03ff002b..7be37d38961f 100644
--- a/fs/xfs/xfs_dir2_data.c
+++ b/fs/xfs/xfs_dir2_data.c
@@ -133,7 +133,7 @@ xfs_dir2_data_check(
133 */ 133 */
134 dep = (xfs_dir2_data_entry_t *)p; 134 dep = (xfs_dir2_data_entry_t *)p;
135 ASSERT(dep->namelen != 0); 135 ASSERT(dep->namelen != 0);
136 ASSERT(xfs_dir_ino_validate(mp, INT_GET(dep->inumber, ARCH_CONVERT)) == 0); 136 ASSERT(xfs_dir_ino_validate(mp, be64_to_cpu(dep->inumber)) == 0);
137 ASSERT(be16_to_cpu(*XFS_DIR2_DATA_ENTRY_TAG_P(dep)) == 137 ASSERT(be16_to_cpu(*XFS_DIR2_DATA_ENTRY_TAG_P(dep)) ==
138 (char *)dep - (char *)d); 138 (char *)dep - (char *)d);
139 count++; 139 count++;
diff --git a/fs/xfs/xfs_dir2_data.h b/fs/xfs/xfs_dir2_data.h
index 0847cbb53e17..a6ae2d21c40a 100644
--- a/fs/xfs/xfs_dir2_data.h
+++ b/fs/xfs/xfs_dir2_data.h
@@ -85,11 +85,11 @@ typedef struct xfs_dir2_data_hdr {
85 * Tag appears as the last 2 bytes. 85 * Tag appears as the last 2 bytes.
86 */ 86 */
87typedef struct xfs_dir2_data_entry { 87typedef struct xfs_dir2_data_entry {
88 xfs_ino_t inumber; /* inode number */ 88 __be64 inumber; /* inode number */
89 __uint8_t namelen; /* name length */ 89 __u8 namelen; /* name length */
90 __uint8_t name[1]; /* name bytes, no null */ 90 __u8 name[1]; /* name bytes, no null */
91 /* variable offset */ 91 /* variable offset */
92 xfs_dir2_data_off_t tag; /* starting offset of us */ 92 __be16 tag; /* starting offset of us */
93} xfs_dir2_data_entry_t; 93} xfs_dir2_data_entry_t;
94 94
95/* 95/*
diff --git a/fs/xfs/xfs_dir2_leaf.c b/fs/xfs/xfs_dir2_leaf.c
index 5fe88d546c75..74ef99f2ee5f 100644
--- a/fs/xfs/xfs_dir2_leaf.c
+++ b/fs/xfs/xfs_dir2_leaf.c
@@ -407,7 +407,7 @@ xfs_dir2_leaf_addname(
407 * Initialize our new entry (at last). 407 * Initialize our new entry (at last).
408 */ 408 */
409 dep = (xfs_dir2_data_entry_t *)dup; 409 dep = (xfs_dir2_data_entry_t *)dup;
410 INT_SET(dep->inumber, ARCH_CONVERT, args->inumber); 410 dep->inumber = cpu_to_be64(args->inumber);
411 dep->namelen = args->namelen; 411 dep->namelen = args->namelen;
412 memcpy(dep->name, args->name, dep->namelen); 412 memcpy(dep->name, args->name, dep->namelen);
413 tagp = XFS_DIR2_DATA_ENTRY_TAG_P(dep); 413 tagp = XFS_DIR2_DATA_ENTRY_TAG_P(dep);
@@ -1098,7 +1098,7 @@ xfs_dir2_leaf_getdents(
1098 1098
1099 p->cook = XFS_DIR2_BYTE_TO_DATAPTR(mp, curoff + length); 1099 p->cook = XFS_DIR2_BYTE_TO_DATAPTR(mp, curoff + length);
1100 1100
1101 p->ino = INT_GET(dep->inumber, ARCH_CONVERT); 1101 p->ino = be64_to_cpu(dep->inumber);
1102#if XFS_BIG_INUMS 1102#if XFS_BIG_INUMS
1103 p->ino += mp->m_inoadd; 1103 p->ino += mp->m_inoadd;
1104#endif 1104#endif
@@ -1319,7 +1319,7 @@ xfs_dir2_leaf_lookup(
1319 /* 1319 /*
1320 * Return the found inode number. 1320 * Return the found inode number.
1321 */ 1321 */
1322 args->inumber = INT_GET(dep->inumber, ARCH_CONVERT); 1322 args->inumber = be64_to_cpu(dep->inumber);
1323 xfs_da_brelse(tp, dbp); 1323 xfs_da_brelse(tp, dbp);
1324 xfs_da_brelse(tp, lbp); 1324 xfs_da_brelse(tp, lbp);
1325 return XFS_ERROR(EEXIST); 1325 return XFS_ERROR(EEXIST);
@@ -1606,11 +1606,11 @@ xfs_dir2_leaf_replace(
1606 dep = (xfs_dir2_data_entry_t *) 1606 dep = (xfs_dir2_data_entry_t *)
1607 ((char *)dbp->data + 1607 ((char *)dbp->data +
1608 XFS_DIR2_DATAPTR_TO_OFF(dp->i_mount, be32_to_cpu(lep->address))); 1608 XFS_DIR2_DATAPTR_TO_OFF(dp->i_mount, be32_to_cpu(lep->address)));
1609 ASSERT(args->inumber != INT_GET(dep->inumber, ARCH_CONVERT)); 1609 ASSERT(args->inumber != be64_to_cpu(dep->inumber));
1610 /* 1610 /*
1611 * Put the new inode number in, log it. 1611 * Put the new inode number in, log it.
1612 */ 1612 */
1613 INT_SET(dep->inumber, ARCH_CONVERT, args->inumber); 1613 dep->inumber = cpu_to_be64(args->inumber);
1614 tp = args->trans; 1614 tp = args->trans;
1615 xfs_dir2_data_log_entry(tp, dbp, dep); 1615 xfs_dir2_data_log_entry(tp, dbp, dep);
1616 xfs_da_buf_done(dbp); 1616 xfs_da_buf_done(dbp);
diff --git a/fs/xfs/xfs_dir2_node.c b/fs/xfs/xfs_dir2_node.c
index ac511ab9c52d..c0e8fcf5e13f 100644
--- a/fs/xfs/xfs_dir2_node.c
+++ b/fs/xfs/xfs_dir2_node.c
@@ -580,7 +580,7 @@ xfs_dir2_leafn_lookup_int(
580 if (dep->namelen == args->namelen && 580 if (dep->namelen == args->namelen &&
581 dep->name[0] == args->name[0] && 581 dep->name[0] == args->name[0] &&
582 memcmp(dep->name, args->name, args->namelen) == 0) { 582 memcmp(dep->name, args->name, args->namelen) == 0) {
583 args->inumber = INT_GET(dep->inumber, ARCH_CONVERT); 583 args->inumber = be64_to_cpu(dep->inumber);
584 *indexp = index; 584 *indexp = index;
585 state->extravalid = 1; 585 state->extravalid = 1;
586 state->extrablk.bp = curbp; 586 state->extrablk.bp = curbp;
@@ -1695,7 +1695,7 @@ xfs_dir2_node_addname_int(
1695 * Fill in the new entry and log it. 1695 * Fill in the new entry and log it.
1696 */ 1696 */
1697 dep = (xfs_dir2_data_entry_t *)dup; 1697 dep = (xfs_dir2_data_entry_t *)dup;
1698 INT_SET(dep->inumber, ARCH_CONVERT, args->inumber); 1698 dep->inumber = cpu_to_be64(args->inumber);
1699 dep->namelen = args->namelen; 1699 dep->namelen = args->namelen;
1700 memcpy(dep->name, args->name, dep->namelen); 1700 memcpy(dep->name, args->name, dep->namelen);
1701 tagp = XFS_DIR2_DATA_ENTRY_TAG_P(dep); 1701 tagp = XFS_DIR2_DATA_ENTRY_TAG_P(dep);
@@ -1905,11 +1905,11 @@ xfs_dir2_node_replace(
1905 dep = (xfs_dir2_data_entry_t *) 1905 dep = (xfs_dir2_data_entry_t *)
1906 ((char *)data + 1906 ((char *)data +
1907 XFS_DIR2_DATAPTR_TO_OFF(state->mp, be32_to_cpu(lep->address))); 1907 XFS_DIR2_DATAPTR_TO_OFF(state->mp, be32_to_cpu(lep->address)));
1908 ASSERT(inum != INT_GET(dep->inumber, ARCH_CONVERT)); 1908 ASSERT(inum != be64_to_cpu(dep->inumber));
1909 /* 1909 /*
1910 * Fill in the new inode number and log the entry. 1910 * Fill in the new inode number and log the entry.
1911 */ 1911 */
1912 INT_SET(dep->inumber, ARCH_CONVERT, inum); 1912 dep->inumber = cpu_to_be64(inum);
1913 xfs_dir2_data_log_entry(args->trans, state->extrablk.bp, dep); 1913 xfs_dir2_data_log_entry(args->trans, state->extrablk.bp, dep);
1914 rval = 0; 1914 rval = 0;
1915 } 1915 }
diff --git a/fs/xfs/xfs_dir2_sf.c b/fs/xfs/xfs_dir2_sf.c
index d98a41d1fe63..06afa1b324cf 100644
--- a/fs/xfs/xfs_dir2_sf.c
+++ b/fs/xfs/xfs_dir2_sf.c
@@ -117,13 +117,13 @@ xfs_dir2_block_sfsize(
117 dep->name[0] == '.' && dep->name[1] == '.'; 117 dep->name[0] == '.' && dep->name[1] == '.';
118#if XFS_BIG_INUMS 118#if XFS_BIG_INUMS
119 if (!isdot) 119 if (!isdot)
120 i8count += INT_GET(dep->inumber, ARCH_CONVERT) > XFS_DIR2_MAX_SHORT_INUM; 120 i8count += be64_to_cpu(dep->inumber) > XFS_DIR2_MAX_SHORT_INUM;
121#endif 121#endif
122 if (!isdot && !isdotdot) { 122 if (!isdot && !isdotdot) {
123 count++; 123 count++;
124 namelen += dep->namelen; 124 namelen += dep->namelen;
125 } else if (isdotdot) 125 } else if (isdotdot)
126 parent = INT_GET(dep->inumber, ARCH_CONVERT); 126 parent = be64_to_cpu(dep->inumber);
127 /* 127 /*
128 * Calculate the new size, see if we should give up yet. 128 * Calculate the new size, see if we should give up yet.
129 */ 129 */
@@ -229,13 +229,13 @@ xfs_dir2_block_to_sf(
229 * Skip . 229 * Skip .
230 */ 230 */
231 if (dep->namelen == 1 && dep->name[0] == '.') 231 if (dep->namelen == 1 && dep->name[0] == '.')
232 ASSERT(INT_GET(dep->inumber, ARCH_CONVERT) == dp->i_ino); 232 ASSERT(be64_to_cpu(dep->inumber) == dp->i_ino);
233 /* 233 /*
234 * Skip .., but make sure the inode number is right. 234 * Skip .., but make sure the inode number is right.
235 */ 235 */
236 else if (dep->namelen == 2 && 236 else if (dep->namelen == 2 &&
237 dep->name[0] == '.' && dep->name[1] == '.') 237 dep->name[0] == '.' && dep->name[1] == '.')
238 ASSERT(INT_GET(dep->inumber, ARCH_CONVERT) == 238 ASSERT(be64_to_cpu(dep->inumber) ==
239 XFS_DIR2_SF_GET_INUMBER(sfp, &sfp->hdr.parent)); 239 XFS_DIR2_SF_GET_INUMBER(sfp, &sfp->hdr.parent));
240 /* 240 /*
241 * Normal entry, copy it into shortform. 241 * Normal entry, copy it into shortform.
@@ -246,7 +246,7 @@ xfs_dir2_block_to_sf(
246 (xfs_dir2_data_aoff_t) 246 (xfs_dir2_data_aoff_t)
247 ((char *)dep - (char *)block)); 247 ((char *)dep - (char *)block));
248 memcpy(sfep->name, dep->name, dep->namelen); 248 memcpy(sfep->name, dep->name, dep->namelen);
249 temp=INT_GET(dep->inumber, ARCH_CONVERT); 249 temp = be64_to_cpu(dep->inumber);
250 XFS_DIR2_SF_PUT_INUMBER(sfp, &temp, 250 XFS_DIR2_SF_PUT_INUMBER(sfp, &temp,
251 XFS_DIR2_SF_INUMBERP(sfep)); 251 XFS_DIR2_SF_INUMBERP(sfep));
252 sfep = XFS_DIR2_SF_NEXTENTRY(sfp, sfep); 252 sfep = XFS_DIR2_SF_NEXTENTRY(sfp, sfep);