aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_attr.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_attr.c')
-rw-r--r--fs/xfs/xfs_attr.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c
index 046cf3d7f52f..176dbb66282d 100644
--- a/fs/xfs/xfs_attr.c
+++ b/fs/xfs/xfs_attr.c
@@ -226,13 +226,14 @@ xfs_attr_set_int(
226 int valuelen, 226 int valuelen,
227 int flags) 227 int flags)
228{ 228{
229 xfs_da_args_t args; 229 xfs_da_args_t args;
230 xfs_fsblock_t firstblock; 230 xfs_fsblock_t firstblock;
231 xfs_bmap_free_t flist; 231 xfs_bmap_free_t flist;
232 int error, err2, committed; 232 int error, err2, committed;
233 xfs_mount_t *mp = dp->i_mount; 233 struct xfs_mount *mp = dp->i_mount;
234 int rsvd = (flags & ATTR_ROOT) != 0; 234 struct xfs_trans_res tres;
235 int local; 235 int rsvd = (flags & ATTR_ROOT) != 0;
236 int local;
236 237
237 /* 238 /*
238 * Attach the dquots to the inode. 239 * Attach the dquots to the inode.
@@ -292,11 +293,11 @@ xfs_attr_set_int(
292 if (rsvd) 293 if (rsvd)
293 args.trans->t_flags |= XFS_TRANS_RESERVE; 294 args.trans->t_flags |= XFS_TRANS_RESERVE;
294 295
295 error = xfs_trans_reserve(args.trans, args.total, 296 tres.tr_logres = M_RES(mp)->tr_attrsetm.tr_logres +
296 XFS_ATTRSETM_LOG_RES(mp) + 297 M_RES(mp)->tr_attrsetrt.tr_logres * args.total;
297 XFS_ATTRSETRT_LOG_RES(mp) * args.total, 298 tres.tr_logcount = XFS_ATTRSET_LOG_COUNT;
298 0, XFS_TRANS_PERM_LOG_RES, 299 tres.tr_logflags = XFS_TRANS_PERM_LOG_RES;
299 XFS_ATTRSET_LOG_COUNT); 300 error = xfs_trans_reserve(args.trans, &tres, args.total, 0);
300 if (error) { 301 if (error) {
301 xfs_trans_cancel(args.trans, 0); 302 xfs_trans_cancel(args.trans, 0);
302 return(error); 303 return(error);
@@ -516,11 +517,9 @@ xfs_attr_remove_int(xfs_inode_t *dp, struct xfs_name *name, int flags)
516 if (flags & ATTR_ROOT) 517 if (flags & ATTR_ROOT)
517 args.trans->t_flags |= XFS_TRANS_RESERVE; 518 args.trans->t_flags |= XFS_TRANS_RESERVE;
518 519
519 if ((error = xfs_trans_reserve(args.trans, 520 error = xfs_trans_reserve(args.trans, &M_RES(mp)->tr_attrrm,
520 XFS_ATTRRM_SPACE_RES(mp), 521 XFS_ATTRRM_SPACE_RES(mp), 0);
521 XFS_ATTRRM_LOG_RES(mp), 522 if (error) {
522 0, XFS_TRANS_PERM_LOG_RES,
523 XFS_ATTRRM_LOG_COUNT))) {
524 xfs_trans_cancel(args.trans, 0); 523 xfs_trans_cancel(args.trans, 0);
525 return(error); 524 return(error);
526 } 525 }