diff options
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_super.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_super.c | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 1e3a7ce804dc..a1a881e68a9a 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c | |||
@@ -627,68 +627,6 @@ xfs_blkdev_put( | |||
627 | blkdev_put(bdev, FMODE_READ|FMODE_WRITE|FMODE_EXCL); | 627 | blkdev_put(bdev, FMODE_READ|FMODE_WRITE|FMODE_EXCL); |
628 | } | 628 | } |
629 | 629 | ||
630 | /* | ||
631 | * Try to write out the superblock using barriers. | ||
632 | */ | ||
633 | STATIC int | ||
634 | xfs_barrier_test( | ||
635 | xfs_mount_t *mp) | ||
636 | { | ||
637 | xfs_buf_t *sbp = xfs_getsb(mp, 0); | ||
638 | int error; | ||
639 | |||
640 | XFS_BUF_UNDONE(sbp); | ||
641 | XFS_BUF_UNREAD(sbp); | ||
642 | XFS_BUF_UNDELAYWRITE(sbp); | ||
643 | XFS_BUF_WRITE(sbp); | ||
644 | XFS_BUF_UNASYNC(sbp); | ||
645 | XFS_BUF_ORDERED(sbp); | ||
646 | |||
647 | xfsbdstrat(mp, sbp); | ||
648 | error = xfs_buf_iowait(sbp); | ||
649 | |||
650 | /* | ||
651 | * Clear all the flags we set and possible error state in the | ||
652 | * buffer. We only did the write to try out whether barriers | ||
653 | * worked and shouldn't leave any traces in the superblock | ||
654 | * buffer. | ||
655 | */ | ||
656 | XFS_BUF_DONE(sbp); | ||
657 | XFS_BUF_ERROR(sbp, 0); | ||
658 | XFS_BUF_UNORDERED(sbp); | ||
659 | |||
660 | xfs_buf_relse(sbp); | ||
661 | return error; | ||
662 | } | ||
663 | |||
664 | STATIC void | ||
665 | xfs_mountfs_check_barriers(xfs_mount_t *mp) | ||
666 | { | ||
667 | int error; | ||
668 | |||
669 | if (mp->m_logdev_targp != mp->m_ddev_targp) { | ||
670 | xfs_notice(mp, | ||
671 | "Disabling barriers, not supported with external log device"); | ||
672 | mp->m_flags &= ~XFS_MOUNT_BARRIER; | ||
673 | return; | ||
674 | } | ||
675 | |||
676 | if (xfs_readonly_buftarg(mp->m_ddev_targp)) { | ||
677 | xfs_notice(mp, | ||
678 | "Disabling barriers, underlying device is readonly"); | ||
679 | mp->m_flags &= ~XFS_MOUNT_BARRIER; | ||
680 | return; | ||
681 | } | ||
682 | |||
683 | error = xfs_barrier_test(mp); | ||
684 | if (error) { | ||
685 | xfs_notice(mp, | ||
686 | "Disabling barriers, trial barrier write failed"); | ||
687 | mp->m_flags &= ~XFS_MOUNT_BARRIER; | ||
688 | return; | ||
689 | } | ||
690 | } | ||
691 | |||
692 | void | 630 | void |
693 | xfs_blkdev_issue_flush( | 631 | xfs_blkdev_issue_flush( |
694 | xfs_buftarg_t *buftarg) | 632 | xfs_buftarg_t *buftarg) |
@@ -1240,14 +1178,6 @@ xfs_fs_remount( | |||
1240 | switch (token) { | 1178 | switch (token) { |
1241 | case Opt_barrier: | 1179 | case Opt_barrier: |
1242 | mp->m_flags |= XFS_MOUNT_BARRIER; | 1180 | mp->m_flags |= XFS_MOUNT_BARRIER; |
1243 | |||
1244 | /* | ||
1245 | * Test if barriers are actually working if we can, | ||
1246 | * else delay this check until the filesystem is | ||
1247 | * marked writeable. | ||
1248 | */ | ||
1249 | if (!(mp->m_flags & XFS_MOUNT_RDONLY)) | ||
1250 | xfs_mountfs_check_barriers(mp); | ||
1251 | break; | 1181 | break; |
1252 | case Opt_nobarrier: | 1182 | case Opt_nobarrier: |
1253 | mp->m_flags &= ~XFS_MOUNT_BARRIER; | 1183 | mp->m_flags &= ~XFS_MOUNT_BARRIER; |
@@ -1282,8 +1212,6 @@ xfs_fs_remount( | |||
1282 | /* ro -> rw */ | 1212 | /* ro -> rw */ |
1283 | if ((mp->m_flags & XFS_MOUNT_RDONLY) && !(*flags & MS_RDONLY)) { | 1213 | if ((mp->m_flags & XFS_MOUNT_RDONLY) && !(*flags & MS_RDONLY)) { |
1284 | mp->m_flags &= ~XFS_MOUNT_RDONLY; | 1214 | mp->m_flags &= ~XFS_MOUNT_RDONLY; |
1285 | if (mp->m_flags & XFS_MOUNT_BARRIER) | ||
1286 | xfs_mountfs_check_barriers(mp); | ||
1287 | 1215 | ||
1288 | /* | 1216 | /* |
1289 | * If this is the first remount to writeable state we | 1217 | * If this is the first remount to writeable state we |
@@ -1465,9 +1393,6 @@ xfs_fs_fill_super( | |||
1465 | if (error) | 1393 | if (error) |
1466 | goto out_free_sb; | 1394 | goto out_free_sb; |
1467 | 1395 | ||
1468 | if (mp->m_flags & XFS_MOUNT_BARRIER) | ||
1469 | xfs_mountfs_check_barriers(mp); | ||
1470 | |||
1471 | error = xfs_filestream_mount(mp); | 1396 | error = xfs_filestream_mount(mp); |
1472 | if (error) | 1397 | if (error) |
1473 | goto out_free_sb; | 1398 | goto out_free_sb; |