[XFS] kill the vfs_flags member in struct bhv_vfs
authorChristoph Hellwig <hch@infradead.org>
Thu, 30 Aug 2007 07:21:12 +0000 (17:21 +1000)
committerTim Shimmin <tes@chook.melbourne.sgi.com>
Tue, 16 Oct 2007 01:45:57 +0000 (11:45 +1000)
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>
16 files changed:
fs/xfs/linux-2.6/xfs_export.c
fs/xfs/linux-2.6/xfs_file.c
fs/xfs/linux-2.6/xfs_super.c
fs/xfs/linux-2.6/xfs_vfs.c
fs/xfs/linux-2.6/xfs_vfs.h
fs/xfs/quota/xfs_qm.c
fs/xfs/quota/xfs_qm_syscalls.c
fs/xfs/xfs_dmapi.h
fs/xfs/xfs_inode.c
fs/xfs/xfs_inode.h
fs/xfs/xfs_log.c
fs/xfs/xfs_mount.c
fs/xfs/xfs_mount.h
fs/xfs/xfs_qmops.c
fs/xfs/xfs_vfsops.c
fs/xfs/xfs_vnodeops.c

index 4ed28a6767bbc3c58824627e4c6bf65440a46f52..726449d4fd223fc80817968e50c77d1e92f3977f 100644 (file)
@@ -102,9 +102,7 @@ xfs_fs_encode_fh(
        int                     len;
        int                     is64 = 0;
 #if XFS_BIG_INUMS
-       bhv_vfs_t               *vfs = vfs_from_sb(inode->i_sb);
-
-       if (!(vfs->vfs_flag & VFS_32BITINODES)) {
+       if (!(XFS_M(inode->i_sb)->m_flags & XFS_MOUNT_SMALL_INUMS)) {
                /* filesystem may contain 64bit inode numbers */
                is64 = XFS_FILEID_TYPE_64FLAG;
        }
index 123659e74b53aa11c9595f5c74811f733914d49a..fb8dd34041eb1cfec27efb511c10b27613a95d42 100644 (file)
@@ -259,7 +259,7 @@ xfs_file_mmap(
        vma->vm_flags |= VM_CAN_NONLINEAR;
 
 #ifdef CONFIG_XFS_DMAPI
-       if (vfs_from_sb(filp->f_path.dentry->d_inode->i_sb)->vfs_flag & VFS_DMI)
+       if (XFS_M(filp->f_path.dentry->d_inode->i_sb)->m_flags & XFS_MOUNT_DMAPI)
                vma->vm_ops = &xfs_dmapi_file_vm_ops;
 #endif /* CONFIG_XFS_DMAPI */
 
@@ -317,13 +317,13 @@ xfs_vm_mprotect(
        unsigned int    newflags)
 {
        struct inode    *inode = vma->vm_file->f_path.dentry->d_inode;
-       bhv_vfs_t       *vfsp = vfs_from_sb(inode->i_sb);
+       struct xfs_mount *mp = XFS_M(inode->i_sb);
        int             error = 0;
 
-       if (vfsp->vfs_flag & VFS_DMI) {
+       if (mp->m_flags & XFS_MOUNT_DMAPI) {
                if ((vma->vm_flags & VM_MAYSHARE) &&
                    (newflags & VM_WRITE) && !(vma->vm_flags & VM_WRITE))
-                       error = XFS_SEND_MMAP(XFS_VFSTOM(vfsp), vma, VM_WRITE);
+                       error = XFS_SEND_MMAP(mp, vma, VM_WRITE);
        }
        return error;
 }
@@ -340,13 +340,13 @@ STATIC int
 xfs_file_open_exec(
        struct inode    *inode)
 {
-       bhv_vfs_t       *vfsp = vfs_from_sb(inode->i_sb);
+       struct xfs_mount *mp = XFS_M(inode->i_sb);
 
-       if (unlikely(vfsp->vfs_flag & VFS_DMI)) {
+       if (unlikely(mp->m_flags & XFS_MOUNT_DMAPI)) {
                if (DM_EVENT_ENABLED(XFS_I(inode), DM_EVENT_READ)) {
                        bhv_vnode_t *vp = vn_from_inode(inode);
 
-                       return -XFS_SEND_DATA(XFS_VFSTOM(vfsp), DM_EVENT_READ,
+                       return -XFS_SEND_DATA(mp, DM_EVENT_READ,
                                                vp, 0, 0, 0, NULL);
                }
        }
index 24bc0afb003cfca83adb04a03fd11af1ac67bc03..e275b7a82bc14665010ddce8450a29cf9f669ef8 100644 (file)
@@ -534,7 +534,7 @@ vfs_sync_worker(
 {
        int             error;
 
-       if (!(vfsp->vfs_flag & VFS_RDONLY))
+       if (!(XFS_VFSTOM(vfsp)->m_flags & XFS_MOUNT_RDONLY))
                error = xfs_sync(XFS_VFSTOM(vfsp), SYNC_FSDATA | SYNC_BDFLUSH | \
                                        SYNC_ATTR | SYNC_REFCACHE | SYNC_SUPER);
        vfsp->vfs_sync_seq++;
@@ -793,6 +793,9 @@ xfs_fs_fill_super(
        mp->m_vfsp = vfsp;
        vfsp->vfs_mount = mp;
 
+       if (sb->s_flags & MS_RDONLY)
+               mp->m_flags |= XFS_MOUNT_RDONLY;
+
        error = xfs_parseargs(mp, (char *)data, args, 0);
        if (error)
                goto fail_vfsop;
index 573e52a240726b144fe4859980e5680980b7c8c7..b098e0903353a1b71a431ec135fc4f1728871785 100644 (file)
@@ -211,9 +211,6 @@ vfs_allocate(
        vfsp->vfs_super = sb;
        sb->s_fs_info = vfsp;
 
-       if (sb->s_flags & MS_RDONLY)
-               vfsp->vfs_flag |= VFS_RDONLY;
-
        return vfsp;
 }
 
index 943f581bdb47377b8dca3dea694c6f8a108d9f0a..5c4996356226d9bf1731fd097d8503e60edabe0c 100644 (file)
@@ -43,7 +43,6 @@ typedef struct bhv_vfs_sync_work {
 
 typedef struct bhv_vfs {
        struct xfs_mount        *vfs_mount;
-       u_int                   vfs_flag;       /* flags */
        struct super_block      *vfs_super;     /* generic superblock pointer */
        struct task_struct      *vfs_sync_task; /* generalised sync thread */
        bhv_vfs_sync_work_t     vfs_sync_work;  /* work item for VFS_SYNC */
@@ -53,13 +52,6 @@ typedef struct bhv_vfs {
        wait_queue_head_t       vfs_wait_single_sync_task;
 } bhv_vfs_t;
 
-#define VFS_RDONLY             0x0001  /* read-only vfs */
-#define VFS_GRPID              0x0002  /* group-ID assigned from directory */
-#define VFS_DMI                        0x0004  /* filesystem has the DMI enabled */
-/* ---- VFS_UMOUNT ----                0x0008  -- unneeded, fixed via kthread APIs */
-#define VFS_32BITINODES                0x0010  /* do not use inums above 32 bits */
-#define VFS_END                        0x0010  /* max flag */
-
 #define SYNC_ATTR              0x0001  /* sync attributes */
 #define SYNC_CLOSE             0x0002  /* close file system down */
 #define SYNC_DELWRI            0x0004  /* look at delayed writes */
index 8f5a4366929782dadda98664562915dab85c9465..b5f91281b70715e9d27c41b20d2d098b60689dc5 100644 (file)
@@ -2417,8 +2417,7 @@ xfs_qm_vop_dqalloc(
        lockflags = XFS_ILOCK_EXCL;
        xfs_ilock(ip, lockflags);
 
-       if ((flags & XFS_QMOPT_INHERIT) &&
-           XFS_INHERIT_GID(ip, XFS_MTOVFS(mp)))
+       if ((flags & XFS_QMOPT_INHERIT) && XFS_INHERIT_GID(ip))
                gid = ip->i_d.di_gid;
 
        /*
index e0d024e734537c899b8a4b034cb4bf760bfdf784..ad5579d4eac479e1c26266a06fb9ad081211bdba 100644 (file)
@@ -86,10 +86,8 @@ xfs_qm_quotactl(
        int             id,
        xfs_caddr_t     addr)
 {
-       bhv_vfs_t       *vfsp = XFS_MTOVFS(mp);
        int             error;
 
-
        ASSERT(addr != NULL || cmd == Q_XQUOTASYNC);
 
        /*
@@ -102,7 +100,7 @@ xfs_qm_quotactl(
                 */
                if (XFS_IS_QUOTA_ON(mp))
                        return XFS_ERROR(EINVAL);
-               if (vfsp->vfs_flag & VFS_RDONLY)
+               if (mp->m_flags & XFS_MOUNT_RDONLY)
                        return XFS_ERROR(EROFS);
                return (xfs_qm_scall_trunc_qfiles(mp,
                               xfs_qm_import_qtype_flags(*(uint *)addr)));
@@ -118,13 +116,13 @@ xfs_qm_quotactl(
                 * QUOTAON - enabling quota enforcement.
                 * Quota accounting must be turned on at mount time.
                 */
-               if (vfsp->vfs_flag & VFS_RDONLY)
+               if (mp->m_flags & XFS_MOUNT_RDONLY)
                        return XFS_ERROR(EROFS);
                return (xfs_qm_scall_quotaon(mp,
                                          xfs_qm_import_flags(*(uint *)addr)));
 
        case Q_XQUOTAOFF:
-               if (vfsp->vfs_flag & VFS_RDONLY)
+               if (mp->m_flags & XFS_MOUNT_RDONLY)
                        return XFS_ERROR(EROFS);
                break;
 
@@ -140,7 +138,7 @@ xfs_qm_quotactl(
 
        switch (cmd) {
        case Q_XQUOTAOFF:
-               if (vfsp->vfs_flag & VFS_RDONLY)
+               if (mp->m_flags & XFS_MOUNT_RDONLY)
                        return XFS_ERROR(EROFS);
                error = xfs_qm_scall_quotaoff(mp,
                                            xfs_qm_import_flags(*(uint *)addr),
@@ -161,19 +159,19 @@ xfs_qm_quotactl(
                break;
 
        case Q_XSETQLIM:
-               if (vfsp->vfs_flag & VFS_RDONLY)
+               if (mp->m_flags & XFS_MOUNT_RDONLY)
                        return XFS_ERROR(EROFS);
                error = xfs_qm_scall_setqlim(mp, (xfs_dqid_t)id, XFS_DQ_USER,
                                             (fs_disk_quota_t *)addr);
                break;
        case Q_XSETGQLIM:
-               if (vfsp->vfs_flag & VFS_RDONLY)
+               if (mp->m_flags & XFS_MOUNT_RDONLY)
                        return XFS_ERROR(EROFS);
                error = xfs_qm_scall_setqlim(mp, (xfs_dqid_t)id, XFS_DQ_GROUP,
                                             (fs_disk_quota_t *)addr);
                break;
        case Q_XSETPQLIM:
-               if (vfsp->vfs_flag & VFS_RDONLY)
+               if (mp->m_flags & XFS_MOUNT_RDONLY)
                        return XFS_ERROR(EROFS);
                error = xfs_qm_scall_setqlim(mp, (xfs_dqid_t)id, XFS_DQ_PROJ,
                                             (fs_disk_quota_t *)addr);
index 029f96d7d3a04c7cfc24fcb142467ec1f842d460..f71784ab6a601182e8bcbe87908ce81391e1310b 100644 (file)
@@ -69,7 +69,7 @@ typedef enum {
 /* Defines for determining if an event message should be sent. */
 #ifdef HAVE_DMAPI
 #define        DM_EVENT_ENABLED(ip, event) ( \
-       unlikely (XFS_MTOVFS((ip)->i_mount)->vfs_flag & VFS_DMI) && \
+       unlikely ((ip)->i_mount->m_flags & XFS_MOUNT_DMAPI) && \
                ( ((ip)->i_d.di_dmevmask & (1 << event)) || \
                  ((ip)->i_mount->m_dmevmask & (1 << event)) ) \
        )
index 0c376bd9e173944a03a86fce2c614cbc4de62a3c..3d8ba8fec19161f75ab7dda9ec426da65d42f62c 100644 (file)
@@ -1158,7 +1158,7 @@ xfs_ialloc(
        if ((prid != 0) && (ip->i_d.di_version == XFS_DINODE_VERSION_1))
                xfs_bump_ino_vers2(tp, ip);
 
-       if (pip && XFS_INHERIT_GID(pip, XFS_MTOVFS(pip->i_mount))) {
+       if (pip && XFS_INHERIT_GID(pip)) {
                ip->i_d.di_gid = pip->i_d.di_gid;
                if ((pip->i_d.di_mode & S_ISGID) && (mode & S_IFMT) == S_IFDIR) {
                        ip->i_d.di_mode |= S_ISGID;
index 10eaee77379f8d3c224b7df9255651542130adf3..e5aff929cc65effe4bbc0d5f25527c2a597e6b52 100644 (file)
@@ -492,8 +492,9 @@ xfs_iflags_test_and_clear(xfs_inode_t *ip, unsigned short flags)
  * directory, group of new file is set to that of the parent, and
  * new subdirectory gets S_ISGID bit from parent.
  */
-#define XFS_INHERIT_GID(pip, vfsp)     \
-       (((vfsp)->vfs_flag & VFS_GRPID) || ((pip)->i_d.di_mode & S_ISGID))
+#define XFS_INHERIT_GID(pip)   \
+       (((pip)->i_mount->m_flags & XFS_MOUNT_GRPID) || \
+        ((pip)->i_d.di_mode & S_ISGID))
 
 /*
  * Flags for xfs_iget()
index 4f4d20b2721c323fc349ce8219344597f60ee064..d170fffd7402f3bcf27a5d5b93df25aacdb8586d 100644 (file)
@@ -486,7 +486,7 @@ xfs_log_mount(xfs_mount_t   *mp,
                cmn_err(CE_NOTE,
                        "!Mounting filesystem \"%s\" in no-recovery mode.  Filesystem will be inconsistent.",
                        mp->m_fsname);
-               ASSERT(XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY);
+               ASSERT(mp->m_flags & XFS_MOUNT_RDONLY);
        }
 
        mp->m_log = xlog_alloc_log(mp, log_target, blk_offset, num_bblks);
@@ -496,16 +496,15 @@ xfs_log_mount(xfs_mount_t *mp,
         * just worked.
         */
        if (!(mp->m_flags & XFS_MOUNT_NORECOVERY)) {
-               bhv_vfs_t       *vfsp = XFS_MTOVFS(mp);
-               int             error, readonly = (vfsp->vfs_flag & VFS_RDONLY);
+               int             error, readonly = (mp->m_flags & XFS_MOUNT_RDONLY);
 
                if (readonly)
-                       vfsp->vfs_flag &= ~VFS_RDONLY;
+                       mp->m_flags &= ~XFS_MOUNT_RDONLY;
 
                error = xlog_recover(mp->m_log);
 
                if (readonly)
-                       vfsp->vfs_flag |= VFS_RDONLY;
+                       mp->m_flags |= XFS_MOUNT_RDONLY;
                if (error) {
                        cmn_err(CE_WARN, "XFS: log mount/recovery failed: error %d", error);
                        xlog_dealloc_log(mp->m_log);
@@ -537,7 +536,7 @@ xfs_log_mount_finish(xfs_mount_t *mp, int mfsi_flags)
                error = xlog_recover_finish(mp->m_log, mfsi_flags);
        else {
                error = 0;
-               ASSERT(XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY);
+               ASSERT(mp->m_flags & XFS_MOUNT_RDONLY);
        }
 
        return error;
@@ -597,7 +596,7 @@ xfs_log_unmount_write(xfs_mount_t *mp)
         * Don't write out unmount record on read-only mounts.
         * Or, if we are doing a forced umount (typically because of IO errors).
         */
-       if (XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY)
+       if (mp->m_flags & XFS_MOUNT_RDONLY)
                return 0;
 
        xfs_log_force(mp, 0, XFS_LOG_FORCE|XFS_LOG_SYNC);
index 87bc9280b786521f60bbe2f52b9a9aa1caf98de9..6b1aa7d6f434de063ed28803f9e96985d93c03cc 100644 (file)
@@ -359,7 +359,7 @@ xfs_initialize_perag(
        /* Clear the mount flag if no inode can overflow 32 bits
         * on this filesystem, or if specifically requested..
         */
-       if ((vfs->vfs_flag & VFS_32BITINODES) && ino > max_inum) {
+       if ((mp->m_flags & XFS_MOUNT_SMALL_INUMS) && ino > max_inum) {
                mp->m_flags |= XFS_MOUNT_32BITINODES;
        } else {
                mp->m_flags &= ~XFS_MOUNT_32BITINODES;
@@ -1116,7 +1116,7 @@ xfs_mountfs(
         * If fs is not mounted readonly, then update the superblock
         * unit and width changes.
         */
-       if (update_flags && !(vfsp->vfs_flag & VFS_RDONLY))
+       if (update_flags && !(mp->m_flags & XFS_MOUNT_RDONLY))
                xfs_mount_log_sbunit(mp, update_flags);
 
        /*
@@ -1289,7 +1289,7 @@ xfs_fs_writable(xfs_mount_t *mp)
        bhv_vfs_t       *vfsp = XFS_MTOVFS(mp);
 
        return !(vfs_test_for_freeze(vfsp) || XFS_FORCED_SHUTDOWN(mp) ||
-               (vfsp->vfs_flag & VFS_RDONLY));
+               (mp->m_flags & XFS_MOUNT_RDONLY));
 }
 
 /*
@@ -1367,7 +1367,7 @@ xfs_unmountfs_writesb(xfs_mount_t *mp)
         * skip superblock write if fs is read-only, or
         * if we are doing a forced umount.
         */
-       if (!(XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY ||
+       if (!((mp->m_flags & XFS_MOUNT_RDONLY) ||
                XFS_FORCED_SHUTDOWN(mp))) {
 
                sbp = xfs_getsb(mp, 0);
index 8fefad022ae667b0b5f6c590578dbd8a6e8c5cc9..f37060bcde53745bd66829312a2b64124101a470 100644 (file)
@@ -442,7 +442,7 @@ typedef struct xfs_mount {
                                                   must be synchronous except
                                                   for space allocations */
 #define XFS_MOUNT_INO64                (1ULL << 1)
-                            /* (1ULL << 2)     -- currently unused */
+#define XFS_MOUNT_DMAPI                (1ULL << 2)     /* dmapi is enabled */
 #define XFS_MOUNT_WAS_CLEAN    (1ULL << 3)
 #define XFS_MOUNT_FS_SHUTDOWN  (1ULL << 4)     /* atomic stop of all filesystem
                                                   operations, typically for
@@ -452,7 +452,7 @@ typedef struct xfs_mount {
 #define XFS_MOUNT_NOALIGN      (1ULL << 7)     /* turn off stripe alignment
                                                   allocations */
 #define XFS_MOUNT_ATTR2                (1ULL << 8)     /* allow use of attr2 format */
-                            /* (1ULL << 9)     -- currently unused */
+#define XFS_MOUNT_GRPID                (1ULL << 9)     /* group-ID assigned from directory */
 #define XFS_MOUNT_NORECOVERY   (1ULL << 10)    /* no recovery - dirty fs */
 #define XFS_MOUNT_SHARED       (1ULL << 11)    /* shared mount */
 #define XFS_MOUNT_DFLT_IOSIZE  (1ULL << 12)    /* set default i/o size */
@@ -460,13 +460,13 @@ typedef struct xfs_mount {
                                                /* osyncisdsync is now default*/
 #define XFS_MOUNT_32BITINODES  (1ULL << 14)    /* do not create inodes above
                                                 * 32 bits in size */
-                            /* (1ULL << 15)    -- currently unused */
+#define XFS_MOUNT_SMALL_INUMS  (1ULL << 15)    /* users wants 32bit inodes */
 #define XFS_MOUNT_NOUUID       (1ULL << 16)    /* ignore uuid during mount */
 #define XFS_MOUNT_BARRIER      (1ULL << 17)
 #define XFS_MOUNT_IDELETE      (1ULL << 18)    /* delete empty inode clusters*/
 #define XFS_MOUNT_SWALLOC      (1ULL << 19)    /* turn on stripe width
                                                 * allocation */
-                            /* (1ULL << 20)    -- currently unused */
+#define XFS_MOUNT_RDONLY       (1ULL << 20)    /* read-only fs */
 #define XFS_MOUNT_DIRSYNC      (1ULL << 21)    /* synchronous directory ops */
 #define XFS_MOUNT_COMPAT_IOSIZE        (1ULL << 22)    /* don't report large preferred
                                                 * I/O size in stat() */
index ea08bd8e8b809b397c21caab0016e4b9893d525d..c266a0184b42e2e38eac37059a1b8ee0997dd1ab 100644 (file)
@@ -66,7 +66,7 @@ xfs_mount_reset_sbqflags(xfs_mount_t *mp)
         * if the fs is readonly, let the incore superblock run
         * with quotas off but don't flush the update out to disk
         */
-       if (XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY)
+       if (mp->m_flags & XFS_MOUNT_RDONLY)
                return 0;
 #ifdef QUOTADEBUG
        xfs_fs_cmn_err(CE_NOTE, mp, "Writing superblock quota changes");
index 593e6e2b39214e29fdffc945928cf18be6d12200..febfd8367e1352a61db4911baab02e0e472af1cb 100644 (file)
@@ -307,7 +307,7 @@ xfs_start_flags(
         * no recovery flag requires a read-only mount
         */
        if (ap->flags & XFSMNT_NORECOVERY) {
-               if (!(vfs->vfs_flag & VFS_RDONLY)) {
+               if (!(mp->m_flags & XFS_MOUNT_RDONLY)) {
                        cmn_err(CE_WARN,
        "XFS: tried to mount a FS read-write without recovery!");
                        return XFS_ERROR(EINVAL);
@@ -326,7 +326,7 @@ xfs_start_flags(
                mp->m_flags |= XFS_MOUNT_FILESTREAMS;
 
        if (ap->flags & XFSMNT_DMAPI)
-               vfs->vfs_flag |= VFS_DMI;
+               mp->m_flags |= XFS_MOUNT_DMAPI;
        return 0;
 }
 
@@ -340,7 +340,7 @@ xfs_finish_flags(
        struct xfs_mount_args   *ap,
        struct xfs_mount        *mp)
 {
-       int                     ronly = (vfs->vfs_flag & VFS_RDONLY);
+       int                     ronly = (mp->m_flags & XFS_MOUNT_RDONLY);
 
        /* Fail a mount where the logbuf is smaller then the log stripe */
        if (XFS_SB_VERSION_HASLOGV2(&mp->m_sb)) {
@@ -589,7 +589,7 @@ xfs_unmount(
        rvp = XFS_ITOV(rip);
 
 #ifdef HAVE_DMAPI
-       if (vfsp->vfs_flag & VFS_DMI) {
+       if (mp->m_flags & XFS_MOUNT_DMAPI) {
                error = XFS_SEND_PREUNMOUNT(mp, vfsp,
                                rvp, DM_RIGHT_NULL, rvp, DM_RIGHT_NULL,
                                NULL, NULL, 0, 0,
@@ -723,22 +723,20 @@ xfs_mntupdate(
        int                             *flags,
        struct xfs_mount_args           *args)
 {
-       struct bhv_vfs                  *vfsp = XFS_MTOVFS(mp);
-
        if (!(*flags & MS_RDONLY)) {                    /* rw/ro -> rw */
-               if (vfsp->vfs_flag & VFS_RDONLY)
-                       vfsp->vfs_flag &= ~VFS_RDONLY;
+               if (mp->m_flags & XFS_MOUNT_RDONLY)
+                       mp->m_flags &= ~XFS_MOUNT_RDONLY;
                if (args->flags & XFSMNT_BARRIER) {
                        mp->m_flags |= XFS_MOUNT_BARRIER;
                        xfs_mountfs_check_barriers(mp);
                } else {
                        mp->m_flags &= ~XFS_MOUNT_BARRIER;
                }
-       } else if (!(vfsp->vfs_flag & VFS_RDONLY)) {    /* rw -> ro */
+       } else if (!(mp->m_flags & XFS_MOUNT_RDONLY)) { /* rw -> ro */
                xfs_filestream_flush(mp);
                xfs_sync(mp, SYNC_DATA_QUIESCE);
                xfs_attr_quiesce(mp);
-               vfsp->vfs_flag |= VFS_RDONLY;
+               mp->m_flags |= XFS_MOUNT_RDONLY;
        }
        return 0;
 }
@@ -1053,7 +1051,7 @@ xfs_sync_inodes(
 
        if (bypassed)
                *bypassed = 0;
-       if (XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY)
+       if (mp->m_flags & XFS_MOUNT_RDONLY)
                return 0;
        error = 0;
        last_error = 0;
@@ -1766,7 +1764,6 @@ xfs_parseargs(
        struct xfs_mount_args   *args,
        int                     update)
 {
-       bhv_vfs_t               *vfsp = XFS_MTOVFS(mp);
        char                    *this_char, *value, *eov;
        int                     dsunit, dswidth, vol_dsunit, vol_dswidth;
        int                     iosize;
@@ -1859,10 +1856,10 @@ xfs_parseargs(
                        args->iosizelog = ffs(iosize) - 1;
                } else if (!strcmp(this_char, MNTOPT_GRPID) ||
                           !strcmp(this_char, MNTOPT_BSDGROUPS)) {
-                       vfsp->vfs_flag |= VFS_GRPID;
+                       mp->m_flags |= XFS_MOUNT_GRPID;
                } else if (!strcmp(this_char, MNTOPT_NOGRPID) ||
                           !strcmp(this_char, MNTOPT_SYSVGROUPS)) {
-                       vfsp->vfs_flag &= ~VFS_GRPID;
+                       mp->m_flags &= ~XFS_MOUNT_GRPID;
                } else if (!strcmp(this_char, MNTOPT_WSYNC)) {
                        args->flags |= XFSMNT_WSYNC;
                } else if (!strcmp(this_char, MNTOPT_OSYNCISOSYNC)) {
@@ -1972,7 +1969,7 @@ xfs_parseargs(
        }
 
        if (args->flags & XFSMNT_NORECOVERY) {
-               if ((vfsp->vfs_flag & VFS_RDONLY) == 0) {
+               if ((mp->m_flags & XFS_MOUNT_RDONLY) == 0) {
                        cmn_err(CE_WARN,
                                "XFS: no-recovery mounts must be read-only.");
                        return EINVAL;
@@ -2025,7 +2022,7 @@ xfs_parseargs(
 
 done:
        if (args->flags & XFSMNT_32BITINODES)
-               vfsp->vfs_flag |= VFS_32BITINODES;
+               mp->m_flags |= XFS_MOUNT_SMALL_INUMS;
        if (args->flags2)
                args->flags |= XFSMNT_FLAGS2;
        return 0;
@@ -2051,7 +2048,6 @@ xfs_showargs(
                { 0, NULL }
        };
        struct proc_xfs_info    *xfs_infop;
-       struct bhv_vfs          *vfsp = XFS_MTOVFS(mp);
 
        for (xfs_infop = xfs_info; xfs_infop->flag; xfs_infop++) {
                if (mp->m_flags & xfs_infop->flag)
@@ -2084,9 +2080,9 @@ xfs_showargs(
        if (!(mp->m_flags & XFS_MOUNT_COMPAT_IOSIZE))
                seq_printf(m, "," MNTOPT_LARGEIO);
 
-       if (!(vfsp->vfs_flag & VFS_32BITINODES))
+       if (!(mp->m_flags & XFS_MOUNT_SMALL_INUMS))
                seq_printf(m, "," MNTOPT_64BITINODE);
-       if (vfsp->vfs_flag & VFS_GRPID)
+       if (mp->m_flags & XFS_MOUNT_GRPID)
                seq_printf(m, "," MNTOPT_GRPID);
 
        if (mp->m_qflags & XFS_UQUOTA_ACCT) {
@@ -2113,7 +2109,7 @@ xfs_showargs(
        if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT))
                seq_puts(m, "," MNTOPT_NOQUOTA);
 
-       if (vfsp->vfs_flag & VFS_DMI)
+       if (mp->m_flags & XFS_MOUNT_DMAPI)
                seq_puts(m, "," MNTOPT_DMAPI);
        return 0;
 }
index 98653793b34a02139766eb0705f6c8fd0531d0ce..83cc1cb4089a64fe5e8bf30d21079e38bd368d91 100644 (file)
@@ -230,7 +230,7 @@ xfs_setattr(
 
        vn_trace_entry(ip, __FUNCTION__, (inst_t *)__return_address);
 
-       if (XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY)
+       if (mp->m_flags & XFS_MOUNT_RDONLY)
                return XFS_ERROR(EROFS);
 
        /*
@@ -1515,7 +1515,7 @@ xfs_release(
                return 0;
 
        /* If this is a read-only mount, don't do this (would generate I/O) */
-       if (XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY)
+       if (mp->m_flags & XFS_MOUNT_RDONLY)
                return 0;
 
        if (!XFS_FORCED_SHUTDOWN(mp)) {
@@ -1624,7 +1624,7 @@ xfs_inactive(
        error = 0;
 
        /* If this is a read-only mount, don't do this (would generate I/O) */
-       if (XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY)
+       if (mp->m_flags & XFS_MOUNT_RDONLY)
                goto out;
 
        if (ip->i_d.di_nlink != 0) {