aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_vfsops.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2007-08-30 03:21:12 -0400
committerTim Shimmin <tes@chook.melbourne.sgi.com>2007-10-15 21:45:57 -0400
commitbd186aa901c183d6e25257711b6c64b42a90dde0 (patch)
treea84157145a249923a79276d7bc9170701b100c43 /fs/xfs/xfs_vfsops.c
parent0ce4cfd4f7dde5891d5b3e3c1a28ff7a7b4d36b3 (diff)
[XFS] kill the vfs_flags member in struct bhv_vfs
All flags are added to xfs_mount's m_flag instead. Note that the 32bit inode flag was duplicated in both of them, but only cleared in the mount when it was not nessecary due to the filesystem beeing small enough. Two flags are still required here - one to indicate the mount option setting, and one to indicate if it applies or not. SGI-PV: 969608 SGI-Modid: xfs-linux-melb:xfs-kern:29507a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_vfsops.c')
-rw-r--r--fs/xfs/xfs_vfsops.c36
1 files changed, 16 insertions, 20 deletions
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c
index 593e6e2b3921..febfd8367e13 100644
--- a/fs/xfs/xfs_vfsops.c
+++ b/fs/xfs/xfs_vfsops.c
@@ -307,7 +307,7 @@ xfs_start_flags(
307 * no recovery flag requires a read-only mount 307 * no recovery flag requires a read-only mount
308 */ 308 */
309 if (ap->flags & XFSMNT_NORECOVERY) { 309 if (ap->flags & XFSMNT_NORECOVERY) {
310 if (!(vfs->vfs_flag & VFS_RDONLY)) { 310 if (!(mp->m_flags & XFS_MOUNT_RDONLY)) {
311 cmn_err(CE_WARN, 311 cmn_err(CE_WARN,
312 "XFS: tried to mount a FS read-write without recovery!"); 312 "XFS: tried to mount a FS read-write without recovery!");
313 return XFS_ERROR(EINVAL); 313 return XFS_ERROR(EINVAL);
@@ -326,7 +326,7 @@ xfs_start_flags(
326 mp->m_flags |= XFS_MOUNT_FILESTREAMS; 326 mp->m_flags |= XFS_MOUNT_FILESTREAMS;
327 327
328 if (ap->flags & XFSMNT_DMAPI) 328 if (ap->flags & XFSMNT_DMAPI)
329 vfs->vfs_flag |= VFS_DMI; 329 mp->m_flags |= XFS_MOUNT_DMAPI;
330 return 0; 330 return 0;
331} 331}
332 332
@@ -340,7 +340,7 @@ xfs_finish_flags(
340 struct xfs_mount_args *ap, 340 struct xfs_mount_args *ap,
341 struct xfs_mount *mp) 341 struct xfs_mount *mp)
342{ 342{
343 int ronly = (vfs->vfs_flag & VFS_RDONLY); 343 int ronly = (mp->m_flags & XFS_MOUNT_RDONLY);
344 344
345 /* Fail a mount where the logbuf is smaller then the log stripe */ 345 /* Fail a mount where the logbuf is smaller then the log stripe */
346 if (XFS_SB_VERSION_HASLOGV2(&mp->m_sb)) { 346 if (XFS_SB_VERSION_HASLOGV2(&mp->m_sb)) {
@@ -589,7 +589,7 @@ xfs_unmount(
589 rvp = XFS_ITOV(rip); 589 rvp = XFS_ITOV(rip);
590 590
591#ifdef HAVE_DMAPI 591#ifdef HAVE_DMAPI
592 if (vfsp->vfs_flag & VFS_DMI) { 592 if (mp->m_flags & XFS_MOUNT_DMAPI) {
593 error = XFS_SEND_PREUNMOUNT(mp, vfsp, 593 error = XFS_SEND_PREUNMOUNT(mp, vfsp,
594 rvp, DM_RIGHT_NULL, rvp, DM_RIGHT_NULL, 594 rvp, DM_RIGHT_NULL, rvp, DM_RIGHT_NULL,
595 NULL, NULL, 0, 0, 595 NULL, NULL, 0, 0,
@@ -723,22 +723,20 @@ xfs_mntupdate(
723 int *flags, 723 int *flags,
724 struct xfs_mount_args *args) 724 struct xfs_mount_args *args)
725{ 725{
726 struct bhv_vfs *vfsp = XFS_MTOVFS(mp);
727
728 if (!(*flags & MS_RDONLY)) { /* rw/ro -> rw */ 726 if (!(*flags & MS_RDONLY)) { /* rw/ro -> rw */
729 if (vfsp->vfs_flag & VFS_RDONLY) 727 if (mp->m_flags & XFS_MOUNT_RDONLY)
730 vfsp->vfs_flag &= ~VFS_RDONLY; 728 mp->m_flags &= ~XFS_MOUNT_RDONLY;
731 if (args->flags & XFSMNT_BARRIER) { 729 if (args->flags & XFSMNT_BARRIER) {
732 mp->m_flags |= XFS_MOUNT_BARRIER; 730 mp->m_flags |= XFS_MOUNT_BARRIER;
733 xfs_mountfs_check_barriers(mp); 731 xfs_mountfs_check_barriers(mp);
734 } else { 732 } else {
735 mp->m_flags &= ~XFS_MOUNT_BARRIER; 733 mp->m_flags &= ~XFS_MOUNT_BARRIER;
736 } 734 }
737 } else if (!(vfsp->vfs_flag & VFS_RDONLY)) { /* rw -> ro */ 735 } else if (!(mp->m_flags & XFS_MOUNT_RDONLY)) { /* rw -> ro */
738 xfs_filestream_flush(mp); 736 xfs_filestream_flush(mp);
739 xfs_sync(mp, SYNC_DATA_QUIESCE); 737 xfs_sync(mp, SYNC_DATA_QUIESCE);
740 xfs_attr_quiesce(mp); 738 xfs_attr_quiesce(mp);
741 vfsp->vfs_flag |= VFS_RDONLY; 739 mp->m_flags |= XFS_MOUNT_RDONLY;
742 } 740 }
743 return 0; 741 return 0;
744} 742}
@@ -1053,7 +1051,7 @@ xfs_sync_inodes(
1053 1051
1054 if (bypassed) 1052 if (bypassed)
1055 *bypassed = 0; 1053 *bypassed = 0;
1056 if (XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY) 1054 if (mp->m_flags & XFS_MOUNT_RDONLY)
1057 return 0; 1055 return 0;
1058 error = 0; 1056 error = 0;
1059 last_error = 0; 1057 last_error = 0;
@@ -1766,7 +1764,6 @@ xfs_parseargs(
1766 struct xfs_mount_args *args, 1764 struct xfs_mount_args *args,
1767 int update) 1765 int update)
1768{ 1766{
1769 bhv_vfs_t *vfsp = XFS_MTOVFS(mp);
1770 char *this_char, *value, *eov; 1767 char *this_char, *value, *eov;
1771 int dsunit, dswidth, vol_dsunit, vol_dswidth; 1768 int dsunit, dswidth, vol_dsunit, vol_dswidth;
1772 int iosize; 1769 int iosize;
@@ -1859,10 +1856,10 @@ xfs_parseargs(
1859 args->iosizelog = ffs(iosize) - 1; 1856 args->iosizelog = ffs(iosize) - 1;
1860 } else if (!strcmp(this_char, MNTOPT_GRPID) || 1857 } else if (!strcmp(this_char, MNTOPT_GRPID) ||
1861 !strcmp(this_char, MNTOPT_BSDGROUPS)) { 1858 !strcmp(this_char, MNTOPT_BSDGROUPS)) {
1862 vfsp->vfs_flag |= VFS_GRPID; 1859 mp->m_flags |= XFS_MOUNT_GRPID;
1863 } else if (!strcmp(this_char, MNTOPT_NOGRPID) || 1860 } else if (!strcmp(this_char, MNTOPT_NOGRPID) ||
1864 !strcmp(this_char, MNTOPT_SYSVGROUPS)) { 1861 !strcmp(this_char, MNTOPT_SYSVGROUPS)) {
1865 vfsp->vfs_flag &= ~VFS_GRPID; 1862 mp->m_flags &= ~XFS_MOUNT_GRPID;
1866 } else if (!strcmp(this_char, MNTOPT_WSYNC)) { 1863 } else if (!strcmp(this_char, MNTOPT_WSYNC)) {
1867 args->flags |= XFSMNT_WSYNC; 1864 args->flags |= XFSMNT_WSYNC;
1868 } else if (!strcmp(this_char, MNTOPT_OSYNCISOSYNC)) { 1865 } else if (!strcmp(this_char, MNTOPT_OSYNCISOSYNC)) {
@@ -1972,7 +1969,7 @@ xfs_parseargs(
1972 } 1969 }
1973 1970
1974 if (args->flags & XFSMNT_NORECOVERY) { 1971 if (args->flags & XFSMNT_NORECOVERY) {
1975 if ((vfsp->vfs_flag & VFS_RDONLY) == 0) { 1972 if ((mp->m_flags & XFS_MOUNT_RDONLY) == 0) {
1976 cmn_err(CE_WARN, 1973 cmn_err(CE_WARN,
1977 "XFS: no-recovery mounts must be read-only."); 1974 "XFS: no-recovery mounts must be read-only.");
1978 return EINVAL; 1975 return EINVAL;
@@ -2025,7 +2022,7 @@ xfs_parseargs(
2025 2022
2026done: 2023done:
2027 if (args->flags & XFSMNT_32BITINODES) 2024 if (args->flags & XFSMNT_32BITINODES)
2028 vfsp->vfs_flag |= VFS_32BITINODES; 2025 mp->m_flags |= XFS_MOUNT_SMALL_INUMS;
2029 if (args->flags2) 2026 if (args->flags2)
2030 args->flags |= XFSMNT_FLAGS2; 2027 args->flags |= XFSMNT_FLAGS2;
2031 return 0; 2028 return 0;
@@ -2051,7 +2048,6 @@ xfs_showargs(
2051 { 0, NULL } 2048 { 0, NULL }
2052 }; 2049 };
2053 struct proc_xfs_info *xfs_infop; 2050 struct proc_xfs_info *xfs_infop;
2054 struct bhv_vfs *vfsp = XFS_MTOVFS(mp);
2055 2051
2056 for (xfs_infop = xfs_info; xfs_infop->flag; xfs_infop++) { 2052 for (xfs_infop = xfs_info; xfs_infop->flag; xfs_infop++) {
2057 if (mp->m_flags & xfs_infop->flag) 2053 if (mp->m_flags & xfs_infop->flag)
@@ -2084,9 +2080,9 @@ xfs_showargs(
2084 if (!(mp->m_flags & XFS_MOUNT_COMPAT_IOSIZE)) 2080 if (!(mp->m_flags & XFS_MOUNT_COMPAT_IOSIZE))
2085 seq_printf(m, "," MNTOPT_LARGEIO); 2081 seq_printf(m, "," MNTOPT_LARGEIO);
2086 2082
2087 if (!(vfsp->vfs_flag & VFS_32BITINODES)) 2083 if (!(mp->m_flags & XFS_MOUNT_SMALL_INUMS))
2088 seq_printf(m, "," MNTOPT_64BITINODE); 2084 seq_printf(m, "," MNTOPT_64BITINODE);
2089 if (vfsp->vfs_flag & VFS_GRPID) 2085 if (mp->m_flags & XFS_MOUNT_GRPID)
2090 seq_printf(m, "," MNTOPT_GRPID); 2086 seq_printf(m, "," MNTOPT_GRPID);
2091 2087
2092 if (mp->m_qflags & XFS_UQUOTA_ACCT) { 2088 if (mp->m_qflags & XFS_UQUOTA_ACCT) {
@@ -2113,7 +2109,7 @@ xfs_showargs(
2113 if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT)) 2109 if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT))
2114 seq_puts(m, "," MNTOPT_NOQUOTA); 2110 seq_puts(m, "," MNTOPT_NOQUOTA);
2115 2111
2116 if (vfsp->vfs_flag & VFS_DMI) 2112 if (mp->m_flags & XFS_MOUNT_DMAPI)
2117 seq_puts(m, "," MNTOPT_DMAPI); 2113 seq_puts(m, "," MNTOPT_DMAPI);
2118 return 0; 2114 return 0;
2119} 2115}