diff options
author | Dave Chinner <david@fromorbit.com> | 2014-03-13 09:13:05 +0100 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2014-03-13 09:13:05 +0100 |
commit | 5f44e4c185ec5a4a438841cbd4983d0c4a106a4a (patch) | |
tree | 894419c679250407eb7a76af9d1525c47226a085 /fs/xfs/xfs_trans_resv.c | |
parent | Merge branch 'xfs-verifier-cleanup' into for-next (diff) | |
parent | xfs: inode log reservations are still too small (diff) | |
download | linux-5f44e4c185ec5a4a438841cbd4983d0c4a106a4a.tar.xz linux-5f44e4c185ec5a4a438841cbd4983d0c4a106a4a.zip |
Merge branch 'xfs-bug-fixes-for-3.15-2' into for-next
Diffstat (limited to 'fs/xfs/xfs_trans_resv.c')
-rw-r--r-- | fs/xfs/xfs_trans_resv.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/fs/xfs/xfs_trans_resv.c b/fs/xfs/xfs_trans_resv.c index 8515b0449dc8..d2c8e4a6ee2a 100644 --- a/fs/xfs/xfs_trans_resv.c +++ b/fs/xfs/xfs_trans_resv.c @@ -81,20 +81,28 @@ xfs_calc_buf_res( * on disk. Hence we need an inode reservation function that calculates all this * correctly. So, we log: * - * - log op headers for object + * - 4 log op headers for object + * - for the ilf, the inode core and 2 forks * - inode log format object - * - the entire inode contents (core + 2 forks) - * - two bmap btree block headers + * - the inode core + * - two inode forks containing bmap btree root blocks. + * - the btree data contained by both forks will fit into the inode size, + * hence when combined with the inode core above, we have a total of the + * actual inode size. + * - the BMBT headers need to be accounted separately, as they are + * additional to the records and pointers that fit inside the inode + * forks. */ STATIC uint xfs_calc_inode_res( struct xfs_mount *mp, uint ninodes) { - return ninodes * (sizeof(struct xlog_op_header) + - sizeof(struct xfs_inode_log_format) + - mp->m_sb.sb_inodesize + - 2 * XFS_BMBT_BLOCK_LEN(mp)); + return ninodes * + (4 * sizeof(struct xlog_op_header) + + sizeof(struct xfs_inode_log_format) + + mp->m_sb.sb_inodesize + + 2 * XFS_BMBT_BLOCK_LEN(mp)); } /* |