diff options
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_dinode.h | 3 | ||||
-rw-r--r-- | fs/xfs/xfs_inode.c | 14 |
2 files changed, 7 insertions, 10 deletions
diff --git a/fs/xfs/xfs_dinode.h b/fs/xfs/xfs_dinode.h index f7a0e95d197a..07d735a80a0f 100644 --- a/fs/xfs/xfs_dinode.h +++ b/fs/xfs/xfs_dinode.h | |||
@@ -132,9 +132,6 @@ typedef enum xfs_dinode_fmt { | |||
132 | #define XFS_LITINO(mp, version) \ | 132 | #define XFS_LITINO(mp, version) \ |
133 | ((int)(((mp)->m_sb.sb_inodesize) - xfs_dinode_size(version))) | 133 | ((int)(((mp)->m_sb.sb_inodesize) - xfs_dinode_size(version))) |
134 | 134 | ||
135 | #define XFS_BROOT_SIZE_ADJ(ip) \ | ||
136 | (XFS_BMBT_BLOCK_LEN((ip)->i_mount) - sizeof(xfs_bmdr_block_t)) | ||
137 | |||
138 | /* | 135 | /* |
139 | * Inode data & attribute fork sizes, per inode. | 136 | * Inode data & attribute fork sizes, per inode. |
140 | */ | 137 | */ |
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 9ecfe1e559fc..b78481f99d9d 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -2156,8 +2156,8 @@ xfs_iroot_realloc( | |||
2156 | np = (char *)XFS_BMAP_BROOT_PTR_ADDR(mp, ifp->if_broot, 1, | 2156 | np = (char *)XFS_BMAP_BROOT_PTR_ADDR(mp, ifp->if_broot, 1, |
2157 | (int)new_size); | 2157 | (int)new_size); |
2158 | ifp->if_broot_bytes = (int)new_size; | 2158 | ifp->if_broot_bytes = (int)new_size; |
2159 | ASSERT(ifp->if_broot_bytes <= | 2159 | ASSERT(XFS_BMAP_BMDR_SPACE(ifp->if_broot) <= |
2160 | XFS_IFORK_SIZE(ip, whichfork) + XFS_BROOT_SIZE_ADJ(ip)); | 2160 | XFS_IFORK_SIZE(ip, whichfork)); |
2161 | memmove(np, op, cur_max * (uint)sizeof(xfs_dfsbno_t)); | 2161 | memmove(np, op, cur_max * (uint)sizeof(xfs_dfsbno_t)); |
2162 | return; | 2162 | return; |
2163 | } | 2163 | } |
@@ -2210,8 +2210,9 @@ xfs_iroot_realloc( | |||
2210 | kmem_free(ifp->if_broot); | 2210 | kmem_free(ifp->if_broot); |
2211 | ifp->if_broot = new_broot; | 2211 | ifp->if_broot = new_broot; |
2212 | ifp->if_broot_bytes = (int)new_size; | 2212 | ifp->if_broot_bytes = (int)new_size; |
2213 | ASSERT(ifp->if_broot_bytes <= | 2213 | if (ifp->if_broot) |
2214 | XFS_IFORK_SIZE(ip, whichfork) + XFS_BROOT_SIZE_ADJ(ip)); | 2214 | ASSERT(XFS_BMAP_BMDR_SPACE(ifp->if_broot) <= |
2215 | XFS_IFORK_SIZE(ip, whichfork)); | ||
2215 | return; | 2216 | return; |
2216 | } | 2217 | } |
2217 | 2218 | ||
@@ -2522,9 +2523,8 @@ xfs_iflush_fork( | |||
2522 | if ((iip->ili_fields & brootflag[whichfork]) && | 2523 | if ((iip->ili_fields & brootflag[whichfork]) && |
2523 | (ifp->if_broot_bytes > 0)) { | 2524 | (ifp->if_broot_bytes > 0)) { |
2524 | ASSERT(ifp->if_broot != NULL); | 2525 | ASSERT(ifp->if_broot != NULL); |
2525 | ASSERT(ifp->if_broot_bytes <= | 2526 | ASSERT(XFS_BMAP_BMDR_SPACE(ifp->if_broot) <= |
2526 | (XFS_IFORK_SIZE(ip, whichfork) + | 2527 | XFS_IFORK_SIZE(ip, whichfork)); |
2527 | XFS_BROOT_SIZE_ADJ(ip))); | ||
2528 | xfs_bmbt_to_bmdr(mp, ifp->if_broot, ifp->if_broot_bytes, | 2528 | xfs_bmbt_to_bmdr(mp, ifp->if_broot, ifp->if_broot_bytes, |
2529 | (xfs_bmdr_block_t *)cp, | 2529 | (xfs_bmdr_block_t *)cp, |
2530 | XFS_DFORK_SIZE(dip, mp, whichfork)); | 2530 | XFS_DFORK_SIZE(dip, mp, whichfork)); |