Linux 5.0 compat: Convert MS_* macros to SB_*

In the 5.0 kernel, only the mount namespace code should use the MS_*
macos. Filesystems should use the SB_* ones.

https://patchwork.kernel.org/patch/10552493/

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #8264
This commit is contained in:
Tony Hutter 2019-01-10 15:28:44 -08:00
parent ba8024a284
commit 0a3a4d067a
2 changed files with 13 additions and 11 deletions

View File

@ -35,6 +35,7 @@
#include <sys/zio.h> #include <sys/zio.h>
#include <sys/sunldi.h> #include <sys/sunldi.h>
#include <linux/mod_compat.h> #include <linux/mod_compat.h>
#include <linux/vfs_compat.h>
char *zfs_vdev_scheduler = VDEV_SCHEDULER; char *zfs_vdev_scheduler = VDEV_SCHEDULER;
static void *zfs_vdev_holder = VDEV_HOLDER; static void *zfs_vdev_holder = VDEV_HOLDER;
@ -76,7 +77,7 @@ vdev_bdev_mode(int smode)
ASSERT3S(smode & (FREAD | FWRITE), !=, 0); ASSERT3S(smode & (FREAD | FWRITE), !=, 0);
if ((smode & FREAD) && !(smode & FWRITE)) if ((smode & FREAD) && !(smode & FWRITE))
mode = MS_RDONLY; mode = SB_RDONLY;
return (mode); return (mode);
} }

View File

@ -66,6 +66,7 @@
#include <sys/dmu_objset.h> #include <sys/dmu_objset.h>
#include <sys/spa_boot.h> #include <sys/spa_boot.h>
#include <sys/zpl.h> #include <sys/zpl.h>
#include <linux/vfs_compat.h>
#include "zfs_comutil.h" #include "zfs_comutil.h"
enum { enum {
@ -259,7 +260,7 @@ zfsvfs_parse_options(char *mntopts, vfs_t **vfsp)
boolean_t boolean_t
zfs_is_readonly(zfsvfs_t *zfsvfs) zfs_is_readonly(zfsvfs_t *zfsvfs)
{ {
return (!!(zfsvfs->z_sb->s_flags & MS_RDONLY)); return (!!(zfsvfs->z_sb->s_flags & SB_RDONLY));
} }
/*ARGSUSED*/ /*ARGSUSED*/
@ -353,15 +354,15 @@ acltype_changed_cb(void *arg, uint64_t newval)
switch (newval) { switch (newval) {
case ZFS_ACLTYPE_OFF: case ZFS_ACLTYPE_OFF:
zfsvfs->z_acl_type = ZFS_ACLTYPE_OFF; zfsvfs->z_acl_type = ZFS_ACLTYPE_OFF;
zfsvfs->z_sb->s_flags &= ~MS_POSIXACL; zfsvfs->z_sb->s_flags &= ~SB_POSIXACL;
break; break;
case ZFS_ACLTYPE_POSIXACL: case ZFS_ACLTYPE_POSIXACL:
#ifdef CONFIG_FS_POSIX_ACL #ifdef CONFIG_FS_POSIX_ACL
zfsvfs->z_acl_type = ZFS_ACLTYPE_POSIXACL; zfsvfs->z_acl_type = ZFS_ACLTYPE_POSIXACL;
zfsvfs->z_sb->s_flags |= MS_POSIXACL; zfsvfs->z_sb->s_flags |= SB_POSIXACL;
#else #else
zfsvfs->z_acl_type = ZFS_ACLTYPE_OFF; zfsvfs->z_acl_type = ZFS_ACLTYPE_OFF;
zfsvfs->z_sb->s_flags &= ~MS_POSIXACL; zfsvfs->z_sb->s_flags &= ~SB_POSIXACL;
#endif /* CONFIG_FS_POSIX_ACL */ #endif /* CONFIG_FS_POSIX_ACL */
break; break;
default: default:
@ -390,9 +391,9 @@ readonly_changed_cb(void *arg, uint64_t newval)
return; return;
if (newval) if (newval)
sb->s_flags |= MS_RDONLY; sb->s_flags |= SB_RDONLY;
else else
sb->s_flags &= ~MS_RDONLY; sb->s_flags &= ~SB_RDONLY;
} }
static void static void
@ -420,9 +421,9 @@ nbmand_changed_cb(void *arg, uint64_t newval)
return; return;
if (newval == TRUE) if (newval == TRUE)
sb->s_flags |= MS_MANDLOCK; sb->s_flags |= SB_MANDLOCK;
else else
sb->s_flags &= ~MS_MANDLOCK; sb->s_flags &= ~SB_MANDLOCK;
} }
static void static void
@ -1763,8 +1764,8 @@ zfs_remount(struct super_block *sb, int *flags, zfs_mnt_t *zm)
int error; int error;
if ((issnap || !spa_writeable(dmu_objset_spa(zfsvfs->z_os))) && if ((issnap || !spa_writeable(dmu_objset_spa(zfsvfs->z_os))) &&
!(*flags & MS_RDONLY)) { !(*flags & SB_RDONLY)) {
*flags |= MS_RDONLY; *flags |= SB_RDONLY;
return (EROFS); return (EROFS);
} }