aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_mount.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_mount.c')
-rw-r--r--fs/xfs/xfs_mount.c73
1 files changed, 36 insertions, 37 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 541d5dd474be..62188ea392c7 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -51,7 +51,7 @@ STATIC int xfs_uuid_mount(xfs_mount_t *);
51STATIC void xfs_uuid_unmount(xfs_mount_t *mp); 51STATIC void xfs_uuid_unmount(xfs_mount_t *mp);
52STATIC void xfs_unmountfs_wait(xfs_mount_t *); 52STATIC void xfs_unmountfs_wait(xfs_mount_t *);
53 53
54static struct { 54static const struct {
55 short offset; 55 short offset;
56 short type; /* 0 = integer 56 short type; /* 0 = integer
57 * 1 = binary / string (no translation) 57 * 1 = binary / string (no translation)
@@ -117,7 +117,7 @@ xfs_mount_init(void)
117 117
118 AIL_LOCKINIT(&mp->m_ail_lock, "xfs_ail"); 118 AIL_LOCKINIT(&mp->m_ail_lock, "xfs_ail");
119 spinlock_init(&mp->m_sb_lock, "xfs_sb"); 119 spinlock_init(&mp->m_sb_lock, "xfs_sb");
120 mutex_init(&mp->m_ilock, MUTEX_DEFAULT, "xfs_ilock"); 120 mutex_init(&mp->m_ilock);
121 initnsema(&mp->m_growlock, 1, "xfs_grow"); 121 initnsema(&mp->m_growlock, 1, "xfs_grow");
122 /* 122 /*
123 * Initialize the AIL. 123 * Initialize the AIL.
@@ -646,7 +646,7 @@ xfs_mountfs(
646 646
647 if (mp->m_sb_bp == NULL) { 647 if (mp->m_sb_bp == NULL) {
648 if ((error = xfs_readsb(mp))) { 648 if ((error = xfs_readsb(mp))) {
649 return (error); 649 return error;
650 } 650 }
651 } 651 }
652 xfs_mount_common(mp, sbp); 652 xfs_mount_common(mp, sbp);
@@ -889,7 +889,7 @@ xfs_mountfs(
889 * For client case we are done now 889 * For client case we are done now
890 */ 890 */
891 if (mfsi_flags & XFS_MFSI_CLIENT) { 891 if (mfsi_flags & XFS_MFSI_CLIENT) {
892 return(0); 892 return 0;
893 } 893 }
894 894
895 /* 895 /*
@@ -1077,8 +1077,7 @@ xfs_unmountfs(xfs_mount_t *mp, struct cred *cr)
1077 1077
1078 xfs_iflush_all(mp); 1078 xfs_iflush_all(mp);
1079 1079
1080 XFS_QM_DQPURGEALL(mp, 1080 XFS_QM_DQPURGEALL(mp, XFS_QMOPT_QUOTALL | XFS_QMOPT_UMOUNTING);
1081 XFS_QMOPT_UQUOTA | XFS_QMOPT_GQUOTA | XFS_QMOPT_UMOUNTING);
1082 1081
1083 /* 1082 /*
1084 * Flush out the log synchronously so that we know for sure 1083 * Flush out the log synchronously so that we know for sure
@@ -1183,7 +1182,7 @@ xfs_unmountfs_writesb(xfs_mount_t *mp)
1183 xfs_fs_cmn_err(CE_ALERT, mp, "Superblock write error detected while unmounting. Filesystem may not be marked shared readonly"); 1182 xfs_fs_cmn_err(CE_ALERT, mp, "Superblock write error detected while unmounting. Filesystem may not be marked shared readonly");
1184 } 1183 }
1185 xfs_buf_relse(sbp); 1184 xfs_buf_relse(sbp);
1186 return (error); 1185 return error;
1187} 1186}
1188 1187
1189/* 1188/*
@@ -1258,19 +1257,19 @@ xfs_mod_incore_sb_unlocked(xfs_mount_t *mp, xfs_sb_field_t field,
1258 lcounter += delta; 1257 lcounter += delta;
1259 if (lcounter < 0) { 1258 if (lcounter < 0) {
1260 ASSERT(0); 1259 ASSERT(0);
1261 return (XFS_ERROR(EINVAL)); 1260 return XFS_ERROR(EINVAL);
1262 } 1261 }
1263 mp->m_sb.sb_icount = lcounter; 1262 mp->m_sb.sb_icount = lcounter;
1264 return (0); 1263 return 0;
1265 case XFS_SBS_IFREE: 1264 case XFS_SBS_IFREE:
1266 lcounter = (long long)mp->m_sb.sb_ifree; 1265 lcounter = (long long)mp->m_sb.sb_ifree;
1267 lcounter += delta; 1266 lcounter += delta;
1268 if (lcounter < 0) { 1267 if (lcounter < 0) {
1269 ASSERT(0); 1268 ASSERT(0);
1270 return (XFS_ERROR(EINVAL)); 1269 return XFS_ERROR(EINVAL);
1271 } 1270 }
1272 mp->m_sb.sb_ifree = lcounter; 1271 mp->m_sb.sb_ifree = lcounter;
1273 return (0); 1272 return 0;
1274 case XFS_SBS_FDBLOCKS: 1273 case XFS_SBS_FDBLOCKS:
1275 1274
1276 lcounter = (long long)mp->m_sb.sb_fdblocks; 1275 lcounter = (long long)mp->m_sb.sb_fdblocks;
@@ -1297,101 +1296,101 @@ xfs_mod_incore_sb_unlocked(xfs_mount_t *mp, xfs_sb_field_t field,
1297 if (rsvd) { 1296 if (rsvd) {
1298 lcounter = (long long)mp->m_resblks_avail + delta; 1297 lcounter = (long long)mp->m_resblks_avail + delta;
1299 if (lcounter < 0) { 1298 if (lcounter < 0) {
1300 return (XFS_ERROR(ENOSPC)); 1299 return XFS_ERROR(ENOSPC);
1301 } 1300 }
1302 mp->m_resblks_avail = lcounter; 1301 mp->m_resblks_avail = lcounter;
1303 return (0); 1302 return 0;
1304 } else { /* not reserved */ 1303 } else { /* not reserved */
1305 return (XFS_ERROR(ENOSPC)); 1304 return XFS_ERROR(ENOSPC);
1306 } 1305 }
1307 } 1306 }
1308 } 1307 }
1309 1308
1310 mp->m_sb.sb_fdblocks = lcounter; 1309 mp->m_sb.sb_fdblocks = lcounter;
1311 return (0); 1310 return 0;
1312 case XFS_SBS_FREXTENTS: 1311 case XFS_SBS_FREXTENTS:
1313 lcounter = (long long)mp->m_sb.sb_frextents; 1312 lcounter = (long long)mp->m_sb.sb_frextents;
1314 lcounter += delta; 1313 lcounter += delta;
1315 if (lcounter < 0) { 1314 if (lcounter < 0) {
1316 return (XFS_ERROR(ENOSPC)); 1315 return XFS_ERROR(ENOSPC);
1317 } 1316 }
1318 mp->m_sb.sb_frextents = lcounter; 1317 mp->m_sb.sb_frextents = lcounter;
1319 return (0); 1318 return 0;
1320 case XFS_SBS_DBLOCKS: 1319 case XFS_SBS_DBLOCKS:
1321 lcounter = (long long)mp->m_sb.sb_dblocks; 1320 lcounter = (long long)mp->m_sb.sb_dblocks;
1322 lcounter += delta; 1321 lcounter += delta;
1323 if (lcounter < 0) { 1322 if (lcounter < 0) {
1324 ASSERT(0); 1323 ASSERT(0);
1325 return (XFS_ERROR(EINVAL)); 1324 return XFS_ERROR(EINVAL);
1326 } 1325 }
1327 mp->m_sb.sb_dblocks = lcounter; 1326 mp->m_sb.sb_dblocks = lcounter;
1328 return (0); 1327 return 0;
1329 case XFS_SBS_AGCOUNT: 1328 case XFS_SBS_AGCOUNT:
1330 scounter = mp->m_sb.sb_agcount; 1329 scounter = mp->m_sb.sb_agcount;
1331 scounter += delta; 1330 scounter += delta;
1332 if (scounter < 0) { 1331 if (scounter < 0) {
1333 ASSERT(0); 1332 ASSERT(0);
1334 return (XFS_ERROR(EINVAL)); 1333 return XFS_ERROR(EINVAL);
1335 } 1334 }
1336 mp->m_sb.sb_agcount = scounter; 1335 mp->m_sb.sb_agcount = scounter;
1337 return (0); 1336 return 0;
1338 case XFS_SBS_IMAX_PCT: 1337 case XFS_SBS_IMAX_PCT:
1339 scounter = mp->m_sb.sb_imax_pct; 1338 scounter = mp->m_sb.sb_imax_pct;
1340 scounter += delta; 1339 scounter += delta;
1341 if (scounter < 0) { 1340 if (scounter < 0) {
1342 ASSERT(0); 1341 ASSERT(0);
1343 return (XFS_ERROR(EINVAL)); 1342 return XFS_ERROR(EINVAL);
1344 } 1343 }
1345 mp->m_sb.sb_imax_pct = scounter; 1344 mp->m_sb.sb_imax_pct = scounter;
1346 return (0); 1345 return 0;
1347 case XFS_SBS_REXTSIZE: 1346 case XFS_SBS_REXTSIZE:
1348 scounter = mp->m_sb.sb_rextsize; 1347 scounter = mp->m_sb.sb_rextsize;
1349 scounter += delta; 1348 scounter += delta;
1350 if (scounter < 0) { 1349 if (scounter < 0) {
1351 ASSERT(0); 1350 ASSERT(0);
1352 return (XFS_ERROR(EINVAL)); 1351 return XFS_ERROR(EINVAL);
1353 } 1352 }
1354 mp->m_sb.sb_rextsize = scounter; 1353 mp->m_sb.sb_rextsize = scounter;
1355 return (0); 1354 return 0;
1356 case XFS_SBS_RBMBLOCKS: 1355 case XFS_SBS_RBMBLOCKS:
1357 scounter = mp->m_sb.sb_rbmblocks; 1356 scounter = mp->m_sb.sb_rbmblocks;
1358 scounter += delta; 1357 scounter += delta;
1359 if (scounter < 0) { 1358 if (scounter < 0) {
1360 ASSERT(0); 1359 ASSERT(0);
1361 return (XFS_ERROR(EINVAL)); 1360 return XFS_ERROR(EINVAL);
1362 } 1361 }
1363 mp->m_sb.sb_rbmblocks = scounter; 1362 mp->m_sb.sb_rbmblocks = scounter;
1364 return (0); 1363 return 0;
1365 case XFS_SBS_RBLOCKS: 1364 case XFS_SBS_RBLOCKS:
1366 lcounter = (long long)mp->m_sb.sb_rblocks; 1365 lcounter = (long long)mp->m_sb.sb_rblocks;
1367 lcounter += delta; 1366 lcounter += delta;
1368 if (lcounter < 0) { 1367 if (lcounter < 0) {
1369 ASSERT(0); 1368 ASSERT(0);
1370 return (XFS_ERROR(EINVAL)); 1369 return XFS_ERROR(EINVAL);
1371 } 1370 }
1372 mp->m_sb.sb_rblocks = lcounter; 1371 mp->m_sb.sb_rblocks = lcounter;
1373 return (0); 1372 return 0;
1374 case XFS_SBS_REXTENTS: 1373 case XFS_SBS_REXTENTS:
1375 lcounter = (long long)mp->m_sb.sb_rextents; 1374 lcounter = (long long)mp->m_sb.sb_rextents;
1376 lcounter += delta; 1375 lcounter += delta;
1377 if (lcounter < 0) { 1376 if (lcounter < 0) {
1378 ASSERT(0); 1377 ASSERT(0);
1379 return (XFS_ERROR(EINVAL)); 1378 return XFS_ERROR(EINVAL);
1380 } 1379 }
1381 mp->m_sb.sb_rextents = lcounter; 1380 mp->m_sb.sb_rextents = lcounter;
1382 return (0); 1381 return 0;
1383 case XFS_SBS_REXTSLOG: 1382 case XFS_SBS_REXTSLOG:
1384 scounter = mp->m_sb.sb_rextslog; 1383 scounter = mp->m_sb.sb_rextslog;
1385 scounter += delta; 1384 scounter += delta;
1386 if (scounter < 0) { 1385 if (scounter < 0) {
1387 ASSERT(0); 1386 ASSERT(0);
1388 return (XFS_ERROR(EINVAL)); 1387 return XFS_ERROR(EINVAL);
1389 } 1388 }
1390 mp->m_sb.sb_rextslog = scounter; 1389 mp->m_sb.sb_rextslog = scounter;
1391 return (0); 1390 return 0;
1392 default: 1391 default:
1393 ASSERT(0); 1392 ASSERT(0);
1394 return (XFS_ERROR(EINVAL)); 1393 return XFS_ERROR(EINVAL);
1395 } 1394 }
1396} 1395}
1397 1396
@@ -1410,7 +1409,7 @@ xfs_mod_incore_sb(xfs_mount_t *mp, xfs_sb_field_t field, int delta, int rsvd)
1410 s = XFS_SB_LOCK(mp); 1409 s = XFS_SB_LOCK(mp);
1411 status = xfs_mod_incore_sb_unlocked(mp, field, delta, rsvd); 1410 status = xfs_mod_incore_sb_unlocked(mp, field, delta, rsvd);
1412 XFS_SB_UNLOCK(mp, s); 1411 XFS_SB_UNLOCK(mp, s);
1413 return (status); 1412 return status;
1414} 1413}
1415 1414
1416/* 1415/*
@@ -1471,7 +1470,7 @@ xfs_mod_incore_sb_batch(xfs_mount_t *mp, xfs_mod_sb_t *msb, uint nmsb, int rsvd)
1471 } 1470 }
1472 } 1471 }
1473 XFS_SB_UNLOCK(mp, s); 1472 XFS_SB_UNLOCK(mp, s);
1474 return (status); 1473 return status;
1475} 1474}
1476 1475
1477/* 1476/*
@@ -1501,7 +1500,7 @@ xfs_getsb(
1501 } 1500 }
1502 XFS_BUF_HOLD(bp); 1501 XFS_BUF_HOLD(bp);
1503 ASSERT(XFS_BUF_ISDONE(bp)); 1502 ASSERT(XFS_BUF_ISDONE(bp));
1504 return (bp); 1503 return bp;
1505} 1504}
1506 1505
1507/* 1506/*