aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_vnodeops.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r--fs/xfs/xfs_vnodeops.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 0176bb21f09a..dc730ac272be 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -322,18 +322,9 @@ xfs_inactive(
322 xfs_trans_ijoin(tp, ip, 0); 322 xfs_trans_ijoin(tp, ip, 0);
323 323
324 if (S_ISLNK(ip->i_d.di_mode)) { 324 if (S_ISLNK(ip->i_d.di_mode)) {
325 /* 325 error = xfs_inactive_symlink(ip, &tp);
326 * Zero length symlinks _can_ exist. 326 if (error)
327 */ 327 goto out_cancel;
328 if (ip->i_d.di_size > XFS_IFORK_DSIZE(ip)) {
329 error = xfs_inactive_symlink_rmt(ip, &tp);
330 if (error)
331 goto out_cancel;
332 } else if (ip->i_df.if_bytes > 0) {
333 xfs_idata_realloc(ip, -(ip->i_df.if_bytes),
334 XFS_DATA_FORK);
335 ASSERT(ip->i_df.if_bytes == 0);
336 }
337 } else if (truncate) { 328 } else if (truncate) {
338 ip->i_d.di_size = 0; 329 ip->i_d.di_size = 0;
339 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); 330 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
@@ -498,6 +489,7 @@ xfs_create(
498 prid_t prid; 489 prid_t prid;
499 struct xfs_dquot *udqp = NULL; 490 struct xfs_dquot *udqp = NULL;
500 struct xfs_dquot *gdqp = NULL; 491 struct xfs_dquot *gdqp = NULL;
492 struct xfs_dquot *pdqp = NULL;
501 uint resblks; 493 uint resblks;
502 uint log_res; 494 uint log_res;
503 uint log_count; 495 uint log_count;
@@ -516,7 +508,8 @@ xfs_create(
516 * Make sure that we have allocated dquot(s) on disk. 508 * Make sure that we have allocated dquot(s) on disk.
517 */ 509 */
518 error = xfs_qm_vop_dqalloc(dp, current_fsuid(), current_fsgid(), prid, 510 error = xfs_qm_vop_dqalloc(dp, current_fsuid(), current_fsgid(), prid,
519 XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT, &udqp, &gdqp); 511 XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT,
512 &udqp, &gdqp, &pdqp);
520 if (error) 513 if (error)
521 return error; 514 return error;
522 515
@@ -568,7 +561,8 @@ xfs_create(
568 /* 561 /*
569 * Reserve disk quota and the inode. 562 * Reserve disk quota and the inode.
570 */ 563 */
571 error = xfs_trans_reserve_quota(tp, mp, udqp, gdqp, resblks, 1, 0); 564 error = xfs_trans_reserve_quota(tp, mp, udqp, gdqp,
565 pdqp, resblks, 1, 0);
572 if (error) 566 if (error)
573 goto out_trans_cancel; 567 goto out_trans_cancel;
574 568
@@ -632,7 +626,7 @@ xfs_create(
632 * These ids of the inode couldn't have changed since the new 626 * These ids of the inode couldn't have changed since the new
633 * inode has been locked ever since it was created. 627 * inode has been locked ever since it was created.
634 */ 628 */
635 xfs_qm_vop_create_dqattach(tp, ip, udqp, gdqp); 629 xfs_qm_vop_create_dqattach(tp, ip, udqp, gdqp, pdqp);
636 630
637 error = xfs_bmap_finish(&tp, &free_list, &committed); 631 error = xfs_bmap_finish(&tp, &free_list, &committed);
638 if (error) 632 if (error)
@@ -644,6 +638,7 @@ xfs_create(
644 638
645 xfs_qm_dqrele(udqp); 639 xfs_qm_dqrele(udqp);
646 xfs_qm_dqrele(gdqp); 640 xfs_qm_dqrele(gdqp);
641 xfs_qm_dqrele(pdqp);
647 642
648 *ipp = ip; 643 *ipp = ip;
649 return 0; 644 return 0;
@@ -665,6 +660,7 @@ xfs_create(
665 660
666 xfs_qm_dqrele(udqp); 661 xfs_qm_dqrele(udqp);
667 xfs_qm_dqrele(gdqp); 662 xfs_qm_dqrele(gdqp);
663 xfs_qm_dqrele(pdqp);
668 664
669 if (unlock_dp_on_error) 665 if (unlock_dp_on_error)
670 xfs_iunlock(dp, XFS_ILOCK_EXCL); 666 xfs_iunlock(dp, XFS_ILOCK_EXCL);
@@ -1577,7 +1573,7 @@ xfs_free_file_space(
1577 } 1573 }
1578 xfs_ilock(ip, XFS_ILOCK_EXCL); 1574 xfs_ilock(ip, XFS_ILOCK_EXCL);
1579 error = xfs_trans_reserve_quota(tp, mp, 1575 error = xfs_trans_reserve_quota(tp, mp,
1580 ip->i_udquot, ip->i_gdquot, 1576 ip->i_udquot, ip->i_gdquot, ip->i_pdquot,
1581 resblks, 0, XFS_QMOPT_RES_REGBLKS); 1577 resblks, 0, XFS_QMOPT_RES_REGBLKS);
1582 if (error) 1578 if (error)
1583 goto error1; 1579 goto error1;