aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/xfs/xfs_dquot.c12
-rw-r--r--fs/xfs/xfs_icache.c3
-rw-r--r--fs/xfs/xfs_qm.c152
-rw-r--r--fs/xfs/xfs_qm.h37
-rw-r--r--fs/xfs/xfs_qm_syscalls.c8
-rw-r--r--fs/xfs/xfs_symlink.c3
-rw-r--r--fs/xfs/xfs_trans_dquot.c46
7 files changed, 135 insertions, 126 deletions
diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
index 7d184dead99a..f01012de06d0 100644
--- a/fs/xfs/xfs_dquot.c
+++ b/fs/xfs/xfs_dquot.c
@@ -570,13 +570,13 @@ xfs_qm_dqtobp(
570 xfs_buf_t **O_bpp, 570 xfs_buf_t **O_bpp,
571 uint flags) 571 uint flags)
572{ 572{
573 xfs_bmbt_irec_t map; 573 struct xfs_bmbt_irec map;
574 int nmaps = 1, error; 574 int nmaps = 1, error;
575 xfs_buf_t *bp; 575 struct xfs_buf *bp;
576 struct xfs_inode *quotip = xfs_dq_to_quota_inode(dqp); 576 struct xfs_inode *quotip = xfs_dq_to_quota_inode(dqp);
577 xfs_mount_t *mp = dqp->q_mount; 577 struct xfs_mount *mp = dqp->q_mount;
578 xfs_dqid_t id = be32_to_cpu(dqp->q_core.d_id); 578 xfs_dqid_t id = be32_to_cpu(dqp->q_core.d_id);
579 xfs_trans_t *tp = (tpp ? *tpp : NULL); 579 struct xfs_trans *tp = (tpp ? *tpp : NULL);
580 580
581 dqp->q_fileoffset = (xfs_fileoff_t)id / mp->m_quotainfo->qi_dqperchunk; 581 dqp->q_fileoffset = (xfs_fileoff_t)id / mp->m_quotainfo->qi_dqperchunk;
582 582
diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 96e344e3e927..9560dc1f15a9 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -335,7 +335,8 @@ xfs_iget_cache_miss(
335 iflags = XFS_INEW; 335 iflags = XFS_INEW;
336 if (flags & XFS_IGET_DONTCACHE) 336 if (flags & XFS_IGET_DONTCACHE)
337 iflags |= XFS_IDONTCACHE; 337 iflags |= XFS_IDONTCACHE;
338 ip->i_udquot = ip->i_gdquot = NULL; 338 ip->i_udquot = NULL;
339 ip->i_gdquot = NULL;
339 xfs_iflags_set(ip, iflags); 340 xfs_iflags_set(ip, iflags);
340 341
341 /* insert the new inode */ 342 /* insert the new inode */
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index 8e707d33e106..cf09aa845d8c 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -1260,19 +1260,20 @@ int
1260xfs_qm_quotacheck( 1260xfs_qm_quotacheck(
1261 xfs_mount_t *mp) 1261 xfs_mount_t *mp)
1262{ 1262{
1263 int done, count, error, error2; 1263 int done, count, error, error2;
1264 xfs_ino_t lastino; 1264 xfs_ino_t lastino;
1265 size_t structsz; 1265 size_t structsz;
1266 xfs_inode_t *uip, *gip; 1266 uint flags;
1267 uint flags; 1267 LIST_HEAD (buffer_list);
1268 LIST_HEAD (buffer_list); 1268 struct xfs_inode *uip = mp->m_quotainfo->qi_uquotaip;
1269 struct xfs_inode *gip = mp->m_quotainfo->qi_gquotaip;
1269 1270
1270 count = INT_MAX; 1271 count = INT_MAX;
1271 structsz = 1; 1272 structsz = 1;
1272 lastino = 0; 1273 lastino = 0;
1273 flags = 0; 1274 flags = 0;
1274 1275
1275 ASSERT(mp->m_quotainfo->qi_uquotaip || mp->m_quotainfo->qi_gquotaip); 1276 ASSERT(uip || gip);
1276 ASSERT(XFS_IS_QUOTA_RUNNING(mp)); 1277 ASSERT(XFS_IS_QUOTA_RUNNING(mp));
1277 1278
1278 xfs_notice(mp, "Quotacheck needed: Please wait."); 1279 xfs_notice(mp, "Quotacheck needed: Please wait.");
@@ -1282,7 +1283,6 @@ xfs_qm_quotacheck(
1282 * their counters to zero. We need a clean slate. 1283 * their counters to zero. We need a clean slate.
1283 * We don't log our changes till later. 1284 * We don't log our changes till later.
1284 */ 1285 */
1285 uip = mp->m_quotainfo->qi_uquotaip;
1286 if (uip) { 1286 if (uip) {
1287 error = xfs_qm_dqiterate(mp, uip, XFS_QMOPT_UQUOTA, 1287 error = xfs_qm_dqiterate(mp, uip, XFS_QMOPT_UQUOTA,
1288 &buffer_list); 1288 &buffer_list);
@@ -1291,7 +1291,6 @@ xfs_qm_quotacheck(
1291 flags |= XFS_UQUOTA_CHKD; 1291 flags |= XFS_UQUOTA_CHKD;
1292 } 1292 }
1293 1293
1294 gip = mp->m_quotainfo->qi_gquotaip;
1295 if (gip) { 1294 if (gip) {
1296 error = xfs_qm_dqiterate(mp, gip, XFS_IS_GQUOTA_ON(mp) ? 1295 error = xfs_qm_dqiterate(mp, gip, XFS_IS_GQUOTA_ON(mp) ?
1297 XFS_QMOPT_GQUOTA : XFS_QMOPT_PQUOTA, 1296 XFS_QMOPT_GQUOTA : XFS_QMOPT_PQUOTA,
@@ -1393,15 +1392,13 @@ STATIC int
1393xfs_qm_init_quotainos( 1392xfs_qm_init_quotainos(
1394 xfs_mount_t *mp) 1393 xfs_mount_t *mp)
1395{ 1394{
1396 xfs_inode_t *uip, *gip; 1395 struct xfs_inode *uip = NULL;
1397 int error; 1396 struct xfs_inode *gip = NULL;
1398 __int64_t sbflags; 1397 int error;
1399 uint flags; 1398 __int64_t sbflags = 0;
1399 uint flags = 0;
1400 1400
1401 ASSERT(mp->m_quotainfo); 1401 ASSERT(mp->m_quotainfo);
1402 uip = gip = NULL;
1403 sbflags = 0;
1404 flags = 0;
1405 1402
1406 /* 1403 /*
1407 * Get the uquota and gquota inodes 1404 * Get the uquota and gquota inodes
@@ -1410,19 +1407,18 @@ xfs_qm_init_quotainos(
1410 if (XFS_IS_UQUOTA_ON(mp) && 1407 if (XFS_IS_UQUOTA_ON(mp) &&
1411 mp->m_sb.sb_uquotino != NULLFSINO) { 1408 mp->m_sb.sb_uquotino != NULLFSINO) {
1412 ASSERT(mp->m_sb.sb_uquotino > 0); 1409 ASSERT(mp->m_sb.sb_uquotino > 0);
1413 if ((error = xfs_iget(mp, NULL, mp->m_sb.sb_uquotino, 1410 error = xfs_iget(mp, NULL, mp->m_sb.sb_uquotino,
1414 0, 0, &uip))) 1411 0, 0, &uip);
1412 if (error)
1415 return XFS_ERROR(error); 1413 return XFS_ERROR(error);
1416 } 1414 }
1417 if (XFS_IS_OQUOTA_ON(mp) && 1415 if (XFS_IS_OQUOTA_ON(mp) &&
1418 mp->m_sb.sb_gquotino != NULLFSINO) { 1416 mp->m_sb.sb_gquotino != NULLFSINO) {
1419 ASSERT(mp->m_sb.sb_gquotino > 0); 1417 ASSERT(mp->m_sb.sb_gquotino > 0);
1420 if ((error = xfs_iget(mp, NULL, mp->m_sb.sb_gquotino, 1418 error = xfs_iget(mp, NULL, mp->m_sb.sb_gquotino,
1421 0, 0, &gip))) { 1419 0, 0, &gip);
1422 if (uip) 1420 if (error)
1423 IRELE(uip); 1421 goto error_rele;
1424 return XFS_ERROR(error);
1425 }
1426 } 1422 }
1427 } else { 1423 } else {
1428 flags |= XFS_QMOPT_SBVERSION; 1424 flags |= XFS_QMOPT_SBVERSION;
@@ -1437,10 +1433,11 @@ xfs_qm_init_quotainos(
1437 * temporarily switch to read-write to do this. 1433 * temporarily switch to read-write to do this.
1438 */ 1434 */
1439 if (XFS_IS_UQUOTA_ON(mp) && uip == NULL) { 1435 if (XFS_IS_UQUOTA_ON(mp) && uip == NULL) {
1440 if ((error = xfs_qm_qino_alloc(mp, &uip, 1436 error = xfs_qm_qino_alloc(mp, &uip,
1441 sbflags | XFS_SB_UQUOTINO, 1437 sbflags | XFS_SB_UQUOTINO,
1442 flags | XFS_QMOPT_UQUOTA))) 1438 flags | XFS_QMOPT_UQUOTA);
1443 return XFS_ERROR(error); 1439 if (error)
1440 goto error_rele;
1444 1441
1445 flags &= ~XFS_QMOPT_SBVERSION; 1442 flags &= ~XFS_QMOPT_SBVERSION;
1446 } 1443 }
@@ -1449,18 +1446,21 @@ xfs_qm_init_quotainos(
1449 XFS_QMOPT_GQUOTA : XFS_QMOPT_PQUOTA); 1446 XFS_QMOPT_GQUOTA : XFS_QMOPT_PQUOTA);
1450 error = xfs_qm_qino_alloc(mp, &gip, 1447 error = xfs_qm_qino_alloc(mp, &gip,
1451 sbflags | XFS_SB_GQUOTINO, flags); 1448 sbflags | XFS_SB_GQUOTINO, flags);
1452 if (error) { 1449 if (error)
1453 if (uip) 1450 goto error_rele;
1454 IRELE(uip);
1455
1456 return XFS_ERROR(error);
1457 }
1458 } 1451 }
1459 1452
1460 mp->m_quotainfo->qi_uquotaip = uip; 1453 mp->m_quotainfo->qi_uquotaip = uip;
1461 mp->m_quotainfo->qi_gquotaip = gip; 1454 mp->m_quotainfo->qi_gquotaip = gip;
1462 1455
1463 return 0; 1456 return 0;
1457
1458error_rele:
1459 if (uip)
1460 IRELE(uip);
1461 if (gip)
1462 IRELE(gip);
1463 return XFS_ERROR(error);
1464} 1464}
1465 1465
1466STATIC void 1466STATIC void
@@ -1657,7 +1657,8 @@ xfs_qm_vop_dqalloc(
1657 struct xfs_dquot **O_gdqpp) 1657 struct xfs_dquot **O_gdqpp)