Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23135
b: refs/heads/master
c: 68b3a10
h: refs/heads/master
i:
  23133: f263104
  23131: 7084849
  23127: 1353477
  23119: ae2cd7e
  23103: 668d324
v: v3
  • Loading branch information
Nathan Scott committed Mar 17, 2006
1 parent 0b01109 commit 920fefc
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0ba962ef7128d9276b8f95196382d5b9e2ad841d
refs/heads/master: 68b3a1024a7cda4afaacb3d25e6ac234ddfc0834
4 changes: 2 additions & 2 deletions trunk/fs/xfs/xfs_dir2_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ xfs_dir2_leaf_to_block(
xfs_dabuf_t *lbp, /* leaf buffer */
xfs_dabuf_t *dbp) /* data buffer */
{
xfs_dir2_data_off_t *bestsp; /* leaf bests table */
__be16 *bestsp; /* leaf bests table */
xfs_dir2_block_t *block; /* block structure */
xfs_dir2_block_tail_t *btp; /* block tail */
xfs_inode_t *dp; /* incore directory inode */
Expand Down Expand Up @@ -914,7 +914,7 @@ xfs_dir2_leaf_to_block(
*/
while (dp->i_d.di_size > mp->m_dirblksize) {
bestsp = XFS_DIR2_LEAF_BESTS_P(ltp);
if (INT_GET(bestsp[INT_GET(ltp->bestcount, ARCH_CONVERT) - 1], ARCH_CONVERT) ==
if (be16_to_cpu(bestsp[INT_GET(ltp->bestcount, ARCH_CONVERT) - 1]) ==
mp->m_dirblksize - (uint)sizeof(block->hdr)) {
if ((error =
xfs_dir2_leaf_trim_data(args, lbp,
Expand Down
30 changes: 15 additions & 15 deletions trunk/fs/xfs/xfs_dir2_leaf.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ xfs_dir2_block_to_leaf(
xfs_da_args_t *args, /* operation arguments */
xfs_dabuf_t *dbp) /* input block's buffer */
{
xfs_dir2_data_off_t *bestsp; /* leaf's bestsp entries */
__be16 *bestsp; /* leaf's bestsp entries */
xfs_dablk_t blkno; /* leaf block's bno */
xfs_dir2_block_t *block; /* block structure */
xfs_dir2_leaf_entry_t *blp; /* block's leaf entries */
Expand Down Expand Up @@ -163,7 +163,7 @@ int /* error */
xfs_dir2_leaf_addname(
xfs_da_args_t *args) /* operation arguments */
{
xfs_dir2_data_off_t *bestsp; /* freespace table in leaf */
__be16 *bestsp; /* freespace table in leaf */
int compact; /* need to compact leaves */
xfs_dir2_data_t *data; /* data block structure */
xfs_dabuf_t *dbp; /* data block buffer */
Expand Down Expand Up @@ -228,8 +228,8 @@ xfs_dir2_leaf_addname(
continue;
i = XFS_DIR2_DATAPTR_TO_DB(mp, INT_GET(lep->address, ARCH_CONVERT));
ASSERT(i < INT_GET(ltp->bestcount, ARCH_CONVERT));
ASSERT(INT_GET(bestsp[i], ARCH_CONVERT) != NULLDATAOFF);
if (INT_GET(bestsp[i], ARCH_CONVERT) >= length) {
ASSERT(be16_to_cpu(bestsp[i]) != NULLDATAOFF);
if (be16_to_cpu(bestsp[i]) >= length) {
use_block = i;
break;
}
Expand All @@ -242,9 +242,9 @@ xfs_dir2_leaf_addname(
/*
* Remember a block we see that's missing.
*/
if (INT_GET(bestsp[i], ARCH_CONVERT) == NULLDATAOFF && use_block == -1)
if (be16_to_cpu(bestsp[i]) == NULLDATAOFF && use_block == -1)
use_block = i;
else if (INT_GET(bestsp[i], ARCH_CONVERT) >= length) {
else if (be16_to_cpu(bestsp[i]) >= length) {
use_block = i;
break;
}
Expand All @@ -260,7 +260,7 @@ xfs_dir2_leaf_addname(
* Now kill use_block if it refers to a missing block, so we
* can use it as an indication of allocation needed.
*/
if (use_block != -1 && INT_GET(bestsp[use_block], ARCH_CONVERT) == NULLDATAOFF)
if (use_block != -1 && be16_to_cpu(bestsp[use_block]) == NULLDATAOFF)
use_block = -1;
/*
* If we don't have enough free bytes but we can make enough
Expand Down Expand Up @@ -427,7 +427,7 @@ xfs_dir2_leaf_addname(
* If the bests table needs to be changed, do it.
* Log the change unless we've already done that.
*/
if (INT_GET(bestsp[use_block], ARCH_CONVERT) != be16_to_cpu(data->hdr.bestfree[0].length)) {
if (be16_to_cpu(bestsp[use_block]) != be16_to_cpu(data->hdr.bestfree[0].length)) {
bestsp[use_block] = data->hdr.bestfree[0].length;
if (!grown)
xfs_dir2_leaf_log_bests(tp, lbp, use_block, use_block);
Expand Down Expand Up @@ -1203,8 +1203,8 @@ xfs_dir2_leaf_log_bests(
int first, /* first entry to log */
int last) /* last entry to log */
{
xfs_dir2_data_off_t *firstb; /* pointer to first entry */
xfs_dir2_data_off_t *lastb; /* pointer to last entry */
__be16 *firstb; /* pointer to first entry */
__be16 *lastb; /* pointer to last entry */
xfs_dir2_leaf_t *leaf; /* leaf structure */
xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */

Expand Down Expand Up @@ -1437,7 +1437,7 @@ int /* error */
xfs_dir2_leaf_removename(
xfs_da_args_t *args) /* operation arguments */
{
xfs_dir2_data_off_t *bestsp; /* leaf block best freespace */
__be16 *bestsp; /* leaf block best freespace */
xfs_dir2_data_t *data; /* data block structure */
xfs_dir2_db_t db; /* data block number */
xfs_dabuf_t *dbp; /* data block buffer */
Expand Down Expand Up @@ -1480,7 +1480,7 @@ xfs_dir2_leaf_removename(
oldbest = be16_to_cpu(data->hdr.bestfree[0].length);
ltp = XFS_DIR2_LEAF_TAIL_P(mp, leaf);
bestsp = XFS_DIR2_LEAF_BESTS_P(ltp);
ASSERT(INT_GET(bestsp[db], ARCH_CONVERT) == oldbest);
ASSERT(be16_to_cpu(bestsp[db]) == oldbest);
/*
* Mark the former data entry unused.
*/
Expand Down Expand Up @@ -1542,7 +1542,7 @@ xfs_dir2_leaf_removename(
* Look for the last active entry (i).
*/
for (i = db - 1; i > 0; i--) {
if (INT_GET(bestsp[i], ARCH_CONVERT) != NULLDATAOFF)
if (be16_to_cpu(bestsp[i]) != NULLDATAOFF)
break;
}
/*
Expand All @@ -1555,7 +1555,7 @@ xfs_dir2_leaf_removename(
xfs_dir2_leaf_log_tail(tp, lbp);
xfs_dir2_leaf_log_bests(tp, lbp, 0, INT_GET(ltp->bestcount, ARCH_CONVERT) - 1);
} else
INT_SET(bestsp[db], ARCH_CONVERT, NULLDATAOFF);
bestsp[db] = cpu_to_be16(NULLDATAOFF);
}
/*
* If the data block was not the first one, drop it.
Expand Down Expand Up @@ -1684,7 +1684,7 @@ xfs_dir2_leaf_trim_data(
xfs_dabuf_t *lbp, /* leaf buffer */
xfs_dir2_db_t db) /* data block number */
{
xfs_dir2_data_off_t *bestsp; /* leaf bests table */
__be16 *bestsp; /* leaf bests table */
#ifdef DEBUG
xfs_dir2_data_t *data; /* data block structure */
#endif
Expand Down
5 changes: 2 additions & 3 deletions trunk/fs/xfs/xfs_dir2_leaf.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,10 @@ xfs_dir2_leaf_tail_p(struct xfs_mount *mp, xfs_dir2_leaf_t *lp)
* Get address of the bests array in the single-leaf block.
*/
#define XFS_DIR2_LEAF_BESTS_P(ltp) xfs_dir2_leaf_bests_p(ltp)
static inline xfs_dir2_data_off_t *
static inline __be16 *
xfs_dir2_leaf_bests_p(xfs_dir2_leaf_tail_t *ltp)
{
return (xfs_dir2_data_off_t *)
(ltp) - INT_GET((ltp)->bestcount, ARCH_CONVERT);
return (__be16 *)(ltp) - INT_GET((ltp)->bestcount, ARCH_CONVERT);
}

/*
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/xfs/xfs_dir2_node.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ xfs_dir2_leaf_to_node(
xfs_dabuf_t *fbp; /* freespace buffer */
xfs_dir2_db_t fdb; /* freespace block number */
xfs_dir2_free_t *free; /* freespace structure */
xfs_dir2_data_off_t *from; /* pointer to freespace entry */
__be16 *from; /* pointer to freespace entry */
int i; /* leaf freespace index */
xfs_dir2_leaf_t *leaf; /* leaf structure */
xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */
Expand Down Expand Up @@ -159,7 +159,7 @@ xfs_dir2_leaf_to_node(
*/
for (i = n = 0, from = XFS_DIR2_LEAF_BESTS_P(ltp), to = free->bests;
i < INT_GET(ltp->bestcount, ARCH_CONVERT); i++, from++, to++) {
if ((off = INT_GET(*from, ARCH_CONVERT)) != NULLDATAOFF)
if ((off = be16_to_cpu(*from)) != NULLDATAOFF)
n++;
*to = cpu_to_be16(off);
}
Expand Down

0 comments on commit 920fefc

Please sign in to comment.