Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  *  linux/fs/hfsplus/options.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * Copyright (C) 2001
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  * Brad Boyer (flar@allandria.com)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  * (C) 2003 Ardis Technologies <roman@ardistech.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  * Option parsing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/string.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <linux/sched.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/parser.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <linux/nls.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <linux/mount.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include <linux/seq_file.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #include "hfsplus_fs.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) enum {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 	opt_creator, opt_type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 	opt_umask, opt_uid, opt_gid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 	opt_part, opt_session, opt_nls,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 	opt_nodecompose, opt_decompose,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 	opt_barrier, opt_nobarrier,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 	opt_force, opt_err
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) static const match_table_t tokens = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	{ opt_creator, "creator=%s" },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	{ opt_type, "type=%s" },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	{ opt_umask, "umask=%o" },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 	{ opt_uid, "uid=%u" },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 	{ opt_gid, "gid=%u" },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	{ opt_part, "part=%u" },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	{ opt_session, "session=%u" },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	{ opt_nls, "nls=%s" },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	{ opt_decompose, "decompose" },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 	{ opt_nodecompose, "nodecompose" },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 	{ opt_barrier, "barrier" },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 	{ opt_nobarrier, "nobarrier" },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 	{ opt_force, "force" },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	{ opt_err, NULL }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) /* Initialize an options object to reasonable defaults */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) void hfsplus_fill_defaults(struct hfsplus_sb_info *opts)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	if (!opts)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	opts->creator = HFSPLUS_DEF_CR_TYPE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	opts->type = HFSPLUS_DEF_CR_TYPE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	opts->umask = current_umask();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	opts->uid = current_uid();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	opts->gid = current_gid();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	opts->part = -1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	opts->session = -1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) /* convert a "four byte character" to a 32 bit int with error checks */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) static inline int match_fourchar(substring_t *arg, u32 *result)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	if (arg->to - arg->from != 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	memcpy(result, arg->from, 4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) int hfsplus_parse_options_remount(char *input, int *force)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	char *p;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	substring_t args[MAX_OPT_ARGS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	int token;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	if (!input)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 		return 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	while ((p = strsep(&input, ",")) != NULL) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 		if (!*p)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 			continue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 		token = match_token(p, tokens, args);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 		switch (token) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 		case opt_force:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 			*force = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 		default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	return 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) /* Parse options from mount. Returns 0 on failure */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) /* input is the options passed to mount() as a string */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) int hfsplus_parse_options(char *input, struct hfsplus_sb_info *sbi)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	char *p;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	substring_t args[MAX_OPT_ARGS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	int tmp, token;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	if (!input)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 		goto done;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	while ((p = strsep(&input, ",")) != NULL) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 		if (!*p)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 			continue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 		token = match_token(p, tokens, args);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 		switch (token) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 		case opt_creator:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 			if (match_fourchar(&args[0], &sbi->creator)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 				pr_err("creator requires a 4 character value\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 				return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 		case opt_type:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 			if (match_fourchar(&args[0], &sbi->type)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 				pr_err("type requires a 4 character value\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 				return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 		case opt_umask:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 			if (match_octal(&args[0], &tmp)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 				pr_err("umask requires a value\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 				return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 			sbi->umask = (umode_t)tmp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 		case opt_uid:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 			if (match_int(&args[0], &tmp)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 				pr_err("uid requires an argument\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 				return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 			sbi->uid = make_kuid(current_user_ns(), (uid_t)tmp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 			if (!uid_valid(sbi->uid)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 				pr_err("invalid uid specified\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 				return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 		case opt_gid:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 			if (match_int(&args[0], &tmp)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 				pr_err("gid requires an argument\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 				return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 			sbi->gid = make_kgid(current_user_ns(), (gid_t)tmp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 			if (!gid_valid(sbi->gid)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 				pr_err("invalid gid specified\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 				return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 		case opt_part:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 			if (match_int(&args[0], &sbi->part)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 				pr_err("part requires an argument\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 				return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 		case opt_session:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 			if (match_int(&args[0], &sbi->session)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 				pr_err("session requires an argument\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 				return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 		case opt_nls:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 			if (sbi->nls) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 				pr_err("unable to change nls mapping\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 				return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 			p = match_strdup(&args[0]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 			if (p)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 				sbi->nls = load_nls(p);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 			if (!sbi->nls) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 				pr_err("unable to load nls mapping \"%s\"\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 				       p);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 				kfree(p);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 				return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 			kfree(p);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 		case opt_decompose:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 			clear_bit(HFSPLUS_SB_NODECOMPOSE, &sbi->flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 		case opt_nodecompose:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 			set_bit(HFSPLUS_SB_NODECOMPOSE, &sbi->flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 		case opt_barrier:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 			clear_bit(HFSPLUS_SB_NOBARRIER, &sbi->flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 		case opt_nobarrier:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 			set_bit(HFSPLUS_SB_NOBARRIER, &sbi->flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 		case opt_force:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 			set_bit(HFSPLUS_SB_FORCE, &sbi->flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 		default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 			return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) done:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	if (!sbi->nls) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 		/* try utf8 first, as this is the old default behaviour */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 		sbi->nls = load_nls("utf8");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 		if (!sbi->nls)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 			sbi->nls = load_nls_default();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 		if (!sbi->nls)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 			return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	return 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) int hfsplus_show_options(struct seq_file *seq, struct dentry *root)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	struct hfsplus_sb_info *sbi = HFSPLUS_SB(root->d_sb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 	if (sbi->creator != HFSPLUS_DEF_CR_TYPE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 		seq_show_option_n(seq, "creator", (char *)&sbi->creator, 4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	if (sbi->type != HFSPLUS_DEF_CR_TYPE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 		seq_show_option_n(seq, "type", (char *)&sbi->type, 4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 	seq_printf(seq, ",umask=%o,uid=%u,gid=%u", sbi->umask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 			from_kuid_munged(&init_user_ns, sbi->uid),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 			from_kgid_munged(&init_user_ns, sbi->gid));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	if (sbi->part >= 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 		seq_printf(seq, ",part=%u", sbi->part);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 	if (sbi->session >= 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 		seq_printf(seq, ",session=%u", sbi->session);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 	if (sbi->nls)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 		seq_printf(seq, ",nls=%s", sbi->nls->charset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	if (test_bit(HFSPLUS_SB_NODECOMPOSE, &sbi->flags))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 		seq_puts(seq, ",nodecompose");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 	if (test_bit(HFSPLUS_SB_NOBARRIER, &sbi->flags))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 		seq_puts(seq, ",nobarrier");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) }