diff options
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_super.c')
| -rw-r--r-- | fs/xfs/linux-2.6/xfs_super.c | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 08d6bd9a3947..2e09efbca8db 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c | |||
| @@ -43,7 +43,6 @@ | |||
| 43 | #include "xfs_itable.h" | 43 | #include "xfs_itable.h" |
| 44 | #include "xfs_fsops.h" | 44 | #include "xfs_fsops.h" |
| 45 | #include "xfs_rw.h" | 45 | #include "xfs_rw.h" |
| 46 | #include "xfs_acl.h" | ||
| 47 | #include "xfs_attr.h" | 46 | #include "xfs_attr.h" |
| 48 | #include "xfs_buf_item.h" | 47 | #include "xfs_buf_item.h" |
| 49 | #include "xfs_utils.h" | 48 | #include "xfs_utils.h" |
| @@ -405,6 +404,14 @@ xfs_parseargs( | |||
| 405 | return EINVAL; | 404 | return EINVAL; |
| 406 | } | 405 | } |
| 407 | 406 | ||
| 407 | #ifndef CONFIG_XFS_QUOTA | ||
| 408 | if (XFS_IS_QUOTA_RUNNING(mp)) { | ||
| 409 | cmn_err(CE_WARN, | ||
| 410 | "XFS: quota support not available in this kernel."); | ||
| 411 | return EINVAL; | ||
| 412 | } | ||
| 413 | #endif | ||
| 414 | |||
| 408 | if ((mp->m_qflags & (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE)) && | 415 | if ((mp->m_qflags & (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE)) && |
| 409 | (mp->m_qflags & (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE))) { | 416 | (mp->m_qflags & (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE))) { |
| 410 | cmn_err(CE_WARN, | 417 | cmn_err(CE_WARN, |
| @@ -1063,7 +1070,18 @@ xfs_fs_put_super( | |||
| 1063 | int unmount_event_flags = 0; | 1070 | int unmount_event_flags = 0; |
| 1064 | 1071 | ||
| 1065 | xfs_syncd_stop(mp); | 1072 | xfs_syncd_stop(mp); |
| 1066 | xfs_sync_inodes(mp, SYNC_ATTR|SYNC_DELWRI); | 1073 | |
| 1074 | if (!(sb->s_flags & MS_RDONLY)) { | ||
| 1075 | /* | ||
| 1076 | * XXX(hch): this should be SYNC_WAIT. | ||
| 1077 | * | ||
| 1078 | * Or more likely not needed at all because the VFS is already | ||
| 1079 | * calling ->sync_fs after shutting down all filestem | ||
| 1080 | * operations and just before calling ->put_super. | ||
| 1081 | */ | ||
| 1082 | xfs_sync_data(mp, 0); | ||
| 1083 | xfs_sync_attr(mp, 0); | ||
| 1084 | } | ||
| 1067 | 1085 | ||
| 1068 | #ifdef HAVE_DMAPI | 1086 | #ifdef HAVE_DMAPI |
| 1069 | if (mp->m_flags & XFS_MOUNT_DMAPI) { | 1087 | if (mp->m_flags & XFS_MOUNT_DMAPI) { |
| @@ -1098,7 +1116,6 @@ xfs_fs_put_super( | |||
| 1098 | xfs_freesb(mp); | 1116 | xfs_freesb(mp); |
| 1099 | xfs_icsb_destroy_counters(mp); | 1117 | xfs_icsb_destroy_counters(mp); |
| 1100 | xfs_close_devices(mp); | 1118 | xfs_close_devices(mp); |
| 1101 | xfs_qmops_put(mp); | ||
| 1102 | xfs_dmops_put(mp); | 1119 | xfs_dmops_put(mp); |
| 1103 | xfs_free_fsname(mp); | 1120 | xfs_free_fsname(mp); |
| 1104 | kfree(mp); | 1121 | kfree(mp); |
| @@ -1158,6 +1175,7 @@ xfs_fs_statfs( | |||
| 1158 | { | 1175 | { |
| 1159 | struct xfs_mount *mp = XFS_M(dentry->d_sb); | 1176 | struct xfs_mount *mp = XFS_M(dentry->d_sb); |
| 1160 | xfs_sb_t *sbp = &mp->m_sb; | 1177 | xfs_sb_t *sbp = &mp->m_sb; |
| 1178 | struct xfs_inode *ip = XFS_I(dentry->d_inode); | ||
| 1161 | __uint64_t fakeinos, id; | 1179 | __uint64_t fakeinos, id; |
| 1162 | xfs_extlen_t lsize; | 1180 | xfs_extlen_t lsize; |
| 1163 | 1181 | ||
| @@ -1186,7 +1204,10 @@ xfs_fs_statfs( | |||
| 1186 | statp->f_ffree = statp->f_files - (sbp->sb_icount - sbp->sb_ifree); | 1204 | statp->f_ffree = statp->f_files - (sbp->sb_icount - sbp->sb_ifree); |
| 1187 | spin_unlock(&mp->m_sb_lock); | 1205 | spin_unlock(&mp->m_sb_lock); |
| 1188 | 1206 | ||
| 1189 | XFS_QM_DQSTATVFS(XFS_I(dentry->d_inode), statp); | 1207 | if ((ip->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) || |
| 1208 | ((mp->m_qflags & (XFS_PQUOTA_ACCT|XFS_OQUOTA_ENFD))) == | ||
| 1209 | (XFS_PQUOTA_ACCT|XFS_OQUOTA_ENFD)) | ||
| 1210 | xfs_qm_statvfs(ip, statp); | ||
| 1190 | return 0; | 1211 | return 0; |
| 1191 | } | 1212 | } |
| 1192 | 1213 | ||
| @@ -1394,16 +1415,13 @@ xfs_fs_fill_super( | |||
| 1394 | error = xfs_dmops_get(mp); | 1415 | error = xfs_dmops_get(mp); |
| 1395 | if (error) | 1416 | if (error) |
| 1396 | goto out_free_fsname; | 1417 | goto out_free_fsname; |
| 1397 | error = xfs_qmops_get(mp); | ||
| 1398 | if (error) | ||
| 1399 | goto out_put_dmops; | ||
| 1400 | 1418 | ||
| 1401 | if (silent) | 1419 | if (silent) |
| 1402 | flags |= XFS_MFSI_QUIET; | 1420 | flags |= XFS_MFSI_QUIET; |
| 1403 | 1421 | ||
| 1404 | error = xfs_open_devices(mp); | 1422 | error = xfs_open_devices(mp); |
| 1405 | if (error) | 1423 | if (error) |
| 1406 | goto out_put_qmops; | 1424 | goto out_put_dmops; |
| 1407 | 1425 | ||
| 1408 | if (xfs_icsb_init_counters(mp)) | 1426 | if (xfs_icsb_init_counters(mp)) |
| 1409 | mp->m_flags |= XFS_MOUNT_NO_PERCPU_SB; | 1427 | mp->m_flags |= XFS_MOUNT_NO_PERCPU_SB; |
| @@ -1471,8 +1489,6 @@ xfs_fs_fill_super( | |||
| 1471 | out_destroy_counters: | 1489 | out_destroy_counters: |
| 1472 | xfs_icsb_destroy_counters(mp); | 1490 | xfs_icsb_destroy_counters(mp); |
| 1473 | xfs_close_devices(mp); | 1491 | xfs_close_devices(mp); |
| 1474 | out_put_qmops: | ||
| 1475 | xfs_qmops_put(mp); | ||
| 1476 | out_put_dmops: | 1492 | out_put_dmops: |
| 1477 | xfs_dmops_put(mp); | 1493 | xfs_dmops_put(mp); |
| 1478 | out_free_fsname: | 1494 | out_free_fsname: |
| @@ -1706,18 +1722,8 @@ xfs_init_zones(void) | |||
| 1706 | if (!xfs_ili_zone) | 1722 | if (!xfs_ili_zone) |
| 1707 | goto out_destroy_inode_zone; | 1723 | goto out_destroy_inode_zone; |
| 1708 | 1724 | ||
| 1709 | #ifdef CONFIG_XFS_POSIX_ACL | ||
| 1710 | xfs_acl_zone = kmem_zone_init(sizeof(xfs_acl_t), "xfs_acl"); | ||
| 1711 | if (!xfs_acl_zone) | ||
| 1712 | goto out_destroy_ili_zone; | ||
| 1713 | #endif | ||
| 1714 | |||
| 1715 | return 0; | 1725 | return 0; |
| 1716 | 1726 | ||
| 1717 | #ifdef CONFIG_XFS_POSIX_ACL | ||
| 1718 | out_destroy_ili_zone: | ||
| 1719 | #endif | ||
| 1720 | kmem_zone_destroy(xfs_ili_zone); | ||
| 1721 | out_destroy_inode_zone: | 1727 | out_destroy_inode_zone: |
| 1722 | kmem_zone_destroy(xfs_inode_zone); | 1728 | kmem_zone_destroy(xfs_inode_zone); |
| 1723 | out_destroy_efi_zone: | 1729 | out_destroy_efi_zone: |
| @@ -1751,9 +1757,6 @@ xfs_init_zones(void) | |||
| 1751 | STATIC void | 1757 | STATIC void |
| 1752 | xfs_destroy_zones(void) | 1758 | xfs_destroy_zones(void) |
| 1753 | { | 1759 | { |
| 1754 | #ifdef CONFIG_XFS_POSIX_ACL | ||
| 1755 | kmem_zone_destroy(xfs_acl_zone); | ||
| 1756 | #endif | ||
| 1757 | kmem_zone_destroy(xfs_ili_zone); | 1760 | kmem_zone_destroy(xfs_ili_zone); |
| 1758 | kmem_zone_destroy(xfs_inode_zone); | 1761 | kmem_zone_destroy(xfs_inode_zone); |
| 1759 | kmem_zone_destroy(xfs_efi_zone); | 1762 | kmem_zone_destroy(xfs_efi_zone); |
