diff options
Diffstat (limited to 'fs/xfs/xfs_da_btree.c')
| -rw-r--r-- | fs/xfs/xfs_da_btree.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c index 0ca556b4bf3..30fa0e206fb 100644 --- a/fs/xfs/xfs_da_btree.c +++ b/fs/xfs/xfs_da_btree.c | |||
| @@ -25,19 +25,14 @@ | |||
| 25 | #include "xfs_sb.h" | 25 | #include "xfs_sb.h" |
| 26 | #include "xfs_ag.h" | 26 | #include "xfs_ag.h" |
| 27 | #include "xfs_dir2.h" | 27 | #include "xfs_dir2.h" |
| 28 | #include "xfs_dmapi.h" | ||
| 29 | #include "xfs_mount.h" | 28 | #include "xfs_mount.h" |
| 30 | #include "xfs_da_btree.h" | 29 | #include "xfs_da_btree.h" |
| 31 | #include "xfs_bmap_btree.h" | 30 | #include "xfs_bmap_btree.h" |
| 32 | #include "xfs_alloc_btree.h" | ||
| 33 | #include "xfs_ialloc_btree.h" | ||
| 34 | #include "xfs_dir2_sf.h" | 31 | #include "xfs_dir2_sf.h" |
| 35 | #include "xfs_attr_sf.h" | ||
| 36 | #include "xfs_dinode.h" | 32 | #include "xfs_dinode.h" |
| 37 | #include "xfs_inode.h" | 33 | #include "xfs_inode.h" |
| 38 | #include "xfs_inode_item.h" | 34 | #include "xfs_inode_item.h" |
| 39 | #include "xfs_alloc.h" | 35 | #include "xfs_alloc.h" |
| 40 | #include "xfs_btree.h" | ||
| 41 | #include "xfs_bmap.h" | 36 | #include "xfs_bmap.h" |
| 42 | #include "xfs_attr.h" | 37 | #include "xfs_attr.h" |
| 43 | #include "xfs_attr_leaf.h" | 38 | #include "xfs_attr_leaf.h" |
| @@ -581,16 +576,14 @@ xfs_da_node_add(xfs_da_state_t *state, xfs_da_state_blk_t *oldblk, | |||
| 581 | xfs_da_intnode_t *node; | 576 | xfs_da_intnode_t *node; |
| 582 | xfs_da_node_entry_t *btree; | 577 | xfs_da_node_entry_t *btree; |
| 583 | int tmp; | 578 | int tmp; |
| 584 | xfs_mount_t *mp; | ||
| 585 | 579 | ||
| 586 | node = oldblk->bp->data; | 580 | node = oldblk->bp->data; |
| 587 | mp = state->mp; | ||
| 588 | ASSERT(be16_to_cpu(node->hdr.info.magic) == XFS_DA_NODE_MAGIC); | 581 | ASSERT(be16_to_cpu(node->hdr.info.magic) == XFS_DA_NODE_MAGIC); |
| 589 | ASSERT((oldblk->index >= 0) && (oldblk->index <= be16_to_cpu(node->hdr.count))); | 582 | ASSERT((oldblk->index >= 0) && (oldblk->index <= be16_to_cpu(node->hdr.count))); |
| 590 | ASSERT(newblk->blkno != 0); | 583 | ASSERT(newblk->blkno != 0); |
| 591 | if (state->args->whichfork == XFS_DATA_FORK) | 584 | if (state->args->whichfork == XFS_DATA_FORK) |
| 592 | ASSERT(newblk->blkno >= mp->m_dirleafblk && | 585 | ASSERT(newblk->blkno >= state->mp->m_dirleafblk && |
| 593 | newblk->blkno < mp->m_dirfreeblk); | 586 | newblk->blkno < state->mp->m_dirfreeblk); |
| 594 | 587 | ||
| 595 | /* | 588 | /* |
| 596 | * We may need to make some room before we insert the new node. | 589 | * We may need to make some room before we insert the new node. |
| @@ -1601,7 +1594,7 @@ xfs_da_grow_inode(xfs_da_args_t *args, xfs_dablk_t *new_blkno) | |||
| 1601 | xfs_bmapi_aflag(w)|XFS_BMAPI_WRITE|XFS_BMAPI_METADATA| | 1594 | xfs_bmapi_aflag(w)|XFS_BMAPI_WRITE|XFS_BMAPI_METADATA| |
| 1602 | XFS_BMAPI_CONTIG, | 1595 | XFS_BMAPI_CONTIG, |
| 1603 | args->firstblock, args->total, &map, &nmap, | 1596 | args->firstblock, args->total, &map, &nmap, |
| 1604 | args->flist, NULL))) { | 1597 | args->flist))) { |
| 1605 | return error; | 1598 | return error; |
| 1606 | } | 1599 | } |
| 1607 | ASSERT(nmap <= 1); | 1600 | ASSERT(nmap <= 1); |
| @@ -1622,8 +1615,7 @@ xfs_da_grow_inode(xfs_da_args_t *args, xfs_dablk_t *new_blkno) | |||
| 1622 | xfs_bmapi_aflag(w)|XFS_BMAPI_WRITE| | 1615 | xfs_bmapi_aflag(w)|XFS_BMAPI_WRITE| |
| 1623 | XFS_BMAPI_METADATA, | 1616 | XFS_BMAPI_METADATA, |
| 1624 | args->firstblock, args->total, | 1617 | args->firstblock, args->total, |
| 1625 | &mapp[mapi], &nmap, args->flist, | 1618 | &mapp[mapi], &nmap, args->flist))) { |
| 1626 | NULL))) { | ||
| 1627 | kmem_free(mapp); | 1619 | kmem_free(mapp); |
| 1628 | return error; | 1620 | return error; |
| 1629 | } | 1621 | } |
| @@ -1884,7 +1876,7 @@ xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno, | |||
| 1884 | */ | 1876 | */ |
| 1885 | if ((error = xfs_bunmapi(tp, dp, dead_blkno, count, | 1877 | if ((error = xfs_bunmapi(tp, dp, dead_blkno, count, |
| 1886 | xfs_bmapi_aflag(w)|XFS_BMAPI_METADATA, | 1878 | xfs_bmapi_aflag(w)|XFS_BMAPI_METADATA, |
| 1887 | 0, args->firstblock, args->flist, NULL, | 1879 | 0, args->firstblock, args->flist, |
| 1888 | &done)) == ENOSPC) { | 1880 | &done)) == ENOSPC) { |
| 1889 | if (w != XFS_DATA_FORK) | 1881 | if (w != XFS_DATA_FORK) |
| 1890 | break; | 1882 | break; |
| @@ -1989,7 +1981,7 @@ xfs_da_do_buf( | |||
| 1989 | nfsb, | 1981 | nfsb, |
| 1990 | XFS_BMAPI_METADATA | | 1982 | XFS_BMAPI_METADATA | |
| 1991 | xfs_bmapi_aflag(whichfork), | 1983 | xfs_bmapi_aflag(whichfork), |
| 1992 | NULL, 0, mapp, &nmap, NULL, NULL))) | 1984 | NULL, 0, mapp, &nmap, NULL))) |
| 1993 | goto exit0; | 1985 | goto exit0; |
| 1994 | } | 1986 | } |
| 1995 | } else { | 1987 | } else { |
