aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_symlink.c
diff options
context:
space:
mode:
authorJie Liu <jeff.liu@oracle.com>2013-08-12 06:49:59 -0400
committerBen Myers <bpm@sgi.com>2013-08-12 18:47:34 -0400
commit3d3c8b5222b92447bffaa4127ee18c757f32a460 (patch)
tree250f3b61679231944b5272d18d17e6ceabfc62d1 /fs/xfs/xfs_symlink.c
parent783cb6d172358892d6af394ebe2876bcbfcc6499 (diff)
xfs: refactor xfs_trans_reserve() interface
With the new xfs_trans_res structure has been introduced, the log reservation size, log count as well as log flags are pre-initialized at mount time. So it's time to refine xfs_trans_reserve() interface to be more neat. Also, introduce a new helper M_RES() to return a pointer to the mp->m_resv structure to simplify the input. Signed-off-by: Jie Liu <jeff.liu@oracle.com> Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_symlink.c')
-rw-r--r--fs/xfs/xfs_symlink.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c
index e6facbf7043e..7676fe3d706d 100644
--- a/fs/xfs/xfs_symlink.c
+++ b/fs/xfs/xfs_symlink.c
@@ -231,12 +231,10 @@ xfs_symlink(
231 else 231 else
232 fs_blocks = xfs_symlink_blocks(mp, pathlen); 232 fs_blocks = xfs_symlink_blocks(mp, pathlen);
233 resblks = XFS_SYMLINK_SPACE_RES(mp, link_name->len, fs_blocks); 233 resblks = XFS_SYMLINK_SPACE_RES(mp, link_name->len, fs_blocks);
234 error = xfs_trans_reserve(tp, resblks, XFS_SYMLINK_LOG_RES(mp), 0, 234 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_symlink, resblks, 0);
235 XFS_TRANS_PERM_LOG_RES, XFS_SYMLINK_LOG_COUNT);
236 if (error == ENOSPC && fs_blocks == 0) { 235 if (error == ENOSPC && fs_blocks == 0) {
237 resblks = 0; 236 resblks = 0;
238 error = xfs_trans_reserve(tp, 0, XFS_SYMLINK_LOG_RES(mp), 0, 237 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_symlink, 0, 0);
239 XFS_TRANS_PERM_LOG_RES, XFS_SYMLINK_LOG_COUNT);
240 } 238 }
241 if (error) { 239 if (error) {
242 cancel_flags = 0; 240 cancel_flags = 0;
@@ -539,8 +537,8 @@ xfs_inactive_symlink_rmt(
539 * Put an itruncate log reservation in the new transaction 537 * Put an itruncate log reservation in the new transaction
540 * for our caller. 538 * for our caller.
541 */ 539 */
542 if ((error = xfs_trans_reserve(tp, 0, XFS_ITRUNCATE_LOG_RES(mp), 0, 540 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0);
543 XFS_TRANS_PERM_LOG_RES, XFS_ITRUNCATE_LOG_COUNT))) { 541 if (error) {
544 ASSERT(XFS_FORCED_SHUTDOWN(mp)); 542 ASSERT(XFS_FORCED_SHUTDOWN(mp));
545 goto error0; 543 goto error0;
546 } 544 }