Commit bd186aa9 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Tim Shimmin

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