mirror of https://gitee.com/openkylin/linux.git
fs/affs/super.c: use affs_set_opt()
Replace direct mount option assignation by affs_set_opt() macro. Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
6bf445ce35
commit
34f2483538
|
@ -227,22 +227,22 @@ parse_options(char *options, kuid_t *uid, kgid_t *gid, int *mode, int *reserved,
|
||||||
if (match_octal(&args[0], &option))
|
if (match_octal(&args[0], &option))
|
||||||
return 0;
|
return 0;
|
||||||
*mode = option & 0777;
|
*mode = option & 0777;
|
||||||
*mount_opts |= AFFS_MOUNT_SF_SETMODE;
|
affs_set_opt(*mount_opts, SF_SETMODE);
|
||||||
break;
|
break;
|
||||||
case Opt_mufs:
|
case Opt_mufs:
|
||||||
*mount_opts |= AFFS_MOUNT_SF_MUFS;
|
affs_set_opt(*mount_opts, SF_MUFS);
|
||||||
break;
|
break;
|
||||||
case Opt_notruncate:
|
case Opt_notruncate:
|
||||||
*mount_opts |= AFFS_MOUNT_SF_NO_TRUNCATE;
|
affs_set_opt(*mount_opts, SF_NO_TRUNCATE);
|
||||||
break;
|
break;
|
||||||
case Opt_prefix:
|
case Opt_prefix:
|
||||||
*prefix = match_strdup(&args[0]);
|
*prefix = match_strdup(&args[0]);
|
||||||
if (!*prefix)
|
if (!*prefix)
|
||||||
return 0;
|
return 0;
|
||||||
*mount_opts |= AFFS_MOUNT_SF_PREFIX;
|
affs_set_opt(*mount_opts, SF_PREFIX);
|
||||||
break;
|
break;
|
||||||
case Opt_protect:
|
case Opt_protect:
|
||||||
*mount_opts |= AFFS_MOUNT_SF_IMMUTABLE;
|
affs_set_opt(*mount_opts, SF_IMMUTABLE);
|
||||||
break;
|
break;
|
||||||
case Opt_reserved:
|
case Opt_reserved:
|
||||||
if (match_int(&args[0], reserved))
|
if (match_int(&args[0], reserved))
|
||||||
|
@ -258,7 +258,7 @@ parse_options(char *options, kuid_t *uid, kgid_t *gid, int *mode, int *reserved,
|
||||||
*gid = make_kgid(current_user_ns(), option);
|
*gid = make_kgid(current_user_ns(), option);
|
||||||
if (!gid_valid(*gid))
|
if (!gid_valid(*gid))
|
||||||
return 0;
|
return 0;
|
||||||
*mount_opts |= AFFS_MOUNT_SF_SETGID;
|
affs_set_opt(*mount_opts, SF_SETGID);
|
||||||
break;
|
break;
|
||||||
case Opt_setuid:
|
case Opt_setuid:
|
||||||
if (match_int(&args[0], &option))
|
if (match_int(&args[0], &option))
|
||||||
|
@ -266,10 +266,10 @@ parse_options(char *options, kuid_t *uid, kgid_t *gid, int *mode, int *reserved,
|
||||||
*uid = make_kuid(current_user_ns(), option);
|
*uid = make_kuid(current_user_ns(), option);
|
||||||
if (!uid_valid(*uid))
|
if (!uid_valid(*uid))
|
||||||
return 0;
|
return 0;
|
||||||
*mount_opts |= AFFS_MOUNT_SF_SETUID;
|
affs_set_opt(*mount_opts, SF_SETUID);
|
||||||
break;
|
break;
|
||||||
case Opt_verbose:
|
case Opt_verbose:
|
||||||
*mount_opts |= AFFS_MOUNT_SF_VERBOSE;
|
affs_set_opt(*mount_opts, SF_VERBOSE);
|
||||||
break;
|
break;
|
||||||
case Opt_volume: {
|
case Opt_volume: {
|
||||||
char *vol = match_strdup(&args[0]);
|
char *vol = match_strdup(&args[0]);
|
||||||
|
@ -435,30 +435,31 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
case MUFS_FS:
|
case MUFS_FS:
|
||||||
case MUFS_INTLFFS:
|
case MUFS_INTLFFS:
|
||||||
case MUFS_DCFFS:
|
case MUFS_DCFFS:
|
||||||
sbi->s_flags |= AFFS_MOUNT_SF_MUFS;
|
affs_set_opt(sbi->s_flags, SF_MUFS);
|
||||||
/* fall thru */
|
/* fall thru */
|
||||||
case FS_INTLFFS:
|
case FS_INTLFFS:
|
||||||
case FS_DCFFS:
|
case FS_DCFFS:
|
||||||
sbi->s_flags |= AFFS_MOUNT_SF_INTL;
|
affs_set_opt(sbi->s_flags, SF_INTL);
|
||||||
break;
|
break;
|
||||||
case MUFS_FFS:
|
case MUFS_FFS:
|
||||||
sbi->s_flags |= AFFS_MOUNT_SF_MUFS;
|
affs_set_opt(sbi->s_flags, SF_MUFS);
|
||||||
break;
|
break;
|
||||||
case FS_FFS:
|
case FS_FFS:
|
||||||
break;
|
break;
|
||||||
case MUFS_OFS:
|
case MUFS_OFS:
|
||||||
sbi->s_flags |= AFFS_MOUNT_SF_MUFS;
|
affs_set_opt(sbi->s_flags, SF_MUFS);
|
||||||
/* fall thru */
|
/* fall thru */
|
||||||
case FS_OFS:
|
case FS_OFS:
|
||||||
sbi->s_flags |= AFFS_MOUNT_SF_OFS;
|
affs_set_opt(sbi->s_flags, SF_OFS);
|
||||||
sb->s_flags |= MS_NOEXEC;
|
sb->s_flags |= MS_NOEXEC;
|
||||||
break;
|
break;
|
||||||
case MUFS_DCOFS:
|
case MUFS_DCOFS:
|
||||||
case MUFS_INTLOFS:
|
case MUFS_INTLOFS:
|
||||||
sbi->s_flags |= AFFS_MOUNT_SF_MUFS;
|
affs_set_opt(sbi->s_flags, SF_MUFS);
|
||||||
case FS_DCOFS:
|
case FS_DCOFS:
|
||||||
case FS_INTLOFS:
|
case FS_INTLOFS:
|
||||||
sbi->s_flags |= AFFS_MOUNT_SF_INTL | AFFS_MOUNT_SF_OFS;
|
affs_set_opt(sbi->s_flags, SF_INTL);
|
||||||
|
affs_set_opt(sbi->s_flags, SF_OFS);
|
||||||
sb->s_flags |= MS_NOEXEC;
|
sb->s_flags |= MS_NOEXEC;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue