|
@@ -262,7 +262,7 @@ xfs_qm_dqattach_one(
|
|
xfs_inode_t *ip,
|
|
xfs_inode_t *ip,
|
|
xfs_dqid_t id,
|
|
xfs_dqid_t id,
|
|
uint type,
|
|
uint type,
|
|
- uint doalloc,
|
|
|
|
|
|
+ bool doalloc,
|
|
xfs_dquot_t **IO_idqpp)
|
|
xfs_dquot_t **IO_idqpp)
|
|
{
|
|
{
|
|
xfs_dquot_t *dqp;
|
|
xfs_dquot_t *dqp;
|
|
@@ -288,7 +288,7 @@ xfs_qm_dqattach_one(
|
|
* exist on disk and we didn't ask it to allocate; ESRCH if quotas got
|
|
* exist on disk and we didn't ask it to allocate; ESRCH if quotas got
|
|
* turned off suddenly.
|
|
* turned off suddenly.
|
|
*/
|
|
*/
|
|
- error = xfs_qm_dqget(ip->i_mount, ip, id, type, doalloc, &dqp);
|
|
|
|
|
|
+ error = xfs_qm_dqget_inode(ip, type, doalloc, &dqp);
|
|
if (error)
|
|
if (error)
|
|
return error;
|
|
return error;
|
|
|
|
|
|
@@ -330,7 +330,7 @@ xfs_qm_need_dqattach(
|
|
int
|
|
int
|
|
xfs_qm_dqattach_locked(
|
|
xfs_qm_dqattach_locked(
|
|
xfs_inode_t *ip,
|
|
xfs_inode_t *ip,
|
|
- uint flags)
|
|
|
|
|
|
+ bool doalloc)
|
|
{
|
|
{
|
|
xfs_mount_t *mp = ip->i_mount;
|
|
xfs_mount_t *mp = ip->i_mount;
|
|
int error = 0;
|
|
int error = 0;
|
|
@@ -342,8 +342,7 @@ xfs_qm_dqattach_locked(
|
|
|
|
|
|
if (XFS_IS_UQUOTA_ON(mp) && !ip->i_udquot) {
|
|
if (XFS_IS_UQUOTA_ON(mp) && !ip->i_udquot) {
|
|
error = xfs_qm_dqattach_one(ip, ip->i_d.di_uid, XFS_DQ_USER,
|
|
error = xfs_qm_dqattach_one(ip, ip->i_d.di_uid, XFS_DQ_USER,
|
|
- flags & XFS_QMOPT_DQALLOC,
|
|
|
|
- &ip->i_udquot);
|
|
|
|
|
|
+ doalloc, &ip->i_udquot);
|
|
if (error)
|
|
if (error)
|
|
goto done;
|
|
goto done;
|
|
ASSERT(ip->i_udquot);
|
|
ASSERT(ip->i_udquot);
|
|
@@ -351,8 +350,7 @@ xfs_qm_dqattach_locked(
|
|
|
|
|
|
if (XFS_IS_GQUOTA_ON(mp) && !ip->i_gdquot) {
|
|
if (XFS_IS_GQUOTA_ON(mp) && !ip->i_gdquot) {
|
|
error = xfs_qm_dqattach_one(ip, ip->i_d.di_gid, XFS_DQ_GROUP,
|
|
error = xfs_qm_dqattach_one(ip, ip->i_d.di_gid, XFS_DQ_GROUP,
|
|
- flags & XFS_QMOPT_DQALLOC,
|
|
|
|
- &ip->i_gdquot);
|
|
|
|
|
|
+ doalloc, &ip->i_gdquot);
|
|
if (error)
|
|
if (error)
|
|
goto done;
|
|
goto done;
|
|
ASSERT(ip->i_gdquot);
|
|
ASSERT(ip->i_gdquot);
|
|
@@ -360,8 +358,7 @@ xfs_qm_dqattach_locked(
|
|
|
|
|
|
if (XFS_IS_PQUOTA_ON(mp) && !ip->i_pdquot) {
|
|
if (XFS_IS_PQUOTA_ON(mp) && !ip->i_pdquot) {
|
|
error = xfs_qm_dqattach_one(ip, xfs_get_projid(ip), XFS_DQ_PROJ,
|
|
error = xfs_qm_dqattach_one(ip, xfs_get_projid(ip), XFS_DQ_PROJ,
|
|
- flags & XFS_QMOPT_DQALLOC,
|
|
|
|
- &ip->i_pdquot);
|
|
|
|
|
|
+ doalloc, &ip->i_pdquot);
|
|
if (error)
|
|
if (error)
|
|
goto done;
|
|
goto done;
|
|
ASSERT(ip->i_pdquot);
|
|
ASSERT(ip->i_pdquot);
|
|
@@ -386,7 +383,7 @@ xfs_qm_dqattach(
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
xfs_ilock(ip, XFS_ILOCK_EXCL);
|
|
xfs_ilock(ip, XFS_ILOCK_EXCL);
|
|
- error = xfs_qm_dqattach_locked(ip, 0);
|
|
|
|
|
|
+ error = xfs_qm_dqattach_locked(ip, false);
|
|
xfs_iunlock(ip, XFS_ILOCK_EXCL);
|
|
xfs_iunlock(ip, XFS_ILOCK_EXCL);
|
|
|
|
|
|
return error;
|
|
return error;
|
|
@@ -1068,7 +1065,7 @@ xfs_qm_quotacheck_dqadjust(
|
|
struct xfs_dquot *dqp;
|
|
struct xfs_dquot *dqp;
|
|
int error;
|
|
int error;
|
|
|
|
|
|
- error = xfs_qm_dqget(mp, ip, id, type, XFS_QMOPT_DQALLOC, &dqp);
|
|
|
|
|
|
+ error = xfs_qm_dqget_inode(ip, type, true, &dqp);
|
|
if (error) {
|
|
if (error) {
|
|
/*
|
|
/*
|
|
* Shouldn't be able to turn off quotas here.
|
|
* Shouldn't be able to turn off quotas here.
|
|
@@ -1667,7 +1664,7 @@ xfs_qm_vop_dqalloc(
|
|
* if necessary. The dquot(s) will not be locked.
|
|
* if necessary. The dquot(s) will not be locked.
|
|
*/
|
|
*/
|
|
if (XFS_NOT_DQATTACHED(mp, ip)) {
|
|
if (XFS_NOT_DQATTACHED(mp, ip)) {
|
|
- error = xfs_qm_dqattach_locked(ip, XFS_QMOPT_DQALLOC);
|
|
|
|
|
|
+ error = xfs_qm_dqattach_locked(ip, true);
|
|
if (error) {
|
|
if (error) {
|
|
xfs_iunlock(ip, lockflags);
|
|
xfs_iunlock(ip, lockflags);
|
|
return error;
|
|
return error;
|
|
@@ -1686,10 +1683,8 @@ xfs_qm_vop_dqalloc(
|
|
* holding ilock.
|
|
* holding ilock.
|
|
*/
|
|
*/
|
|
xfs_iunlock(ip, lockflags);
|
|
xfs_iunlock(ip, lockflags);
|
|
- error = xfs_qm_dqget(mp, NULL, uid,
|
|
|
|
- XFS_DQ_USER,
|
|
|
|
- XFS_QMOPT_DQALLOC,
|
|
|
|
- &uq);
|
|
|
|
|
|
+ error = xfs_qm_dqget(mp, uid, XFS_DQ_USER,
|
|
|
|
+ XFS_QMOPT_DQALLOC, &uq);
|
|
if (error) {
|
|
if (error) {
|
|
ASSERT(error != -ENOENT);
|
|
ASSERT(error != -ENOENT);
|
|
return error;
|
|
return error;
|
|
@@ -1712,10 +1707,8 @@ xfs_qm_vop_dqalloc(
|
|
if ((flags & XFS_QMOPT_GQUOTA) && XFS_IS_GQUOTA_ON(mp)) {
|
|
if ((flags & XFS_QMOPT_GQUOTA) && XFS_IS_GQUOTA_ON(mp)) {
|
|
if (ip->i_d.di_gid != gid) {
|
|
if (ip->i_d.di_gid != gid) {
|
|
xfs_iunlock(ip, lockflags);
|
|
xfs_iunlock(ip, lockflags);
|
|
- error = xfs_qm_dqget(mp, NULL, gid,
|
|
|
|
- XFS_DQ_GROUP,
|
|
|
|
- XFS_QMOPT_DQALLOC,
|
|
|
|
- &gq);
|
|
|
|
|
|
+ error = xfs_qm_dqget(mp, gid, XFS_DQ_GROUP,
|
|
|
|
+ XFS_QMOPT_DQALLOC, &gq);
|
|
if (error) {
|
|
if (error) {
|
|
ASSERT(error != -ENOENT);
|
|
ASSERT(error != -ENOENT);
|
|
goto error_rele;
|
|
goto error_rele;
|
|
@@ -1731,10 +1724,8 @@ xfs_qm_vop_dqalloc(
|
|
if ((flags & XFS_QMOPT_PQUOTA) && XFS_IS_PQUOTA_ON(mp)) {
|
|
if ((flags & XFS_QMOPT_PQUOTA) && XFS_IS_PQUOTA_ON(mp)) {
|
|
if (xfs_get_projid(ip) != prid) {
|
|
if (xfs_get_projid(ip) != prid) {
|
|
xfs_iunlock(ip, lockflags);
|
|
xfs_iunlock(ip, lockflags);
|
|
- error = xfs_qm_dqget(mp, NULL, (xfs_dqid_t)prid,
|
|
|
|
- XFS_DQ_PROJ,
|
|
|
|
- XFS_QMOPT_DQALLOC,
|
|
|
|
- &pq);
|
|
|
|
|
|
+ error = xfs_qm_dqget(mp, (xfs_dqid_t)prid, XFS_DQ_PROJ,
|
|
|
|
+ XFS_QMOPT_DQALLOC, &pq);
|
|
if (error) {
|
|
if (error) {
|
|
ASSERT(error != -ENOENT);
|
|
ASSERT(error != -ENOENT);
|
|
goto error_rele;
|
|
goto error_rele;
|