diff options
Diffstat (limited to 'fs/xfs/xfs_vfsops.c')
-rw-r--r-- | fs/xfs/xfs_vfsops.c | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index 7bdbd991ab1c..b6ad370fab3d 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c | |||
@@ -53,6 +53,7 @@ | |||
53 | #include "xfs_acl.h" | 53 | #include "xfs_acl.h" |
54 | #include "xfs_attr.h" | 54 | #include "xfs_attr.h" |
55 | #include "xfs_clnt.h" | 55 | #include "xfs_clnt.h" |
56 | #include "xfs_fsops.h" | ||
56 | 57 | ||
57 | STATIC int xfs_sync(bhv_desc_t *, int, cred_t *); | 58 | STATIC int xfs_sync(bhv_desc_t *, int, cred_t *); |
58 | 59 | ||
@@ -290,8 +291,8 @@ xfs_start_flags( | |||
290 | mp->m_flags |= XFS_MOUNT_IDELETE; | 291 | mp->m_flags |= XFS_MOUNT_IDELETE; |
291 | if (ap->flags & XFSMNT_DIRSYNC) | 292 | if (ap->flags & XFSMNT_DIRSYNC) |
292 | mp->m_flags |= XFS_MOUNT_DIRSYNC; | 293 | mp->m_flags |= XFS_MOUNT_DIRSYNC; |
293 | if (ap->flags & XFSMNT_COMPAT_ATTR) | 294 | if (ap->flags & XFSMNT_ATTR2) |
294 | mp->m_flags |= XFS_MOUNT_COMPAT_ATTR; | 295 | mp->m_flags |= XFS_MOUNT_ATTR2; |
295 | 296 | ||
296 | if (ap->flags2 & XFSMNT2_COMPAT_IOSIZE) | 297 | if (ap->flags2 & XFSMNT2_COMPAT_IOSIZE) |
297 | mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE; | 298 | mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE; |
@@ -312,6 +313,8 @@ xfs_start_flags( | |||
312 | mp->m_flags |= XFS_MOUNT_NOUUID; | 313 | mp->m_flags |= XFS_MOUNT_NOUUID; |
313 | if (ap->flags & XFSMNT_BARRIER) | 314 | if (ap->flags & XFSMNT_BARRIER) |
314 | mp->m_flags |= XFS_MOUNT_BARRIER; | 315 | mp->m_flags |= XFS_MOUNT_BARRIER; |
316 | else | ||
317 | mp->m_flags &= ~XFS_MOUNT_BARRIER; | ||
315 | 318 | ||
316 | return 0; | 319 | return 0; |
317 | } | 320 | } |
@@ -330,10 +333,11 @@ xfs_finish_flags( | |||
330 | 333 | ||
331 | /* Fail a mount where the logbuf is smaller then the log stripe */ | 334 | /* Fail a mount where the logbuf is smaller then the log stripe */ |
332 | if (XFS_SB_VERSION_HASLOGV2(&mp->m_sb)) { | 335 | if (XFS_SB_VERSION_HASLOGV2(&mp->m_sb)) { |
333 | if ((ap->logbufsize == -1) && | 336 | if ((ap->logbufsize <= 0) && |
334 | (mp->m_sb.sb_logsunit > XLOG_BIG_RECORD_BSIZE)) { | 337 | (mp->m_sb.sb_logsunit > XLOG_BIG_RECORD_BSIZE)) { |
335 | mp->m_logbsize = mp->m_sb.sb_logsunit; | 338 | mp->m_logbsize = mp->m_sb.sb_logsunit; |
336 | } else if (ap->logbufsize < mp->m_sb.sb_logsunit) { | 339 | } else if (ap->logbufsize > 0 && |
340 | ap->logbufsize < mp->m_sb.sb_logsunit) { | ||
337 | cmn_err(CE_WARN, | 341 | cmn_err(CE_WARN, |
338 | "XFS: logbuf size must be greater than or equal to log stripe size"); | 342 | "XFS: logbuf size must be greater than or equal to log stripe size"); |
339 | return XFS_ERROR(EINVAL); | 343 | return XFS_ERROR(EINVAL); |
@@ -347,6 +351,10 @@ xfs_finish_flags( | |||
347 | } | 351 | } |
348 | } | 352 | } |
349 | 353 | ||
354 | if (XFS_SB_VERSION_HASATTR2(&mp->m_sb)) { | ||
355 | mp->m_flags |= XFS_MOUNT_ATTR2; | ||
356 | } | ||
357 | |||
350 | /* | 358 | /* |
351 | * prohibit r/w mounts of read-only filesystems | 359 | * prohibit r/w mounts of read-only filesystems |
352 | */ | 360 | */ |
@@ -382,10 +390,6 @@ xfs_finish_flags( | |||
382 | return XFS_ERROR(EINVAL); | 390 | return XFS_ERROR(EINVAL); |
383 | } | 391 | } |
384 | 392 | ||
385 | if (XFS_SB_VERSION_HASATTR2(&mp->m_sb)) { | ||
386 | mp->m_flags &= ~XFS_MOUNT_COMPAT_ATTR; | ||
387 | } | ||
388 | |||
389 | return 0; | 393 | return 0; |
390 | } | 394 | } |
391 | 395 | ||
@@ -504,13 +508,13 @@ xfs_mount( | |||
504 | if (error) | 508 | if (error) |
505 | goto error2; | 509 | goto error2; |
506 | 510 | ||
511 | if ((mp->m_flags & XFS_MOUNT_BARRIER) && !(vfsp->vfs_flag & VFS_RDONLY)) | ||
512 | xfs_mountfs_check_barriers(mp); | ||
513 | |||
507 | error = XFS_IOINIT(vfsp, args, flags); | 514 | error = XFS_IOINIT(vfsp, args, flags); |
508 | if (error) | 515 | if (error) |
509 | goto error2; | 516 | goto error2; |
510 | 517 | ||
511 | if ((args->flags & XFSMNT_BARRIER) && | ||
512 | !(XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY)) | ||
513 | xfs_mountfs_check_barriers(mp); | ||
514 | return 0; | 518 | return 0; |
515 | 519 | ||
516 | error2: | 520 | error2: |
@@ -655,6 +659,11 @@ xfs_mntupdate( | |||
655 | else | 659 | else |
656 | mp->m_flags &= ~XFS_MOUNT_NOATIME; | 660 | mp->m_flags &= ~XFS_MOUNT_NOATIME; |
657 | 661 | ||
662 | if (args->flags & XFSMNT_BARRIER) | ||
663 | mp->m_flags |= XFS_MOUNT_BARRIER; | ||
664 | else | ||
665 | mp->m_flags &= ~XFS_MOUNT_BARRIER; | ||
666 | |||
658 | if ((vfsp->vfs_flag & VFS_RDONLY) && | 667 | if ((vfsp->vfs_flag & VFS_RDONLY) && |
659 | !(*flags & MS_RDONLY)) { | 668 | !(*flags & MS_RDONLY)) { |
660 | vfsp->vfs_flag &= ~VFS_RDONLY; | 669 | vfsp->vfs_flag &= ~VFS_RDONLY; |
@@ -1634,6 +1643,7 @@ xfs_vget( | |||
1634 | #define MNTOPT_NORECOVERY "norecovery" /* don't run XFS recovery */ | 1643 | #define MNTOPT_NORECOVERY "norecovery" /* don't run XFS recovery */ |
1635 | #define MNTOPT_BARRIER "barrier" /* use writer barriers for log write and | 1644 | #define MNTOPT_BARRIER "barrier" /* use writer barriers for log write and |
1636 | * unwritten extent conversion */ | 1645 | * unwritten extent conversion */ |
1646 | #define MNTOPT_NOBARRIER "nobarrier" /* .. disable */ | ||
1637 | #define MNTOPT_OSYNCISOSYNC "osyncisosync" /* o_sync is REALLY o_sync */ | 1647 | #define MNTOPT_OSYNCISOSYNC "osyncisosync" /* o_sync is REALLY o_sync */ |
1638 | #define MNTOPT_64BITINODE "inode64" /* inodes can be allocated anywhere */ | 1648 | #define MNTOPT_64BITINODE "inode64" /* inodes can be allocated anywhere */ |
1639 | #define MNTOPT_IKEEP "ikeep" /* do not free empty inode clusters */ | 1649 | #define MNTOPT_IKEEP "ikeep" /* do not free empty inode clusters */ |
@@ -1680,7 +1690,6 @@ xfs_parseargs( | |||
1680 | int iosize; | 1690 | int iosize; |
1681 | 1691 | ||
1682 | args->flags2 |= XFSMNT2_COMPAT_IOSIZE; | 1692 | args->flags2 |= XFSMNT2_COMPAT_IOSIZE; |
1683 | args->flags |= XFSMNT_COMPAT_ATTR; | ||
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)) { |
@@ -1815,9 +1826,9 @@ xfs_parseargs( | |||
1815 | } else if (!strcmp(this_char, MNTOPT_NOLARGEIO)) { | 1826 | } else if (!strcmp(this_char, MNTOPT_NOLARGEIO)) { |
1816 | args->flags2 |= XFSMNT2_COMPAT_IOSIZE; | 1827 | args->flags2 |= XFSMNT2_COMPAT_IOSIZE; |
1817 | } else if (!strcmp(this_char, MNTOPT_ATTR2)) { | 1828 | } else if (!strcmp(this_char, MNTOPT_ATTR2)) { |
1818 | args->flags &= ~XFSMNT_COMPAT_ATTR; | 1829 | args->flags |= XFSMNT_ATTR2; |
1819 | } else if (!strcmp(this_char, MNTOPT_NOATTR2)) { | 1830 | } else if (!strcmp(this_char, MNTOPT_NOATTR2)) { |
1820 | args->flags |= XFSMNT_COMPAT_ATTR; | 1831 | args->flags &= ~XFSMNT_ATTR2; |
1821 | } else if (!strcmp(this_char, "osyncisdsync")) { | 1832 | } else if (!strcmp(this_char, "osyncisdsync")) { |
1822 | /* no-op, this is now the default */ | 1833 | /* no-op, this is now the default */ |
1823 | printk("XFS: osyncisdsync is now the default, option is deprecated.\n"); | 1834 | printk("XFS: osyncisdsync is now the default, option is deprecated.\n"); |
@@ -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 | }; |
@@ -1914,33 +1924,28 @@ xfs_showargs( | |||
1914 | 1924 | ||
1915 | if (mp->m_logbufs > 0) | 1925 | if (mp->m_logbufs > 0) |
1916 | seq_printf(m, "," MNTOPT_LOGBUFS "=%d", mp->m_logbufs); | 1926 | seq_printf(m, "," MNTOPT_LOGBUFS "=%d", mp->m_logbufs); |
1917 | |||
1918 | if (mp->m_logbsize > 0) | 1927 | if (mp->m_logbsize > 0) |
1919 | seq_printf(m, "," MNTOPT_LOGBSIZE "=%dk", mp->m_logbsize >> 10); | 1928 | seq_printf(m, "," MNTOPT_LOGBSIZE "=%dk", mp->m_logbsize >> 10); |
1920 | 1929 | ||
1921 | if (mp->m_logname) | 1930 | if (mp->m_logname) |
1922 | seq_printf(m, "," MNTOPT_LOGDEV "=%s", mp->m_logname); | 1931 | seq_printf(m, "," MNTOPT_LOGDEV "=%s", mp->m_logname); |
1923 | |||
1924 | if (mp->m_rtname) | 1932 | if (mp->m_rtname) |
1925 | seq_printf(m, "," MNTOPT_RTDEV "=%s", mp->m_rtname); | 1933 | seq_printf(m, "," MNTOPT_RTDEV "=%s", mp->m_rtname); |
1926 | 1934 | ||
1927 | if (mp->m_dalign > 0) | 1935 | if (mp->m_dalign > 0) |
1928 | seq_printf(m, "," MNTOPT_SUNIT "=%d", | 1936 | seq_printf(m, "," MNTOPT_SUNIT "=%d", |
1929 | (int)XFS_FSB_TO_BB(mp, mp->m_dalign)); | 1937 | (int)XFS_FSB_TO_BB(mp, mp->m_dalign)); |
1930 | |||
1931 | if (mp->m_swidth > 0) | 1938 | if (mp->m_swidth > 0) |
1932 | seq_printf(m, "," MNTOPT_SWIDTH "=%d", | 1939 | seq_printf(m, "," MNTOPT_SWIDTH "=%d", |
1933 | (int)XFS_FSB_TO_BB(mp, mp->m_swidth)); | 1940 | (int)XFS_FSB_TO_BB(mp, mp->m_swidth)); |
1934 | 1941 | ||
1935 | if (!(mp->m_flags & XFS_MOUNT_COMPAT_ATTR)) | ||
1936 | seq_printf(m, "," MNTOPT_ATTR2); | ||
1937 | |||
1938 | if (!(mp->m_flags & XFS_MOUNT_COMPAT_IOSIZE)) | 1942 | if (!(mp->m_flags & XFS_MOUNT_COMPAT_IOSIZE)) |
1939 | seq_printf(m, "," MNTOPT_LARGEIO); | 1943 | seq_printf(m, "," MNTOPT_LARGEIO); |
1944 | if (mp->m_flags & XFS_MOUNT_BARRIER) | ||
1945 | seq_printf(m, "," MNTOPT_BARRIER); | ||
1940 | 1946 | ||
1941 | if (!(vfsp->vfs_flag & VFS_32BITINODES)) | 1947 | if (!(vfsp->vfs_flag & VFS_32BITINODES)) |
1942 | seq_printf(m, "," MNTOPT_64BITINODE); | 1948 | seq_printf(m, "," MNTOPT_64BITINODE); |
1943 | |||
1944 | if (vfsp->vfs_flag & VFS_GRPID) | 1949 | if (vfsp->vfs_flag & VFS_GRPID) |
1945 | seq_printf(m, "," MNTOPT_GRPID); | 1950 | seq_printf(m, "," MNTOPT_GRPID); |
1946 | 1951 | ||
@@ -1959,6 +1964,7 @@ xfs_freeze( | |||
1959 | /* Push the superblock and write an unmount record */ | 1964 | /* Push the superblock and write an unmount record */ |
1960 | xfs_log_unmount_write(mp); | 1965 | xfs_log_unmount_write(mp); |
1961 | xfs_unmountfs_writesb(mp); | 1966 | xfs_unmountfs_writesb(mp); |
1967 | xfs_fs_log_dummy(mp); | ||
1962 | } | 1968 | } |
1963 | 1969 | ||
1964 | 1970 | ||