diff options
author | Chandra Seetharaman <sekharan@us.ibm.com> | 2013-07-11 01:00:40 -0400 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2013-07-11 11:35:32 -0400 |
commit | 92f8ff73f18672b03ec8b92197cdddf2b5de7ea0 (patch) | |
tree | b90205ed9a1e141d8ac5d096f4d8984e89774d2e /fs/xfs/xfs_vnodeops.c | |
parent | 42c49d7f249c2487f36d3314753d5d8ebcee8249 (diff) |
xfs: Add pquota fields where gquota is used.
Add project quota changes to all the places where group quota field
is used:
* add separate project quota members into various structures
* split project quota and group quotas so that instead of overriding
the group quota members incore, the new project quota members are
used instead
* get rid of usage of the OQUOTA flag incore, in favor of separate
group and project quota flags.
* add a project dquot argument to various functions.
Not using the pquotino field from superblock yet.
Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r-- | fs/xfs/xfs_vnodeops.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 42c0ef288aeb..dc730ac272be 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -489,6 +489,7 @@ xfs_create( | |||
489 | prid_t prid; | 489 | prid_t prid; |
490 | struct xfs_dquot *udqp = NULL; | 490 | struct xfs_dquot *udqp = NULL; |
491 | struct xfs_dquot *gdqp = NULL; | 491 | struct xfs_dquot *gdqp = NULL; |
492 | struct xfs_dquot *pdqp = NULL; | ||
492 | uint resblks; | 493 | uint resblks; |
493 | uint log_res; | 494 | uint log_res; |
494 | uint log_count; | 495 | uint log_count; |
@@ -507,7 +508,8 @@ xfs_create( | |||
507 | * Make sure that we have allocated dquot(s) on disk. | 508 | * Make sure that we have allocated dquot(s) on disk. |
508 | */ | 509 | */ |
509 | error = xfs_qm_vop_dqalloc(dp, current_fsuid(), current_fsgid(), prid, | 510 | error = xfs_qm_vop_dqalloc(dp, current_fsuid(), current_fsgid(), prid, |
510 | XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT, &udqp, &gdqp); | 511 | XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT, |
512 | &udqp, &gdqp, &pdqp); | ||
511 | if (error) | 513 | if (error) |
512 | return error; | 514 | return error; |
513 | 515 | ||
@@ -559,7 +561,8 @@ xfs_create( | |||
559 | /* | 561 | /* |
560 | * Reserve disk quota and the inode. | 562 | * Reserve disk quota and the inode. |
561 | */ | 563 | */ |
562 | 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); | ||
563 | if (error) | 566 | if (error) |
564 | goto out_trans_cancel; | 567 | goto out_trans_cancel; |
565 | 568 | ||
@@ -623,7 +626,7 @@ xfs_create( | |||
623 | * 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 |
624 | * inode has been locked ever since it was created. | 627 | * inode has been locked ever since it was created. |
625 | */ | 628 | */ |
626 | xfs_qm_vop_create_dqattach(tp, ip, udqp, gdqp); | 629 | xfs_qm_vop_create_dqattach(tp, ip, udqp, gdqp, pdqp); |
627 | 630 | ||
628 | error = xfs_bmap_finish(&tp, &free_list, &committed); | 631 | error = xfs_bmap_finish(&tp, &free_list, &committed); |
629 | if (error) | 632 | if (error) |
@@ -635,6 +638,7 @@ xfs_create( | |||
635 | 638 | ||
636 | xfs_qm_dqrele(udqp); | 639 | xfs_qm_dqrele(udqp); |
637 | xfs_qm_dqrele(gdqp); | 640 | xfs_qm_dqrele(gdqp); |
641 | xfs_qm_dqrele(pdqp); | ||
638 | 642 | ||
639 | *ipp = ip; | 643 | *ipp = ip; |
640 | return 0; | 644 | return 0; |
@@ -656,6 +660,7 @@ xfs_create( | |||
656 | 660 | ||
657 | xfs_qm_dqrele(udqp); | 661 | xfs_qm_dqrele(udqp); |
658 | xfs_qm_dqrele(gdqp); | 662 | xfs_qm_dqrele(gdqp); |
663 | xfs_qm_dqrele(pdqp); | ||
659 | 664 | ||
660 | if (unlock_dp_on_error) | 665 | if (unlock_dp_on_error) |
661 | xfs_iunlock(dp, XFS_ILOCK_EXCL); | 666 | xfs_iunlock(dp, XFS_ILOCK_EXCL); |
@@ -1568,7 +1573,7 @@ xfs_free_file_space( | |||
1568 | } | 1573 | } |
1569 | xfs_ilock(ip, XFS_ILOCK_EXCL); | 1574 | xfs_ilock(ip, XFS_ILOCK_EXCL); |
1570 | error = xfs_trans_reserve_quota(tp, mp, | 1575 | error = xfs_trans_reserve_quota(tp, mp, |
1571 | ip->i_udquot, ip->i_gdquot, | 1576 | ip->i_udquot, ip->i_gdquot, ip->i_pdquot, |
1572 | resblks, 0, XFS_QMOPT_RES_REGBLKS); | 1577 | resblks, 0, XFS_QMOPT_RES_REGBLKS); |
1573 | if (error) | 1578 | if (error) |
1574 | goto error1; | 1579 | goto error1; |