diff options
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_super.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_super.c | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 818c4cf2de86..1ba5c451da36 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c | |||
@@ -1078,7 +1078,7 @@ xfs_fs_write_inode( | |||
1078 | error = 0; | 1078 | error = 0; |
1079 | goto out_unlock; | 1079 | goto out_unlock; |
1080 | } | 1080 | } |
1081 | error = xfs_iflush(ip, 0); | 1081 | error = xfs_iflush(ip, SYNC_TRYLOCK); |
1082 | } | 1082 | } |
1083 | 1083 | ||
1084 | out_unlock: | 1084 | out_unlock: |
@@ -1539,10 +1539,14 @@ xfs_fs_fill_super( | |||
1539 | if (error) | 1539 | if (error) |
1540 | goto out_free_sb; | 1540 | goto out_free_sb; |
1541 | 1541 | ||
1542 | error = xfs_mountfs(mp); | 1542 | /* |
1543 | if (error) | 1543 | * we must configure the block size in the superblock before we run the |
1544 | goto out_filestream_unmount; | 1544 | * full mount process as the mount process can lookup and cache inodes. |
1545 | 1545 | * For the same reason we must also initialise the syncd and register | |
1546 | * the inode cache shrinker so that inodes can be reclaimed during | ||
1547 | * operations like a quotacheck that iterate all inodes in the | ||
1548 | * filesystem. | ||
1549 | */ | ||
1546 | sb->s_magic = XFS_SB_MAGIC; | 1550 | sb->s_magic = XFS_SB_MAGIC; |
1547 | sb->s_blocksize = mp->m_sb.sb_blocksize; | 1551 | sb->s_blocksize = mp->m_sb.sb_blocksize; |
1548 | sb->s_blocksize_bits = ffs(sb->s_blocksize) - 1; | 1552 | sb->s_blocksize_bits = ffs(sb->s_blocksize) - 1; |
@@ -1550,6 +1554,16 @@ xfs_fs_fill_super( | |||
1550 | sb->s_time_gran = 1; | 1554 | sb->s_time_gran = 1; |
1551 | set_posix_acl_flag(sb); | 1555 | set_posix_acl_flag(sb); |
1552 | 1556 | ||
1557 | error = xfs_syncd_init(mp); | ||
1558 | if (error) | ||
1559 | goto out_filestream_unmount; | ||
1560 | |||
1561 | xfs_inode_shrinker_register(mp); | ||
1562 | |||
1563 | error = xfs_mountfs(mp); | ||
1564 | if (error) | ||
1565 | goto out_syncd_stop; | ||
1566 | |||
1553 | root = igrab(VFS_I(mp->m_rootip)); | 1567 | root = igrab(VFS_I(mp->m_rootip)); |
1554 | if (!root) { | 1568 | if (!root) { |
1555 | error = ENOENT; | 1569 | error = ENOENT; |
@@ -1565,14 +1579,11 @@ xfs_fs_fill_super( | |||
1565 | goto fail_vnrele; | 1579 | goto fail_vnrele; |
1566 | } | 1580 | } |
1567 | 1581 | ||
1568 | error = xfs_syncd_init(mp); | ||
1569 | if (error) | ||
1570 | goto fail_vnrele; | ||
1571 | |||
1572 | xfs_inode_shrinker_register(mp); | ||
1573 | |||
1574 | return 0; | 1582 | return 0; |
1575 | 1583 | ||
1584 | out_syncd_stop: | ||
1585 | xfs_inode_shrinker_unregister(mp); | ||
1586 | xfs_syncd_stop(mp); | ||
1576 | out_filestream_unmount: | 1587 | out_filestream_unmount: |
1577 | xfs_filestream_unmount(mp); | 1588 | xfs_filestream_unmount(mp); |
1578 | out_free_sb: | 1589 | out_free_sb: |
@@ -1596,6 +1607,9 @@ xfs_fs_fill_super( | |||
1596 | } | 1607 | } |
1597 | 1608 | ||
1598 | fail_unmount: | 1609 | fail_unmount: |
1610 | xfs_inode_shrinker_unregister(mp); | ||
1611 | xfs_syncd_stop(mp); | ||
1612 | |||
1599 | /* | 1613 | /* |
1600 | * Blow away any referenced inode in the filestreams cache. | 1614 | * Blow away any referenced inode in the filestreams cache. |
1601 | * This can and will cause log traffic as inodes go inactive | 1615 | * This can and will cause log traffic as inodes go inactive |