aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r--fs/xfs/xfs_inode.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 7b4f13c710d6..bc33762abc49 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -2352,7 +2352,7 @@ xfs_iroot_realloc(
2352 struct xfs_mount *mp = ip->i_mount; 2352 struct xfs_mount *mp = ip->i_mount;
2353 int cur_max; 2353 int cur_max;
2354 xfs_ifork_t *ifp; 2354 xfs_ifork_t *ifp;
2355 xfs_bmbt_block_t *new_broot; 2355 struct xfs_btree_block *new_broot;
2356 int new_max; 2356 int new_max;
2357 size_t new_size; 2357 size_t new_size;
2358 char *np; 2358 char *np;
@@ -2373,8 +2373,7 @@ xfs_iroot_realloc(
2373 */ 2373 */
2374 if (ifp->if_broot_bytes == 0) { 2374 if (ifp->if_broot_bytes == 0) {
2375 new_size = (size_t)XFS_BMAP_BROOT_SPACE_CALC(rec_diff); 2375 new_size = (size_t)XFS_BMAP_BROOT_SPACE_CALC(rec_diff);
2376 ifp->if_broot = (xfs_bmbt_block_t*)kmem_alloc(new_size, 2376 ifp->if_broot = kmem_alloc(new_size, KM_SLEEP);
2377 KM_SLEEP);
2378 ifp->if_broot_bytes = (int)new_size; 2377 ifp->if_broot_bytes = (int)new_size;
2379 return; 2378 return;
2380 } 2379 }
@@ -2388,9 +2387,7 @@ xfs_iroot_realloc(
2388 cur_max = xfs_bmbt_maxrecs(mp, ifp->if_broot_bytes, 0); 2387 cur_max = xfs_bmbt_maxrecs(mp, ifp->if_broot_bytes, 0);
2389 new_max = cur_max + rec_diff; 2388 new_max = cur_max + rec_diff;
2390 new_size = (size_t)XFS_BMAP_BROOT_SPACE_CALC(new_max); 2389 new_size = (size_t)XFS_BMAP_BROOT_SPACE_CALC(new_max);
2391 ifp->if_broot = (xfs_bmbt_block_t *) 2390 ifp->if_broot = kmem_realloc(ifp->if_broot, new_size,
2392 kmem_realloc(ifp->if_broot,
2393 new_size,
2394 (size_t)XFS_BMAP_BROOT_SPACE_CALC(cur_max), /* old size */ 2391 (size_t)XFS_BMAP_BROOT_SPACE_CALC(cur_max), /* old size */
2395 KM_SLEEP); 2392 KM_SLEEP);
2396 op = (char *)XFS_BMAP_BROOT_PTR_ADDR(mp, ifp->if_broot, 1, 2393 op = (char *)XFS_BMAP_BROOT_PTR_ADDR(mp, ifp->if_broot, 1,
@@ -2418,11 +2415,11 @@ xfs_iroot_realloc(
2418 else 2415 else
2419 new_size = 0; 2416 new_size = 0;
2420 if (new_size > 0) { 2417 if (new_size > 0) {
2421 new_broot = (xfs_bmbt_block_t *)kmem_alloc(new_size, KM_SLEEP); 2418 new_broot = kmem_alloc(new_size, KM_SLEEP);
2422 /* 2419 /*
2423 * First copy over the btree block header. 2420 * First copy over the btree block header.
2424 */ 2421 */
2425 memcpy(new_broot, ifp->if_broot, sizeof(xfs_bmbt_block_t)); 2422 memcpy(new_broot, ifp->if_broot, XFS_BTREE_LBLOCK_LEN);
2426 } else { 2423 } else {
2427 new_broot = NULL; 2424 new_broot = NULL;
2428 ifp->if_flags &= ~XFS_IFBROOT; 2425 ifp->if_flags &= ~XFS_IFBROOT;