diff options
author | Christoph Hellwig <hch@sgi.com> | 2006-01-10 23:27:18 -0500 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2006-01-10 23:27:18 -0500 |
commit | 4ef19dddbaf2f24e492c18112fd8a04ce116daca (patch) | |
tree | 857a14290f682a9a1bc71d9a6b0e20f095c5cc91 /fs/xfs | |
parent | d3a9b1f9da4ee3e6d284148412097621b1c9e575 (diff) |
[XFS] enable write barriers by default
SGI-PV: 912426
SGI-Modid: xfs-linux-melb:xfs-kern:201981a
Signed-off-by: Christoph Hellwig <hch@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_super.c | 3 | ||||
-rw-r--r-- | fs/xfs/xfs_vfsops.c | 15 |
2 files changed, 17 insertions, 1 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 6116b5bf433e..d8ec7463d8f4 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c | |||
@@ -306,6 +306,7 @@ xfs_mountfs_check_barriers(xfs_mount_t *mp) | |||
306 | xfs_fs_cmn_err(CE_NOTE, mp, | 306 | xfs_fs_cmn_err(CE_NOTE, mp, |
307 | "Disabling barriers, not supported with external log device"); | 307 | "Disabling barriers, not supported with external log device"); |
308 | mp->m_flags &= ~XFS_MOUNT_BARRIER; | 308 | mp->m_flags &= ~XFS_MOUNT_BARRIER; |
309 | return; | ||
309 | } | 310 | } |
310 | 311 | ||
311 | if (mp->m_ddev_targp->pbr_bdev->bd_disk->queue->ordered == | 312 | if (mp->m_ddev_targp->pbr_bdev->bd_disk->queue->ordered == |
@@ -313,6 +314,7 @@ xfs_mountfs_check_barriers(xfs_mount_t *mp) | |||
313 | xfs_fs_cmn_err(CE_NOTE, mp, | 314 | xfs_fs_cmn_err(CE_NOTE, mp, |
314 | "Disabling barriers, not supported by the underlying device"); | 315 | "Disabling barriers, not supported by the underlying device"); |
315 | mp->m_flags &= ~XFS_MOUNT_BARRIER; | 316 | mp->m_flags &= ~XFS_MOUNT_BARRIER; |
317 | return; | ||
316 | } | 318 | } |
317 | 319 | ||
318 | error = xfs_barrier_test(mp); | 320 | error = xfs_barrier_test(mp); |
@@ -320,6 +322,7 @@ xfs_mountfs_check_barriers(xfs_mount_t *mp) | |||
320 | xfs_fs_cmn_err(CE_NOTE, mp, | 322 | xfs_fs_cmn_err(CE_NOTE, mp, |
321 | "Disabling barriers, trial barrier write failed"); | 323 | "Disabling barriers, trial barrier write failed"); |
322 | mp->m_flags &= ~XFS_MOUNT_BARRIER; | 324 | mp->m_flags &= ~XFS_MOUNT_BARRIER; |
325 | return; | ||
323 | } | 326 | } |
324 | } | 327 | } |
325 | 328 | ||
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index 7bdbd991ab1c..3406399e25b3 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c | |||
@@ -312,6 +312,8 @@ xfs_start_flags( | |||
312 | mp->m_flags |= XFS_MOUNT_NOUUID; | 312 | mp->m_flags |= XFS_MOUNT_NOUUID; |
313 | if (ap->flags & XFSMNT_BARRIER) | 313 | if (ap->flags & XFSMNT_BARRIER) |
314 | mp->m_flags |= XFS_MOUNT_BARRIER; | 314 | mp->m_flags |= XFS_MOUNT_BARRIER; |
315 | else | ||
316 | mp->m_flags &= ~XFS_MOUNT_BARRIER; | ||
315 | 317 | ||
316 | return 0; | 318 | return 0; |
317 | } | 319 | } |
@@ -655,6 +657,11 @@ xfs_mntupdate( | |||
655 | else | 657 | else |
656 | mp->m_flags &= ~XFS_MOUNT_NOATIME; | 658 | mp->m_flags &= ~XFS_MOUNT_NOATIME; |
657 | 659 | ||
660 | if (args->flags & XFSMNT_BARRIER) | ||
661 | mp->m_flags |= XFS_MOUNT_BARRIER; | ||
662 | else | ||
663 | mp->m_flags &= ~XFS_MOUNT_BARRIER; | ||
664 | |||
658 | if ((vfsp->vfs_flag & VFS_RDONLY) && | 665 | if ((vfsp->vfs_flag & VFS_RDONLY) && |
659 | !(*flags & MS_RDONLY)) { | 666 | !(*flags & MS_RDONLY)) { |
660 | vfsp->vfs_flag &= ~VFS_RDONLY; | 667 | vfsp->vfs_flag &= ~VFS_RDONLY; |
@@ -1634,6 +1641,7 @@ xfs_vget( | |||
1634 | #define MNTOPT_NORECOVERY "norecovery" /* don't run XFS recovery */ | 1641 | #define MNTOPT_NORECOVERY "norecovery" /* don't run XFS recovery */ |
1635 | #define MNTOPT_BARRIER "barrier" /* use writer barriers for log write and | 1642 | #define MNTOPT_BARRIER "barrier" /* use writer barriers for log write and |
1636 | * unwritten extent conversion */ | 1643 | * unwritten extent conversion */ |
1644 | #define MNTOPT_NOBARRIER "nobarrier" /* .. disable */ | ||
1637 | #define MNTOPT_OSYNCISOSYNC "osyncisosync" /* o_sync is REALLY o_sync */ | 1645 | #define MNTOPT_OSYNCISOSYNC "osyncisosync" /* o_sync is REALLY o_sync */ |
1638 | #define MNTOPT_64BITINODE "inode64" /* inodes can be allocated anywhere */ | 1646 | #define MNTOPT_64BITINODE "inode64" /* inodes can be allocated anywhere */ |
1639 | #define MNTOPT_IKEEP "ikeep" /* do not free empty inode clusters */ | 1647 | #define MNTOPT_IKEEP "ikeep" /* do not free empty inode clusters */ |
@@ -1681,6 +1689,7 @@ xfs_parseargs( | |||
1681 | 1689 | ||
1682 | args->flags2 |= XFSMNT2_COMPAT_IOSIZE; | 1690 | args->flags2 |= XFSMNT2_COMPAT_IOSIZE; |
1683 | args->flags |= XFSMNT_COMPAT_ATTR; | 1691 | args->flags |= XFSMNT_COMPAT_ATTR; |
1692 | args->flags |= XFSMNT_BARRIER; | ||
1684 | 1693 | ||
1685 | #if 0 /* XXX: off by default, until some remaining issues ironed out */ | 1694 | #if 0 /* XXX: off by default, until some remaining issues ironed out */ |
1686 | args->flags |= XFSMNT_IDELETE; /* default to on */ | 1695 | args->flags |= XFSMNT_IDELETE; /* default to on */ |
@@ -1806,6 +1815,8 @@ xfs_parseargs( | |||
1806 | args->flags |= XFSMNT_NOUUID; | 1815 | args->flags |= XFSMNT_NOUUID; |
1807 | } else if (!strcmp(this_char, MNTOPT_BARRIER)) { | 1816 | } else if (!strcmp(this_char, MNTOPT_BARRIER)) { |
1808 | args->flags |= XFSMNT_BARRIER; | 1817 | args->flags |= XFSMNT_BARRIER; |
1818 | } else if (!strcmp(this_char, MNTOPT_NOBARRIER)) { | ||
1819 | args->flags &= ~XFSMNT_BARRIER; | ||
1809 | } else if (!strcmp(this_char, MNTOPT_IKEEP)) { | 1820 | } else if (!strcmp(this_char, MNTOPT_IKEEP)) { |
1810 | args->flags &= ~XFSMNT_IDELETE; | 1821 | args->flags &= ~XFSMNT_IDELETE; |
1811 | } else if (!strcmp(this_char, MNTOPT_NOIKEEP)) { | 1822 | } else if (!strcmp(this_char, MNTOPT_NOIKEEP)) { |
@@ -1892,7 +1903,6 @@ xfs_showargs( | |||
1892 | { XFS_MOUNT_NOUUID, "," MNTOPT_NOUUID }, | 1903 | { XFS_MOUNT_NOUUID, "," MNTOPT_NOUUID }, |
1893 | { XFS_MOUNT_NORECOVERY, "," MNTOPT_NORECOVERY }, | 1904 | { XFS_MOUNT_NORECOVERY, "," MNTOPT_NORECOVERY }, |
1894 | { XFS_MOUNT_OSYNCISOSYNC, "," MNTOPT_OSYNCISOSYNC }, | 1905 | { XFS_MOUNT_OSYNCISOSYNC, "," MNTOPT_OSYNCISOSYNC }, |
1895 | { XFS_MOUNT_BARRIER, "," MNTOPT_BARRIER }, | ||
1896 | { XFS_MOUNT_IDELETE, "," MNTOPT_NOIKEEP }, | 1906 | { XFS_MOUNT_IDELETE, "," MNTOPT_NOIKEEP }, |
1897 | { 0, NULL } | 1907 | { 0, NULL } |
1898 | }; | 1908 | }; |
@@ -1941,6 +1951,9 @@ xfs_showargs( | |||
1941 | if (!(vfsp->vfs_flag & VFS_32BITINODES)) | 1951 | if (!(vfsp->vfs_flag & VFS_32BITINODES)) |
1942 | seq_printf(m, "," MNTOPT_64BITINODE); | 1952 | seq_printf(m, "," MNTOPT_64BITINODE); |
1943 | 1953 | ||
1954 | if (!(vfsp->vfs_flag & XFS_MOUNT_BARRIER)) | ||
1955 | seq_printf(m, "," MNTOPT_NOBARRIER); | ||
1956 | |||
1944 | if (vfsp->vfs_flag & VFS_GRPID) | 1957 | if (vfsp->vfs_flag & VFS_GRPID) |
1945 | seq_printf(m, "," MNTOPT_GRPID); | 1958 | seq_printf(m, "," MNTOPT_GRPID); |
1946 | 1959 | ||