Commit 70e73f59 authored by Nathan Scott's avatar Nathan Scott

[XFS] endianess annotations for xfs_dir2_data_hdr structure.

SGI-PV: 943272
SGI-Modid: xfs-linux-melb:xfs-kern:25484a
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
parent 9cea2364
...@@ -2204,7 +2204,7 @@ xfs_da_do_buf( ...@@ -2204,7 +2204,7 @@ xfs_da_do_buf(
data = rbp->data; data = rbp->data;
free = rbp->data; free = rbp->data;
magic = INT_GET(info->magic, ARCH_CONVERT); magic = INT_GET(info->magic, ARCH_CONVERT);
magic1 = INT_GET(data->hdr.magic, ARCH_CONVERT); magic1 = be32_to_cpu(data->hdr.magic);
if (unlikely( if (unlikely(
XFS_TEST_ERROR((magic != XFS_DA_NODE_MAGIC) && XFS_TEST_ERROR((magic != XFS_DA_NODE_MAGIC) &&
(magic != XFS_DIR_LEAF_MAGIC) && (magic != XFS_DIR_LEAF_MAGIC) &&
......
...@@ -100,8 +100,7 @@ xfs_dir2_block_addname( ...@@ -100,8 +100,7 @@ xfs_dir2_block_addname(
/* /*
* Check the magic number, corrupted if wrong. * Check the magic number, corrupted if wrong.
*/ */
if (unlikely(INT_GET(block->hdr.magic, ARCH_CONVERT) if (unlikely(be32_to_cpu(block->hdr.magic) != XFS_DIR2_BLOCK_MAGIC)) {
!= XFS_DIR2_BLOCK_MAGIC)) {
XFS_CORRUPTION_ERROR("xfs_dir2_block_addname", XFS_CORRUPTION_ERROR("xfs_dir2_block_addname",
XFS_ERRLEVEL_LOW, mp, block); XFS_ERRLEVEL_LOW, mp, block);
xfs_da_brelse(tp, bp); xfs_da_brelse(tp, bp);
...@@ -138,7 +137,7 @@ xfs_dir2_block_addname( ...@@ -138,7 +137,7 @@ xfs_dir2_block_addname(
*/ */
else { else {
dup = (xfs_dir2_data_unused_t *) dup = (xfs_dir2_data_unused_t *)
((char *)block + INT_GET(bf[0].offset, ARCH_CONVERT)); ((char *)block + be16_to_cpu(bf[0].offset));
if (dup == enddup) { if (dup == enddup) {
/* /*
* It is the biggest freespace, is it too small * It is the biggest freespace, is it too small
...@@ -149,10 +148,10 @@ xfs_dir2_block_addname( ...@@ -149,10 +148,10 @@ xfs_dir2_block_addname(
* Yes, we use the second-largest * Yes, we use the second-largest
* entry instead if it works. * entry instead if it works.
*/ */
if (INT_GET(bf[1].length, ARCH_CONVERT) >= len) if (be16_to_cpu(bf[1].length) >= len)
dup = (xfs_dir2_data_unused_t *) dup = (xfs_dir2_data_unused_t *)
((char *)block + ((char *)block +
INT_GET(bf[1].offset, ARCH_CONVERT)); be16_to_cpu(bf[1].offset));
else else
dup = NULL; dup = NULL;
} }
...@@ -172,9 +171,9 @@ xfs_dir2_block_addname( ...@@ -172,9 +171,9 @@ xfs_dir2_block_addname(
* If there are stale entries we'll use one for the leaf. * If there are stale entries we'll use one for the leaf.
* Is the biggest entry enough to avoid compaction? * Is the biggest entry enough to avoid compaction?
*/ */
else if (INT_GET(bf[0].length, ARCH_CONVERT) >= len) { else if (be16_to_cpu(bf[0].length) >= len) {
dup = (xfs_dir2_data_unused_t *) dup = (xfs_dir2_data_unused_t *)
((char *)block + INT_GET(bf[0].offset, ARCH_CONVERT)); ((char *)block + be16_to_cpu(bf[0].offset));
compact = 0; compact = 0;
} }
/* /*
...@@ -935,7 +934,7 @@ xfs_dir2_leaf_to_block( ...@@ -935,7 +934,7 @@ xfs_dir2_leaf_to_block(
goto out; goto out;
} }
block = dbp->data; block = dbp->data;
ASSERT(INT_GET(block->hdr.magic, ARCH_CONVERT) == XFS_DIR2_DATA_MAGIC); ASSERT(be32_to_cpu(block->hdr.magic) == XFS_DIR2_DATA_MAGIC);
/* /*
* Size of the "leaf" area in the block. * Size of the "leaf" area in the block.
*/ */
...@@ -956,7 +955,7 @@ xfs_dir2_leaf_to_block( ...@@ -956,7 +955,7 @@ xfs_dir2_leaf_to_block(
/* /*
* Start converting it to block form. * Start converting it to block form.
*/ */
INT_SET(block->hdr.magic, ARCH_CONVERT, XFS_DIR2_BLOCK_MAGIC); block->hdr.magic = cpu_to_be32(XFS_DIR2_BLOCK_MAGIC);
needlog = 1; needlog = 1;
needscan = 0; needscan = 0;
/* /*
...@@ -1095,7 +1094,7 @@ xfs_dir2_sf_to_block( ...@@ -1095,7 +1094,7 @@ xfs_dir2_sf_to_block(
return error; return error;
} }
block = bp->data; block = bp->data;
INT_SET(block->hdr.magic, ARCH_CONVERT, XFS_DIR2_BLOCK_MAGIC); block->hdr.magic = cpu_to_be32(XFS_DIR2_BLOCK_MAGIC);
/* /*
* Compute size of block "tail" area. * Compute size of block "tail" area.
*/ */
......
...@@ -70,11 +70,11 @@ xfs_dir2_data_check( ...@@ -70,11 +70,11 @@ xfs_dir2_data_check(
mp = dp->i_mount; mp = dp->i_mount;
d = bp->data; d = bp->data;
ASSERT(INT_GET(d->hdr.magic, ARCH_CONVERT) == XFS_DIR2_DATA_MAGIC || ASSERT(be32_to_cpu(d->hdr.magic) == XFS_DIR2_DATA_MAGIC ||
INT_GET(d->hdr.magic, ARCH_CONVERT) == XFS_DIR2_BLOCK_MAGIC); be32_to_cpu(d->hdr.magic) == XFS_DIR2_BLOCK_MAGIC);
bf = d->hdr.bestfree; bf = d->hdr.bestfree;
p = (char *)d->u; p = (char *)d->u;
if (INT_GET(d->hdr.magic, ARCH_CONVERT) == XFS_DIR2_BLOCK_MAGIC) { if (be32_to_cpu(d->hdr.magic) == XFS_DIR2_BLOCK_MAGIC) {
btp = XFS_DIR2_BLOCK_TAIL_P(mp, (xfs_dir2_block_t *)d); btp = XFS_DIR2_BLOCK_TAIL_P(mp, (xfs_dir2_block_t *)d);
lep = XFS_DIR2_BLOCK_LEAF_P(btp); lep = XFS_DIR2_BLOCK_LEAF_P(btp);
endp = (char *)lep; endp = (char *)lep;
...@@ -96,8 +96,8 @@ xfs_dir2_data_check( ...@@ -96,8 +96,8 @@ xfs_dir2_data_check(
ASSERT(!bf[2].offset); ASSERT(!bf[2].offset);
freeseen |= 1 << 2; freeseen |= 1 << 2;
} }
ASSERT(INT_GET(bf[0].length, ARCH_CONVERT) >= INT_GET(bf[1].length, ARCH_CONVERT)); ASSERT(be16_to_cpu(bf[0].length) >= be16_to_cpu(bf[1].length));
ASSERT(INT_GET(bf[1].length, ARCH_CONVERT) >= INT_GET(bf[2].length, ARCH_CONVERT)); ASSERT(be16_to_cpu(bf[1].length) >= be16_to_cpu(bf[2].length));
/* /*
* Loop over the data/unused entries. * Loop over the data/unused entries.
*/ */
...@@ -117,8 +117,10 @@ xfs_dir2_data_check( ...@@ -117,8 +117,10 @@ xfs_dir2_data_check(
i = (int)(dfp - bf); i = (int)(dfp - bf);
ASSERT((freeseen & (1 << i)) == 0); ASSERT((freeseen & (1 << i)) == 0);
freeseen |= 1 << i; freeseen |= 1 << i;
} else } else {
ASSERT(INT_GET(dup->length, ARCH_CONVERT) <= INT_GET(bf[2].length, ARCH_CONVERT)); ASSERT(INT_GET(dup->length, ARCH_CONVERT) <=
be16_to_cpu(bf[2].length));
}
p += INT_GET(dup->length, ARCH_CONVERT); p += INT_GET(dup->length, ARCH_CONVERT);
lastfree = 1; lastfree = 1;
continue; continue;
...@@ -136,7 +138,7 @@ xfs_dir2_data_check( ...@@ -136,7 +138,7 @@ xfs_dir2_data_check(
(char *)dep - (char *)d); (char *)dep - (char *)d);
count++; count++;
lastfree = 0; lastfree = 0;
if (INT_GET(d->hdr.magic, ARCH_CONVERT) == XFS_DIR2_BLOCK_MAGIC) { if (be32_to_cpu(d->hdr.magic) == XFS_DIR2_BLOCK_MAGIC) {
addr = XFS_DIR2_DB_OFF_TO_DATAPTR(mp, mp->m_dirdatablk, addr = XFS_DIR2_DB_OFF_TO_DATAPTR(mp, mp->m_dirdatablk,
(xfs_dir2_data_aoff_t) (xfs_dir2_data_aoff_t)
((char *)dep - (char *)d)); ((char *)dep - (char *)d));
...@@ -154,7 +156,7 @@ xfs_dir2_data_check( ...@@ -154,7 +156,7 @@ xfs_dir2_data_check(
* Need to have seen all the entries and all the bestfree slots. * Need to have seen all the entries and all the bestfree slots.
*/ */
ASSERT(freeseen == 7); ASSERT(freeseen == 7);
if (INT_GET(d->hdr.magic, ARCH_CONVERT) == XFS_DIR2_BLOCK_MAGIC) { if (be32_to_cpu(d->hdr.magic) == XFS_DIR2_BLOCK_MAGIC) {
for (i = stale = 0; i < INT_GET(btp->count, ARCH_CONVERT); i++) { for (i = stale = 0; i < INT_GET(btp->count, ARCH_CONVERT); i++) {
if (INT_GET(lep[i].address, ARCH_CONVERT) == XFS_DIR2_NULL_DATAPTR) if (INT_GET(lep[i].address, ARCH_CONVERT) == XFS_DIR2_NULL_DATAPTR)
stale++; stale++;
...@@ -190,8 +192,8 @@ xfs_dir2_data_freefind( ...@@ -190,8 +192,8 @@ xfs_dir2_data_freefind(
* Check order, non-overlapping entries, and if we find the * Check order, non-overlapping entries, and if we find the
* one we're looking for it has to be exact. * one we're looking for it has to be exact.
*/ */
ASSERT(INT_GET(d->hdr.magic, ARCH_CONVERT) == XFS_DIR2_DATA_MAGIC || ASSERT(be32_to_cpu(d->hdr.magic) == XFS_DIR2_DATA_MAGIC ||
INT_GET(d->hdr.magic, ARCH_CONVERT) == XFS_DIR2_BLOCK_MAGIC); be32_to_cpu(d->hdr.magic) == XFS_DIR2_BLOCK_MAGIC);
for (dfp = &d->hdr.bestfree[0], seenzero = matched = 0; for (dfp = &d->hdr.bestfree[0], seenzero = matched = 0;
dfp < &d->hdr.bestfree[XFS_DIR2_DATA_FD_COUNT]; dfp < &d->hdr.bestfree[XFS_DIR2_DATA_FD_COUNT];
dfp++) { dfp++) {
...@@ -201,23 +203,24 @@ xfs_dir2_data_freefind( ...@@ -201,23 +203,24 @@ xfs_dir2_data_freefind(
continue; continue;
} }
ASSERT(seenzero == 0); ASSERT(seenzero == 0);
if (INT_GET(dfp->offset, ARCH_CONVERT) == off) { if (be16_to_cpu(dfp->offset) == off) {
matched = 1; matched = 1;
ASSERT(INT_GET(dfp->length, ARCH_CONVERT) == INT_GET(dup->length, ARCH_CONVERT)); ASSERT(be16_to_cpu(dfp->length) == INT_GET(dup->length, ARCH_CONVERT));
} else if (off < INT_GET(dfp->offset, ARCH_CONVERT)) } else if (off < be16_to_cpu(dfp->offset))
ASSERT(off + INT_GET(dup->length, ARCH_CONVERT) <= INT_GET(dfp->offset, ARCH_CONVERT)); ASSERT(off + INT_GET(dup->length, ARCH_CONVERT) <= be16_to_cpu(dfp->offset));
else else
ASSERT(INT_GET(dfp->offset, ARCH_CONVERT) + INT_GET(dfp->length, ARCH_CONVERT) <= off); ASSERT(be16_to_cpu(dfp->offset) + be16_to_cpu(dfp->length) <= off);
ASSERT(matched || INT_GET(dfp->length, ARCH_CONVERT) >= INT_GET(dup->length, ARCH_CONVERT)); ASSERT(matched || be16_to_cpu(dfp->length) >= INT_GET(dup->length, ARCH_CONVERT));
if (dfp > &d->hdr.bestfree[0]) if (dfp > &d->hdr.bestfree[0])
ASSERT(INT_GET(dfp[-1].length, ARCH_CONVERT) >= INT_GET(dfp[0].length, ARCH_CONVERT)); ASSERT(be16_to_cpu(dfp[-1].length) >= be16_to_cpu(dfp[0].length));
} }
#endif #endif
/* /*
* If this is smaller than the smallest bestfree entry, * If this is smaller than the smallest bestfree entry,
* it can't be there since they're sorted. * it can't be there since they're sorted.
*/ */
if (INT_GET(dup->length, ARCH_CONVERT) < INT_GET(d->hdr.bestfree[XFS_DIR2_DATA_FD_COUNT - 1].length, ARCH_CONVERT)) if (INT_GET(dup->length, ARCH_CONVERT) <
be16_to_cpu(d->hdr.bestfree[XFS_DIR2_DATA_FD_COUNT - 1].length))
return NULL; return NULL;
/* /*
* Look at the three bestfree entries for our guy. * Look at the three bestfree entries for our guy.
...@@ -227,7 +230,7 @@ xfs_dir2_data_freefind( ...@@ -227,7 +230,7 @@ xfs_dir2_data_freefind(
dfp++) { dfp++) {
if (!dfp->offset) if (!dfp->offset)
return NULL; return NULL;
if (INT_GET(dfp->offset, ARCH_CONVERT) == off) if (be16_to_cpu(dfp->offset) == off)
return dfp; return dfp;
} }
/* /*
...@@ -249,29 +252,29 @@ xfs_dir2_data_freeinsert( ...@@ -249,29 +252,29 @@ xfs_dir2_data_freeinsert(
xfs_dir2_data_free_t new; /* new bestfree entry */ xfs_dir2_data_free_t new; /* new bestfree entry */
#ifdef __KERNEL__ #ifdef __KERNEL__
ASSERT(INT_GET(d->hdr.magic, ARCH_CONVERT) == XFS_DIR2_DATA_MAGIC || ASSERT(be32_to_cpu(d->hdr.magic) == XFS_DIR2_DATA_MAGIC ||
INT_GET(d->hdr.magic, ARCH_CONVERT) == XFS_DIR2_BLOCK_MAGIC); be32_to_cpu(d->hdr.magic) == XFS_DIR2_BLOCK_MAGIC);
#endif #endif
dfp = d->hdr.bestfree; dfp = d->hdr.bestfree;
INT_COPY(new.length, dup->length, ARCH_CONVERT); new.length = dup->length;
INT_SET(new.offset, ARCH_CONVERT, (xfs_dir2_data_off_t)((char *)dup - (char *)d)); new.offset = cpu_to_be16((char *)dup - (char *)d);
/* /*
* Insert at position 0, 1, or 2; or not at all. * Insert at position 0, 1, or 2; or not at all.
*/ */
if (INT_GET(new.length, ARCH_CONVERT) > INT_GET(dfp[0].length, ARCH_CONVERT)) { if (be16_to_cpu(new.length) > be16_to_cpu(dfp[0].length)) {
dfp[2] = dfp[1]; dfp[2] = dfp[1];
dfp[1] = dfp[0]; dfp[1] = dfp[0];
dfp[0] = new; dfp[0] = new;
*loghead = 1; *loghead = 1;
return &dfp[0]; return &dfp[0];
} }
if (INT_GET(new.length, ARCH_CONVERT) > INT_GET(dfp[1].length, ARCH_CONVERT)) { if (be16_to_cpu(new.length) > be16_to_cpu(dfp[1].length)) {
dfp[2] = dfp[1]; dfp[2] = dfp[1];
dfp[1] = new; dfp[1] = new;
*loghead = 1; *loghead = 1;
return &dfp[1]; return &dfp[1];
} }
if (INT_GET(new.length, ARCH_CONVERT) > INT_GET(dfp[2].length, ARCH_CONVERT)) { if (be16_to_cpu(new.length) > be16_to_cpu(dfp[2].length)) {
dfp[2] = new; dfp[2] = new;
*loghead = 1; *loghead = 1;
return &dfp[2]; return &dfp[2];
...@@ -289,8 +292,8 @@ xfs_dir2_data_freeremove( ...@@ -289,8 +292,8 @@ xfs_dir2_data_freeremove(
int *loghead) /* out: log data header */ int *loghead) /* out: log data header */
{ {
#ifdef __KERNEL__ #ifdef __KERNEL__
ASSERT(INT_GET(d->hdr.magic, ARCH_CONVERT) == XFS_DIR2_DATA_MAGIC || ASSERT(be32_to_cpu(d->hdr.magic) == XFS_DIR2_DATA_MAGIC ||
INT_GET(d->hdr.magic, ARCH_CONVERT) == XFS_DIR2_BLOCK_MAGIC); be32_to_cpu(d->hdr.magic) == XFS_DIR2_BLOCK_MAGIC);
#endif #endif
/* /*
* It's the first entry, slide the next 2 up. * It's the first entry, slide the next 2 up.
...@@ -334,8 +337,8 @@ xfs_dir2_data_freescan( ...@@ -334,8 +337,8 @@ xfs_dir2_data_freescan(
char *p; /* current entry pointer */ char *p; /* current entry pointer */
#ifdef __KERNEL__ #ifdef __KERNEL__
ASSERT(INT_GET(d->hdr.magic, ARCH_CONVERT) == XFS_DIR2_DATA_MAGIC || ASSERT(be32_to_cpu(d->hdr.magic) == XFS_DIR2_DATA_MAGIC ||
INT_GET(d->hdr.magic, ARCH_CONVERT) == XFS_DIR2_BLOCK_MAGIC); be32_to_cpu(d->hdr.magic) == XFS_DIR2_BLOCK_MAGIC);
#endif #endif
/* /*
* Start by clearing the table. * Start by clearing the table.
...@@ -348,7 +351,7 @@ xfs_dir2_data_freescan( ...@@ -348,7 +351,7 @@ xfs_dir2_data_freescan(
p = (char *)d->u; p = (char *)d->u;
if (aendp) if (aendp)
endp = aendp; endp = aendp;
else if (INT_GET(d->hdr.magic, ARCH_CONVERT) == XFS_DIR2_BLOCK_MAGIC) { else if (be32_to_cpu(d->hdr.magic) == XFS_DIR2_BLOCK_MAGIC) {
btp = XFS_DIR2_BLOCK_TAIL_P(mp, (xfs_dir2_block_t *)d); btp = XFS_DIR2_BLOCK_TAIL_P(mp, (xfs_dir2_block_t *)d);
endp = (char *)XFS_DIR2_BLOCK_LEAF_P(btp); endp = (char *)XFS_DIR2_BLOCK_LEAF_P(btp);
} else } else
...@@ -415,8 +418,8 @@ xfs_dir2_data_init( ...@@ -415,8 +418,8 @@ xfs_dir2_data_init(
* Initialize the header. * Initialize the header.
*/ */
d = bp->data; d = bp->data;
INT_SET(d->hdr.magic, ARCH_CONVERT, XFS_DIR2_DATA_MAGIC); d->hdr.magic = cpu_to_be32(XFS_DIR2_DATA_MAGIC);
INT_SET(d->hdr.bestfree[0].offset, ARCH_CONVERT, (xfs_dir2_data_off_t)sizeof(d->hdr)); d->hdr.bestfree[0].offset = cpu_to_be16(sizeof(d->hdr));
for (i = 1; i < XFS_DIR2_DATA_FD_COUNT; i++) { for (i = 1; i < XFS_DIR2_DATA_FD_COUNT; i++) {
d->hdr.bestfree[i].length = 0; d->hdr.bestfree[i].length = 0;
d->hdr.bestfree[i].offset = 0; d->hdr.bestfree[i].offset = 0;
...@@ -428,7 +431,7 @@ xfs_dir2_data_init( ...@@ -428,7 +431,7 @@ xfs_dir2_data_init(
INT_SET(dup->freetag, ARCH_CONVERT, XFS_DIR2_DATA_FREE_TAG); INT_SET(dup->freetag, ARCH_CONVERT, XFS_DIR2_DATA_FREE_TAG);
t=mp->m_dirblksize - (uint)sizeof(d->hdr); t=mp->m_dirblksize - (uint)sizeof(d->hdr);
INT_SET(d->hdr.bestfree[0].length, ARCH_CONVERT, t); d->hdr.bestfree[0].length = cpu_to_be16(t);
INT_SET(dup->length, ARCH_CONVERT, t); INT_SET(dup->length, ARCH_CONVERT, t);
INT_SET(*XFS_DIR2_DATA_UNUSED_TAG_P(dup), ARCH_CONVERT, INT_SET(*XFS_DIR2_DATA_UNUSED_TAG_P(dup), ARCH_CONVERT,
(xfs_dir2_data_off_t)((char *)dup - (char *)d)); (xfs_dir2_data_off_t)((char *)dup - (char *)d));
...@@ -453,8 +456,8 @@ xfs_dir2_data_log_entry( ...@@ -453,8 +456,8 @@ xfs_dir2_data_log_entry(
xfs_dir2_data_t *d; /* data block pointer */ xfs_dir2_data_t *d; /* data block pointer */
d = bp->data; d = bp->data;
ASSERT(INT_GET(d->hdr.magic, ARCH_CONVERT) == XFS_DIR2_DATA_MAGIC || ASSERT(be32_to_cpu(d->hdr.magic) == XFS_DIR2_DATA_MAGIC ||
INT_GET(d->hdr.magic, ARCH_CONVERT) == XFS_DIR2_BLOCK_MAGIC); be32_to_cpu(d->hdr.magic) == XFS_DIR2_BLOCK_MAGIC);
xfs_da_log_buf(tp, bp, (uint)((char *)dep - (char *)d), xfs_da_log_buf(tp, bp, (uint)((char *)dep - (char *)d),
(uint)((char *)(XFS_DIR2_DATA_ENTRY_TAG_P(dep) + 1) - (uint)((char *)(XFS_DIR2_DATA_ENTRY_TAG_P(dep) + 1) -
(char *)d - 1)); (char *)d - 1));
...@@ -471,8 +474,8 @@ xfs_dir2_data_log_header( ...@@ -471,8 +474,8 @@ xfs_dir2_data_log_header(
xfs_dir2_data_t *d; /* data block pointer */ xfs_dir2_data_t *d; /* data block pointer */
d = bp->data; d = bp->data;
ASSERT(INT_GET(d->hdr.magic, ARCH_CONVERT) == XFS_DIR2_DATA_MAGIC || ASSERT(be32_to_cpu(d->hdr.magic) == XFS_DIR2_DATA_MAGIC ||
INT_GET(d->hdr.magic, ARCH_CONVERT) == XFS_DIR2_BLOCK_MAGIC); be32_to_cpu(d->hdr.magic) == XFS_DIR2_BLOCK_MAGIC);
xfs_da_log_buf(tp, bp, (uint)((char *)&d->hdr - (char *)d), xfs_da_log_buf(tp, bp, (uint)((char *)&d->hdr - (char *)d),
(uint)(sizeof(d->hdr) - 1)); (uint)(sizeof(d->hdr) - 1));
} }
...@@ -489,8 +492,8 @@ xfs_dir2_data_log_unused( ...@@ -489,8 +492,8 @@ xfs_dir2_data_log_unused(
xfs_dir2_data_t *d; /* data block pointer */ xfs_dir2_data_t *d; /* data block pointer */
d = bp->data; d = bp->data;
ASSERT(INT_GET(d->hdr.magic, ARCH_CONVERT) == XFS_DIR2_DATA_MAGIC || ASSERT(be32_to_cpu(d->hdr.magic) == XFS_DIR2_DATA_MAGIC ||
INT_GET(d->hdr.magic, ARCH_CONVERT) == XFS_DIR2_BLOCK_MAGIC); be32_to_cpu(d->hdr.magic) == XFS_DIR2_BLOCK_MAGIC);
/* /*
* Log the first part of the unused entry. * Log the first part of the unused entry.
*/ */
...@@ -533,12 +536,12 @@ xfs_dir2_data_make_free( ...@@ -533,12 +536,12 @@ xfs_dir2_data_make_free(
/* /*
* Figure out where the end of the data area is. * Figure out where the end of the data area is.
*/ */
if (INT_GET(d->hdr.magic, ARCH_CONVERT) == XFS_DIR2_DATA_MAGIC) if (be32_to_cpu(d->hdr.magic) == XFS_DIR2_DATA_MAGIC)
endptr = (char *)d + mp->m_dirblksize; endptr = (char *)d + mp->m_dirblksize;
else { else {
xfs_dir2_block_tail_t *btp; /* block tail */ xfs_dir2_block_tail_t *btp; /* block tail */
ASSERT(INT_GET(d->hdr.magic, ARCH_CONVERT) == XFS_DIR2_BLOCK_MAGIC); ASSERT(be32_to_cpu(d->hdr.magic) == XFS_DIR2_BLOCK_MAGIC);
btp = XFS_DIR2_BLOCK_TAIL_P(mp, (xfs_dir2_block_t *)d); btp = XFS_DIR2_BLOCK_TAIL_P(mp, (xfs_dir2_block_t *)d);
endptr = (char *)XFS_DIR2_BLOCK_LEAF_P(btp); endptr = (char *)XFS_DIR2_BLOCK_LEAF_P(btp);
} }
...@@ -586,7 +589,7 @@ xfs_dir2_data_make_free( ...@@ -586,7 +589,7 @@ xfs_dir2_data_make_free(
* since the third bestfree is there, there might be more * since the third bestfree is there, there might be more
* entries. * entries.
*/ */
needscan = d->hdr.bestfree[2].length; needscan = (d->hdr.bestfree[2].length != 0);
/* /*
* Fix up the new big freespace. * Fix up the new big freespace.
*/ */
...@@ -614,7 +617,7 @@ xfs_dir2_data_make_free( ...@@ -614,7 +617,7 @@ xfs_dir2_data_make_free(
*/ */
dfp = xfs_dir2_data_freeinsert(d, prevdup, needlogp); dfp = xfs_dir2_data_freeinsert(d, prevdup, needlogp);
ASSERT(dfp == &d->hdr.bestfree[0]); ASSERT(dfp == &d->hdr.bestfree[0]);
ASSERT(INT_GET(dfp->length, ARCH_CONVERT) == INT_GET(prevdup->length, ARCH_CONVERT)); ASSERT(be16_to_cpu(dfp->length) == INT_GET(prevdup->length, ARCH_CONVERT));
ASSERT(!dfp[1].length); ASSERT(!dfp[1].length);
ASSERT(!dfp[2].length); ASSERT(!dfp[2].length);
} }
...@@ -640,8 +643,10 @@ xfs_dir2_data_make_free( ...@@ -640,8 +643,10 @@ xfs_dir2_data_make_free(
/* /*
* Otherwise we need a scan if the new entry is big enough. * Otherwise we need a scan if the new entry is big enough.
*/ */
else else {
needscan = INT_GET(prevdup->length, ARCH_CONVERT) > INT_GET(d->hdr.bestfree[2].length, ARCH_CONVERT); needscan = INT_GET(prevdup->length, ARCH_CONVERT) >
be16_to_cpu(d->hdr.bestfree[2].length);
}
} }
/* /*
* The following entry is free, merge with it. * The following entry is free, merge with it.
...@@ -666,8 +671,10 @@ xfs_dir2_data_make_free( ...@@ -666,8 +671,10 @@ xfs_dir2_data_make_free(
/* /*
* Otherwise we need a scan if the new entry is big enough. * Otherwise we need a scan if the new entry is big enough.
*/ */
else else {
needscan = INT_GET(newdup->length, ARCH_CONVERT) > INT_GET(d->hdr.bestfree[2].length, ARCH_CONVERT); needscan = INT_GET(newdup->length, ARCH_CONVERT) >
be16_to_cpu(d->hdr.bestfree[2].length);
}
} }
/* /*
* Neither neighbor is free. Make a new entry. * Neither neighbor is free. Make a new entry.
...@@ -707,8 +714,8 @@ xfs_dir2_data_use_free( ...@@ -707,8 +714,8 @@ xfs_dir2_data_use_free(
int oldlen; /* old unused entry's length */ int oldlen; /* old unused entry's length */
d = bp->data; d = bp->data;
ASSERT(INT_GET(d->hdr.magic, ARCH_CONVERT) == XFS_DIR2_DATA_MAGIC || ASSERT(be32_to_cpu(d->hdr.magic) == XFS_DIR2_DATA_MAGIC ||
INT_GET(d->hdr.magic, ARCH_CONVERT) == XFS_DIR2_BLOCK_MAGIC); be32_to_cpu(d->hdr.magic) == XFS_DIR2_BLOCK_MAGIC);
ASSERT(INT_GET(dup->freetag, ARCH_CONVERT) == XFS_DIR2_DATA_FREE_TAG); ASSERT(INT_GET(dup->freetag, ARCH_CONVERT) == XFS_DIR2_DATA_FREE_TAG);
ASSERT(offset >= (char *)dup - (char *)d); ASSERT(offset >= (char *)dup - (char *)d);
ASSERT(offset + len <= (char *)dup + INT_GET(dup->length, ARCH_CONVERT) - (char *)d); ASSERT(offset + len <= (char *)dup + INT_GET(dup->length, ARCH_CONVERT) - (char *)d);
...@@ -718,7 +725,7 @@ xfs_dir2_data_use_free( ...@@ -718,7 +725,7 @@ xfs_dir2_data_use_free(
*/ */
dfp = xfs_dir2_data_freefind(d, dup); dfp = xfs_dir2_data_freefind(d, dup);
oldlen = INT_GET(dup->length, ARCH_CONVERT); oldlen = INT_GET(dup->length, ARCH_CONVERT);
ASSERT(dfp || oldlen <= INT_GET(d->hdr.bestfree[2].length, ARCH_CONVERT)); ASSERT(dfp || oldlen <= be16_to_cpu(d->hdr.bestfree[2].length));
/* /*
* Check for alignment with front and back of the entry. * Check for alignment with front and back of the entry.
*/ */
...@@ -732,7 +739,7 @@ xfs_dir2_data_use_free( ...@@ -732,7 +739,7 @@ xfs_dir2_data_use_free(
*/ */
if (matchfront && matchback) { if (matchfront && matchback) {
if (dfp) { if (dfp) {
needscan = d->hdr.bestfree[2].offset; needscan = (d->hdr.bestfree[2].offset != 0);
if (!needscan) if (!needscan)
xfs_dir2_data_freeremove(d, dfp, needlogp); xfs_dir2_data_freeremove(d, dfp, needlogp);
} }
...@@ -755,8 +762,8 @@ xfs_dir2_data_use_free( ...@@ -755,8 +762,8 @@ xfs_dir2_data_use_free(
xfs_dir2_data_freeremove(d, dfp, needlogp); xfs_dir2_data_freeremove(d, dfp, needlogp);
dfp = xfs_dir2_data_freeinsert(d, newdup, needlogp); dfp = xfs_dir2_data_freeinsert(d, newdup, needlogp);
ASSERT(dfp != NULL); ASSERT(dfp != NULL);
ASSERT(INT_GET(dfp->length, ARCH_CONVERT) == INT_GET(newdup->length, ARCH_CONVERT)); ASSERT(be16_to_cpu(dfp->length) == INT_GET(newdup->length, ARCH_CONVERT));
ASSERT(INT_GET(dfp->offset, ARCH_CONVERT) == (char *)newdup - (char *)d); ASSERT(be16_to_cpu(dfp->offset) == (char *)newdup - (char *)d);
/* /*
* If we got inserted at the last slot, * If we got inserted at the last slot,
* that means we don't know if there was a better * that means we don't know if there was a better
...@@ -783,8 +790,8 @@ xfs_dir2_data_use_free( ...@@ -783,8 +790,8 @@ xfs_dir2_data_use_free(
xfs_dir2_data_freeremove(d, dfp, needlogp); xfs_dir2_data_freeremove(d, dfp, needlogp);
dfp = xfs_dir2_data_freeinsert(d, newdup, needlogp); dfp = xfs_dir2_data_freeinsert(d, newdup, needlogp);
ASSERT(dfp != NULL); ASSERT(dfp != NULL);
ASSERT(INT_GET(dfp->length, ARCH_CONVERT) == INT_GET(newdup->length, ARCH_CONVERT)); ASSERT(be16_to_cpu(dfp->length) == INT_GET(newdup->length, ARCH_CONVERT));
ASSERT(INT_GET(dfp->offset, ARCH_CONVERT) == (char *)newdup - (char *)d); ASSERT(be16_to_cpu(dfp->offset) == (char *)newdup - (char *)d);
/* /*
* If we got inserted at the last slot, * If we got inserted at the last slot,
* that means we don't know if there was a better * that means we don't know if there was a better
...@@ -819,7 +826,7 @@ xfs_dir2_data_use_free( ...@@ -819,7 +826,7 @@ xfs_dir2_data_use_free(
* the 2 new will work. * the 2 new will work.
*/ */
if (dfp) { if (dfp) {
needscan = d->hdr.bestfree[2].length; needscan = (d->hdr.bestfree[2].length != 0);
if (!needscan) { if (!needscan) {
xfs_dir2_data_freeremove(d, dfp, needlogp); xfs_dir2_data_freeremove(d, dfp, needlogp);
(void)xfs_dir2_data_freeinsert(d, newdup, (void)xfs_dir2_data_freeinsert(d, newdup,
......
...@@ -65,8 +65,8 @@ struct xfs_trans; ...@@ -65,8 +65,8 @@ struct xfs_trans;
* The freespace will be formatted as a xfs_dir2_data_unused_t. * The freespace will be formatted as a xfs_dir2_data_unused_t.
*/ */
typedef struct xfs_dir2_data_free { typedef struct xfs_dir2_data_free {
xfs_dir2_data_off_t offset; /* start of freespace */ __be16 offset; /* start of freespace */
xfs_dir2_data_off_t length; /* length of freespace */ __be16 length; /* length of freespace */
} xfs_dir2_data_free_t; } xfs_dir2_data_free_t;
/* /*
...@@ -75,7 +75,7 @@ typedef struct xfs_dir2_data_free { ...@@ -75,7 +75,7 @@ typedef struct xfs_dir2_data_free {
* The code knows that XFS_DIR2_DATA_FD_COUNT is 3. * The code knows that XFS_DIR2_DATA_FD_COUNT is 3.
*/ */
typedef struct xfs_dir2_data_hdr { typedef struct xfs_dir2_data_hdr {
__uint32_t magic; /* XFS_DIR2_DATA_MAGIC */ __be32 magic; /* XFS_DIR2_DATA_MAGIC */
/* or XFS_DIR2_BLOCK_MAGIC */ /* or XFS_DIR2_BLOCK_MAGIC */
xfs_dir2_data_free_t bestfree[XFS_DIR2_DATA_FD_COUNT]; xfs_dir2_data_free_t bestfree[XFS_DIR2_DATA_FD_COUNT];
} xfs_dir2_data_hdr_t; } xfs_dir2_data_hdr_t;
......
...@@ -133,7 +133,7 @@ xfs_dir2_block_to_leaf( ...@@ -133,7 +133,7 @@ xfs_dir2_block_to_leaf(
/* /*
* Fix up the block header, make it a data block. * Fix up the block header, make it a data block.
*/ */
INT_SET(block->hdr.magic, ARCH_CONVERT, XFS_DIR2_DATA_MAGIC); block->hdr.magic = cpu_to_be32(XFS_DIR2_DATA_MAGIC);
if (needscan) if (needscan)
xfs_dir2_data_freescan(mp, (xfs_dir2_data_t *)block, &needlog, xfs_dir2_data_freescan(mp, (xfs_dir2_data_t *)block, &needlog,
NULL); NULL);
...@@ -143,7 +143,7 @@ xfs_dir2_block_to_leaf( ...@@ -143,7 +143,7 @@ xfs_dir2_block_to_leaf(
ltp = XFS_DIR2_LEAF_TAIL_P(mp, leaf); ltp = XFS_DIR2_LEAF_TAIL_P(mp, leaf);
INT_SET(ltp->bestcount, ARCH_CONVERT, 1); INT_SET(ltp->bestcount, ARCH_CONVERT, 1);
bestsp = XFS_DIR2_LEAF_BESTS_P(ltp); bestsp = XFS_DIR2_LEAF_BESTS_P(ltp);
INT_COPY(bestsp[0], block->hdr.bestfree[0].length, ARCH_CONVERT); bestsp[0] = block->hdr.bestfree[0].length;
/* /*
* Log the data header and leaf bests table. * Log the data header and leaf bests table.
*/ */
...@@ -372,7 +372,7 @@ xfs_dir2_leaf_addname( ...@@ -372,7 +372,7 @@ xfs_dir2_leaf_addname(
else else
xfs_dir2_leaf_log_bests(tp, lbp, use_block, use_block); xfs_dir2_leaf_log_bests(tp, lbp, use_block, use_block);
data = dbp->data; data = dbp->data;
INT_COPY(bestsp[use_block], data->hdr.bestfree[0].length, ARCH_CONVERT); bestsp[use_block] = data->hdr.bestfree[0].length;
grown = 1; grown = 1;
} }
/* /*
...@@ -394,7 +394,7 @@ xfs_dir2_leaf_addname( ...@@ -394,7 +394,7 @@ xfs_dir2_leaf_addname(
* Point to the biggest freespace in our data block. * Point to the biggest freespace in our data block.
*/ */
dup = (xfs_dir2_data_unused_t *) dup = (xfs_dir2_data_unused_t *)
((char *)data + INT_GET(data->hdr.bestfree[0].offset, ARCH_CONVERT)); ((char *)data + be16_to_cpu(data->hdr.bestfree[0].offset));
ASSERT(INT_GET(dup->length, ARCH_CONVERT) >= length); ASSERT(INT_GET(dup->length, ARCH_CONVERT) >= length);
needscan = needlog = 0; needscan = needlog = 0;
/* /*
...@@ -427,8 +427,8 @@ xfs_dir2_leaf_addname( ...@@ -427,8 +427,8 @@ xfs_dir2_leaf_addname(
* If the bests table needs to be changed, do it. * If the bests table needs to be changed, do it.
* Log the change unless we've already done that. * Log the change unless we've already done that.
*/ */
if (INT_GET(bestsp[use_block], ARCH_CONVERT) != INT_GET(data->hdr.bestfree[0].length, ARCH_CONVERT)) { if (INT_GET(bestsp[use_block], ARCH_CONVERT) != be16_to_cpu(data->hdr.bestfree[0].length)) {
INT_COPY(bestsp[use_block], data->hdr.bestfree[0].length, ARCH_CONVERT); bestsp[use_block] = data->hdr.bestfree[0].length;
if (!grown) if (!grown)
xfs_dir2_leaf_log_bests(tp, lbp, use_block, use_block); xfs_dir2_leaf_log_bests(tp, lbp, use_block, use_block);
} }
...@@ -1477,7 +1477,7 @@ xfs_dir2_leaf_removename( ...@@ -1477,7 +1477,7 @@ xfs_dir2_leaf_removename(
dep = (xfs_dir2_data_entry_t *) dep = (xfs_dir2_data_entry_t *)
((char *)data + XFS_DIR2_DATAPTR_TO_OFF(mp, INT_GET(lep->address, ARCH_CONVERT))); ((char *)data + XFS_DIR2_DATAPTR_TO_OFF(mp, INT_GET(lep->address, ARCH_CONVERT)));
needscan = needlog = 0; needscan = needlog = 0;
oldbest = INT_GET(data->hdr.bestfree[0].length, ARCH_CONVERT); oldbest = be16_to_cpu(data->hdr.bestfree[0].length);
ltp = XFS_DIR2_LEAF_TAIL_P(mp, leaf); ltp = XFS_DIR2_LEAF_TAIL_P(mp, leaf);
bestsp = XFS_DIR2_LEAF_BESTS_P(ltp); bestsp = XFS_DIR2_LEAF_BESTS_P(ltp);
ASSERT(INT_GET(bestsp[db], ARCH_CONVERT) == oldbest); ASSERT(INT_GET(bestsp[db], ARCH_CONVERT) == oldbest);
...@@ -1506,15 +1506,15 @@ xfs_dir2_leaf_removename( ...@@ -1506,15 +1506,15 @@ xfs_dir2_leaf_removename(
* If the longest freespace in the data block has changed, * If the longest freespace in the data block has changed,
* put the new value in the bests table and log that. * put the new value in the bests table and log that.
*/ */
if (INT_GET(data->hdr.bestfree[0].length, ARCH_CONVERT) != oldbest) { if (be16_to_cpu(data->hdr.bestfree[0].length) != oldbest) {
INT_COPY(bestsp[db], data->hdr.bestfree[0].length, ARCH_CONVERT); bestsp[db] = data->hdr.bestfree[0].length;
xfs_dir2_leaf_log_bests(tp, lbp, db, db); xfs_dir2_leaf_log_bests(tp, lbp, db, db);
} }
xfs_dir2_data_check(dp, dbp); xfs_dir2_data_check(dp, dbp);
/* /*
* If the data block is now empty then get rid of the data block. * If the data block is now empty then get rid of the data block.
*/ */
if (INT_GET(data->hdr.bestfree[0].length, ARCH_CONVERT) == if (be16_to_cpu(data->hdr.bestfree[0].length) ==
mp->m_dirblksize - (uint)sizeof(data->hdr)) { mp->m_dirblksize - (uint)sizeof(data->hdr)) {
ASSERT(db != mp->m_dirdatablk); ASSERT(db != mp->m_dirdatablk);
if ((error = xfs_dir2_shrink_inode(args, db, dbp))) { if ((error = xfs_dir2_shrink_inode(args, db, dbp))) {
...@@ -1708,7 +1708,7 @@ xfs_dir2_leaf_trim_data( ...@@ -1708,7 +1708,7 @@ xfs_dir2_leaf_trim_data(
} }
#ifdef DEBUG #ifdef DEBUG
data = dbp->data; data = dbp->data;
ASSERT(INT_GET(data->hdr.magic, ARCH_CONVERT) == XFS_DIR2_DATA_MAGIC); ASSERT(be32_to_cpu(data->hdr.magic) == XFS_DIR2_DATA_MAGIC);
#endif #endif
/* this seems to be an error /* this seems to be an error
* data is only valid if DEBUG is defined? * data is only valid if DEBUG is defined?
...@@ -1717,7 +1717,7 @@ xfs_dir2_leaf_trim_data( ...@@ -1717,7 +1717,7 @@ xfs_dir2_leaf_trim_data(
leaf = lbp->data; leaf = lbp->data;
ltp = XFS_DIR2_LEAF_TAIL_P(mp, leaf); ltp = XFS_DIR2_LEAF_TAIL_P(mp, leaf);
ASSERT(INT_GET(data->hdr.bestfree[0].length, ARCH_CONVERT) == ASSERT(be16_to_cpu(data->hdr.bestfree[0].length) ==
mp->m_dirblksize - (uint)sizeof(data->hdr)); mp->m_dirblksize - (uint)sizeof(data->hdr));
ASSERT(db == INT_GET(ltp->bestcount, ARCH_CONVERT) - 1); ASSERT(db == INT_GET(ltp->bestcount, ARCH_CONVERT) - 1);
/* /*
......
...@@ -894,7 +894,7 @@ xfs_dir2_leafn_remove( ...@@ -894,7 +894,7 @@ xfs_dir2_leafn_remove(
dbp = dblk->bp; dbp = dblk->bp;
data = dbp->data; data = dbp->data;
dep = (xfs_dir2_data_entry_t *)((char *)data + off); dep = (xfs_dir2_data_entry_t *)((char *)data + off);
longest = INT_GET(data->hdr.bestfree[0].length, ARCH_CONVERT); longest = be16_to_cpu(data->hdr.bestfree[0].length);
needlog = needscan = 0; needlog = needscan = 0;
xfs_dir2_data_make_free(tp, dbp, off, xfs_dir2_data_make_free(tp, dbp, off,
XFS_DIR2_DATA_ENTSIZE(dep->namelen), &needlog, &needscan); XFS_DIR2_DATA_ENTSIZE(dep->namelen), &needlog, &needscan);
...@@ -911,7 +911,7 @@ xfs_dir2_leafn_remove( ...@@ -911,7 +911,7 @@ xfs_dir2_leafn_remove(
* If the longest data block freespace changes, need to update * If the longest data block freespace changes, need to update
* the corresponding freeblock entry. * the corresponding freeblock entry.
*/ */
if (longest < INT_GET(data->hdr.bestfree[0].length, ARCH_CONVERT)) { if (longest < be16_to_cpu(data->hdr.bestfree[0].length)) {
int error; /* error return value */ int error; /* error return value */
xfs_dabuf_t *fbp; /* freeblock buffer */ xfs_dabuf_t *fbp; /* freeblock buffer */
xfs_dir2_db_t fdb; /* freeblock block number */ xfs_dir2_db_t fdb; /* freeblock block number */
...@@ -937,7 +937,7 @@ xfs_dir2_leafn_remove( ...@@ -937,7 +937,7 @@ xfs_dir2_leafn_remove(
* Calculate which entry we need to fix. * Calculate which entry we need to fix.
*/ */
findex = XFS_DIR2_DB_TO_FDINDEX(mp, db); findex = XFS_DIR2_DB_TO_FDINDEX(mp, db);
longest = INT_GET(data->hdr.bestfree[0].length, ARCH_CONVERT); longest = be16_to_cpu(data->hdr.bestfree[0].length);
/* /*
* If the data block is now empty we can get rid of it * If the data block is now empty we can get rid of it
* (usually). * (usually).
...@@ -1649,7 +1649,7 @@ xfs_dir2_node_addname_int( ...@@ -1649,7 +1649,7 @@ xfs_dir2_node_addname_int(
* change again. * change again.
*/ */
data = dbp->data; data = dbp->data;
INT_COPY(free->bests[findex], data->hdr.bestfree[0].length, ARCH_CONVERT); free->bests[findex] = data->hdr.bestfree[0].length;
logfree = 1; logfree = 1;
} }
/* /*
...@@ -1677,12 +1677,12 @@ xfs_dir2_node_addname_int( ...@@ -1677,12 +1677,12 @@ xfs_dir2_node_addname_int(
data = dbp->data; data = dbp->data;
logfree = 0; logfree = 0;
} }
ASSERT(INT_GET(data->hdr.bestfree[0].length, ARCH_CONVERT) >= length); ASSERT(be16_to_cpu(data->hdr.bestfree[0].length) >= length);
/* /*
* Point to the existing unused space. * Point to the existing unused space.
*/ */
dup = (xfs_dir2_data_unused_t *) dup = (xfs_dir2_data_unused_t *)
((char *)data + INT_GET(data->hdr.bestfree[0].offset, ARCH_CONVERT)); ((char *)data + be16_to_cpu(data->hdr.bestfree[0].offset));
needscan = needlog = 0; needscan = needlog = 0;
/* /*
* Mark the first part of the unused space, inuse for us. * Mark the first part of the unused space, inuse for us.
...@@ -1713,8 +1713,8 @@ xfs_dir2_node_addname_int( ...@@ -1713,8 +1713,8 @@ xfs_dir2_node_addname_int(
/* /*
* If the freespace entry is now wrong, update it. * If the freespace entry is now wrong, update it.
*/ */
if (INT_GET(free->bests[findex], ARCH_CONVERT) != INT_GET(data->hdr.bestfree[0].length, ARCH_CONVERT)) { if (INT_GET(free->bests[findex], ARCH_CONVERT) != be16_to_cpu(data->hdr.bestfree[0].length)) {
INT_COPY(free->bests[findex], data->hdr.bestfree[0].length, ARCH_CONVERT); free->bests[findex] = data->hdr.bestfree[0].length;
logfree = 1; logfree = 1;
} }
/* /*
...@@ -1900,7 +1900,7 @@ xfs_dir2_node_replace( ...@@ -1900,7 +1900,7 @@ xfs_dir2_node_replace(
* Point to the data entry. * Point to the data entry.
*/ */
data = state->extrablk.bp->data; data = state->extrablk.bp->data;
ASSERT(INT_GET(data->hdr.magic, ARCH_CONVERT) == XFS_DIR2_DATA_MAGIC); ASSERT(be32_to_cpu(data->hdr.magic) == XFS_DIR2_DATA_MAGIC);
dep = (xfs_dir2_data_entry_t *) dep = (xfs_dir2_data_entry_t *)
((char *)data + ((char *)data +
XFS_DIR2_DATAPTR_TO_OFF(state->mp, INT_GET(lep->address, ARCH_CONVERT))); XFS_DIR2_DATAPTR_TO_OFF(state->mp, INT_GET(lep->address, ARCH_CONVERT)));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment