Lines Matching refs:ctx

204 cifs_parse_security_flavors(struct fs_context *fc, char *value, struct smb3_fs_context *ctx)  in cifs_parse_security_flavors()  argument
213 ctx->sectype = Unspecified; in cifs_parse_security_flavors()
214 ctx->sign = false; in cifs_parse_security_flavors()
221 ctx->sign = true; in cifs_parse_security_flavors()
224 ctx->sectype = Kerberos; in cifs_parse_security_flavors()
227 ctx->sign = true; in cifs_parse_security_flavors()
230 ctx->sectype = RawNTLMSSP; in cifs_parse_security_flavors()
233 ctx->sign = true; in cifs_parse_security_flavors()
236 ctx->sectype = NTLMv2; in cifs_parse_security_flavors()
239 ctx->nullauth = 1; in cifs_parse_security_flavors()
240 kfree(ctx->username); in cifs_parse_security_flavors()
241 ctx->username = NULL; in cifs_parse_security_flavors()
261 cifs_parse_cache_flavor(struct fs_context *fc, char *value, struct smb3_fs_context *ctx) in cifs_parse_cache_flavor() argument
267 ctx->direct_io = false; in cifs_parse_cache_flavor()
268 ctx->strict_io = false; in cifs_parse_cache_flavor()
269 ctx->cache_ro = false; in cifs_parse_cache_flavor()
270 ctx->cache_rw = false; in cifs_parse_cache_flavor()
273 ctx->direct_io = false; in cifs_parse_cache_flavor()
274 ctx->strict_io = true; in cifs_parse_cache_flavor()
275 ctx->cache_ro = false; in cifs_parse_cache_flavor()
276 ctx->cache_rw = false; in cifs_parse_cache_flavor()
279 ctx->direct_io = true; in cifs_parse_cache_flavor()
280 ctx->strict_io = false; in cifs_parse_cache_flavor()
281 ctx->cache_ro = false; in cifs_parse_cache_flavor()
282 ctx->cache_rw = false; in cifs_parse_cache_flavor()
285 ctx->direct_io = false; in cifs_parse_cache_flavor()
286 ctx->strict_io = false; in cifs_parse_cache_flavor()
287 ctx->cache_ro = true; in cifs_parse_cache_flavor()
288 ctx->cache_rw = false; in cifs_parse_cache_flavor()
291 ctx->direct_io = false; in cifs_parse_cache_flavor()
292 ctx->strict_io = false; in cifs_parse_cache_flavor()
293 ctx->cache_ro = false; in cifs_parse_cache_flavor()
294 ctx->cache_rw = true; in cifs_parse_cache_flavor()
311 struct smb3_fs_context *ctx) in parse_reparse_flavor() argument
317 ctx->reparse_type = CIFS_REPARSE_TYPE_DEFAULT; in parse_reparse_flavor()
320 ctx->reparse_type = CIFS_REPARSE_TYPE_NFS; in parse_reparse_flavor()
323 ctx->reparse_type = CIFS_REPARSE_TYPE_WSL; in parse_reparse_flavor()
334 if (ctx->field) { \
335 new_ctx->field = kstrdup(ctx->field, GFP_ATOMIC); \
344 smb3_fs_context_dup(struct smb3_fs_context *new_ctx, struct smb3_fs_context *ctx) in smb3_fs_context_dup() argument
346 memcpy(new_ctx, ctx, sizeof(*ctx)); in smb3_fs_context_dup()
377 cifs_parse_smb_version(struct fs_context *fc, char *value, struct smb3_fs_context *ctx, bool is_smb… in cifs_parse_smb_version() argument
393 ctx->ops = &smb1_operations; in cifs_parse_smb_version()
394 ctx->vals = &smb1_values; in cifs_parse_smb_version()
405 ctx->ops = &smb20_operations; in cifs_parse_smb_version()
406 ctx->vals = &smb20_values; in cifs_parse_smb_version()
417 ctx->ops = &smb21_operations; in cifs_parse_smb_version()
418 ctx->vals = &smb21_values; in cifs_parse_smb_version()
421 ctx->ops = &smb30_operations; in cifs_parse_smb_version()
422 ctx->vals = &smb30_values; in cifs_parse_smb_version()
425 ctx->ops = &smb30_operations; /* currently identical with 3.0 */ in cifs_parse_smb_version()
426 ctx->vals = &smb302_values; in cifs_parse_smb_version()
429 ctx->ops = &smb311_operations; in cifs_parse_smb_version()
430 ctx->vals = &smb311_values; in cifs_parse_smb_version()
433 ctx->ops = &smb30_operations; /* currently identical with 3.0 */ in cifs_parse_smb_version()
434 ctx->vals = &smb3any_values; in cifs_parse_smb_version()
437 ctx->ops = &smb30_operations; in cifs_parse_smb_version()
438 ctx->vals = &smbdefault_values; in cifs_parse_smb_version()
528 char *smb3_fs_context_fullpath(const struct smb3_fs_context *ctx, char dirsep) in smb3_fs_context_fullpath() argument
533 ulen = strlen(ctx->UNC); in smb3_fs_context_fullpath()
534 plen = ctx->prepath ? strlen(ctx->prepath) + 1 : 0; in smb3_fs_context_fullpath()
539 memcpy(s, ctx->UNC, ulen); in smb3_fs_context_fullpath()
542 memcpy(s + ulen + 1, ctx->prepath, plen); in smb3_fs_context_fullpath()
555 smb3_parse_devname(const char *devname, struct smb3_fs_context *ctx) in smb3_parse_devname() argument
578 kfree(ctx->server_hostname); in smb3_parse_devname()
579 ctx->server_hostname = kstrndup(devname + 2, pos - devname - 2, GFP_KERNEL); in smb3_parse_devname()
580 if (!ctx->server_hostname) in smb3_parse_devname()
593 kfree(ctx->UNC); in smb3_parse_devname()
594 ctx->UNC = kstrndup(devname, pos - devname, GFP_KERNEL); in smb3_parse_devname()
595 if (!ctx->UNC) in smb3_parse_devname()
598 convert_delimiter(ctx->UNC, '\\'); in smb3_parse_devname()
604 kfree(ctx->prepath); in smb3_parse_devname()
605 ctx->prepath = NULL; in smb3_parse_devname()
611 ctx->prepath = cifs_sanitize_prepath(pos, GFP_KERNEL); in smb3_parse_devname()
612 if (IS_ERR(ctx->prepath)) { in smb3_parse_devname()
613 rc = PTR_ERR(ctx->prepath); in smb3_parse_devname()
614 ctx->prepath = NULL; in smb3_parse_devname()
705 struct smb3_fs_context *ctx = smb3_fc2context(fc); in smb3_fs_context_validate() local
707 if (ctx->rdma && ctx->vals->protocol_id < SMB30_PROT_ID) { in smb3_fs_context_validate()
714 if (ctx->multiuser) { in smb3_fs_context_validate()
720 if (ctx->got_version == false) in smb3_fs_context_validate()
724 if (!ctx->UNC) { in smb3_fs_context_validate()
730 if (strlen(ctx->UNC) < 3 || !strchr(ctx->UNC + 3, '\\')) { in smb3_fs_context_validate()
735 if (!ctx->got_ip) { in smb3_fs_context_validate()
741 slash = strchr(&ctx->UNC[2], '\\'); in smb3_fs_context_validate()
742 len = slash - &ctx->UNC[2]; in smb3_fs_context_validate()
743 if (!cifs_convert_address((struct sockaddr *)&ctx->dstaddr, in smb3_fs_context_validate()
744 &ctx->UNC[2], len)) { in smb3_fs_context_validate()
751 cifs_set_port((struct sockaddr *)&ctx->dstaddr, ctx->port); in smb3_fs_context_validate()
753 if (ctx->uid_specified && !ctx->forceuid_specified) { in smb3_fs_context_validate()
754 ctx->override_uid = 1; in smb3_fs_context_validate()
758 if (ctx->gid_specified && !ctx->forcegid_specified) { in smb3_fs_context_validate()
759 ctx->override_gid = 1; in smb3_fs_context_validate()
763 if (ctx->override_uid && !ctx->uid_specified) { in smb3_fs_context_validate()
764 ctx->override_uid = 0; in smb3_fs_context_validate()
768 if (ctx->override_gid && !ctx->gid_specified) { in smb3_fs_context_validate()
769 ctx->override_gid = 0; in smb3_fs_context_validate()
778 struct smb3_fs_context *ctx = smb3_fc2context(fc); in smb3_get_tree_common() local
782 root = cifs_smb3_do_mount(fc->fs_type, 0, ctx); in smb3_get_tree_common()
809 struct smb3_fs_context *ctx = smb3_fc2context(fc); in smb3_fs_context_free() local
811 smb3_cleanup_fs_context(ctx); in smb3_fs_context_free()
879 #define STEAL_STRING(cifs_sb, ctx, field) \ argument
881 kfree(ctx->field); \
882 ctx->field = cifs_sb->ctx->field; \
883 cifs_sb->ctx->field = NULL; \
886 #define STEAL_STRING_SENSITIVE(cifs_sb, ctx, field) \ argument
888 kfree_sensitive(ctx->field); \
889 ctx->field = cifs_sb->ctx->field; \
890 cifs_sb->ctx->field = NULL; \
895 struct smb3_fs_context *ctx = smb3_fc2context(fc); in smb3_reconfigure() local
905 rc = smb3_verify_reconfigure_ctx(fc, ctx, cifs_sb->ctx, need_recon); in smb3_reconfigure()
915 STEAL_STRING(cifs_sb, ctx, UNC); in smb3_reconfigure()
916 STEAL_STRING(cifs_sb, ctx, source); in smb3_reconfigure()
917 STEAL_STRING(cifs_sb, ctx, username); in smb3_reconfigure()
919 STEAL_STRING_SENSITIVE(cifs_sb, ctx, password); in smb3_reconfigure()
922 ses->password = kstrdup(ctx->password, GFP_KERNEL); in smb3_reconfigure()
926 ses->password2 = kstrdup(ctx->password2, GFP_KERNEL); in smb3_reconfigure()
933 STEAL_STRING(cifs_sb, ctx, domainname); in smb3_reconfigure()
934 STEAL_STRING(cifs_sb, ctx, nodename); in smb3_reconfigure()
935 STEAL_STRING(cifs_sb, ctx, iocharset); in smb3_reconfigure()
938 if (ctx->rsize == 0) in smb3_reconfigure()
939 ctx->rsize = cifs_sb->ctx->rsize; in smb3_reconfigure()
940 if (ctx->wsize == 0) in smb3_reconfigure()
941 ctx->wsize = cifs_sb->ctx->wsize; in smb3_reconfigure()
944 smb3_cleanup_fs_context_contents(cifs_sb->ctx); in smb3_reconfigure()
945 rc = smb3_fs_context_dup(cifs_sb->ctx, ctx); in smb3_reconfigure()
959 struct smb3_fs_context *ctx = smb3_fc2context(fc); in smb3_fs_context_parse_param() local
983 return ctx->sloppy ? 1 : opt; in smb3_fs_context_parse_param()
992 ctx->compress = true; in smb3_fs_context_parse_param()
996 ctx->nodfs = 1; in smb3_fs_context_parse_param()
1000 if (ctx->retry == 1) in smb3_fs_context_parse_param()
1002 ctx->retry = 0; in smb3_fs_context_parse_param()
1004 ctx->retry = 1; in smb3_fs_context_parse_param()
1008 ctx->retry = 1; in smb3_fs_context_parse_param()
1010 if (ctx->retry == 1) in smb3_fs_context_parse_param()
1012 ctx->retry = 0; in smb3_fs_context_parse_param()
1017 ctx->remap = false; in smb3_fs_context_parse_param()
1019 ctx->remap = true; in smb3_fs_context_parse_param()
1020 ctx->sfu_remap = false; /* disable SFU mapping */ in smb3_fs_context_parse_param()
1025 ctx->sfu_remap = false; in smb3_fs_context_parse_param()
1027 ctx->sfu_remap = true; in smb3_fs_context_parse_param()
1028 ctx->remap = false; /* disable SFM (mapposix) mapping */ in smb3_fs_context_parse_param()
1033 ctx->no_xattr = 1; in smb3_fs_context_parse_param()
1035 ctx->no_xattr = 0; in smb3_fs_context_parse_param()
1039 ctx->override_uid = 0; in smb3_fs_context_parse_param()
1041 ctx->override_uid = 1; in smb3_fs_context_parse_param()
1042 ctx->forceuid_specified = true; in smb3_fs_context_parse_param()
1046 ctx->override_gid = 0; in smb3_fs_context_parse_param()
1048 ctx->override_gid = 1; in smb3_fs_context_parse_param()
1049 ctx->forcegid_specified = true; in smb3_fs_context_parse_param()
1053 ctx->noperm = 1; in smb3_fs_context_parse_param()
1055 ctx->noperm = 0; in smb3_fs_context_parse_param()
1059 ctx->dynperm = 0; in smb3_fs_context_parse_param()
1061 ctx->dynperm = 1; in smb3_fs_context_parse_param()
1065 ctx->sfu_emul = 0; in smb3_fs_context_parse_param()
1067 ctx->sfu_emul = 1; in smb3_fs_context_parse_param()
1070 ctx->noblocksnd = 1; in smb3_fs_context_parse_param()
1073 ctx->noautotune = 1; in smb3_fs_context_parse_param()
1076 ctx->no_lease = 1; in smb3_fs_context_parse_param()
1079 ctx->no_sparse = 1; in smb3_fs_context_parse_param()
1082 ctx->nodelete = 1; in smb3_fs_context_parse_param()
1086 ctx->multichannel = false; in smb3_fs_context_parse_param()
1087 ctx->max_channels = 1; in smb3_fs_context_parse_param()
1089 ctx->multichannel = true; in smb3_fs_context_parse_param()
1091 if (ctx->max_channels < 2) in smb3_fs_context_parse_param()
1092 ctx->max_channels = 2; in smb3_fs_context_parse_param()
1096 ctx->linux_uid = result.uid; in smb3_fs_context_parse_param()
1097 ctx->uid_specified = true; in smb3_fs_context_parse_param()
1100 ctx->cred_uid = result.uid; in smb3_fs_context_parse_param()
1101 ctx->cruid_specified = true; in smb3_fs_context_parse_param()
1104 ctx->backupuid = result.uid; in smb3_fs_context_parse_param()
1105 ctx->backupuid_specified = true; in smb3_fs_context_parse_param()
1108 ctx->backupgid = result.gid; in smb3_fs_context_parse_param()
1109 ctx->backupgid_specified = true; in smb3_fs_context_parse_param()
1112 ctx->linux_gid = result.gid; in smb3_fs_context_parse_param()
1113 ctx->gid_specified = true; in smb3_fs_context_parse_param()
1116 ctx->port = result.uint_32; in smb3_fs_context_parse_param()
1119 ctx->file_mode = result.uint_32; in smb3_fs_context_parse_param()
1122 ctx->dir_mode = result.uint_32; in smb3_fs_context_parse_param()
1125 ctx->min_offload = result.uint_32; in smb3_fs_context_parse_param()
1128 ctx->retrans = result.uint_32; in smb3_fs_context_parse_param()
1143 ctx->bsize = result.uint_32; in smb3_fs_context_parse_param()
1144 ctx->got_bsize = true; in smb3_fs_context_parse_param()
1164 ctx->rasize = result.uint_32; in smb3_fs_context_parse_param()
1167 ctx->rsize = result.uint_32; in smb3_fs_context_parse_param()
1168 ctx->got_rsize = true; in smb3_fs_context_parse_param()
1171 ctx->wsize = result.uint_32; in smb3_fs_context_parse_param()
1172 ctx->got_wsize = true; in smb3_fs_context_parse_param()
1173 if (ctx->wsize % PAGE_SIZE != 0) { in smb3_fs_context_parse_param()
1174 ctx->wsize = round_down(ctx->wsize, PAGE_SIZE); in smb3_fs_context_parse_param()
1175 if (ctx->wsize == 0) { in smb3_fs_context_parse_param()
1176 ctx->wsize = PAGE_SIZE; in smb3_fs_context_parse_param()
1181 ctx->wsize, PAGE_SIZE); in smb3_fs_context_parse_param()
1186 ctx->acregmax = HZ * result.uint_32; in smb3_fs_context_parse_param()
1187 if (ctx->acregmax > CIFS_MAX_ACTIMEO) { in smb3_fs_context_parse_param()
1193 ctx->acdirmax = HZ * result.uint_32; in smb3_fs_context_parse_param()
1194 if (ctx->acdirmax > CIFS_MAX_ACTIMEO) { in smb3_fs_context_parse_param()
1204 if ((ctx->acdirmax != CIFS_DEF_ACTIMEO) || in smb3_fs_context_parse_param()
1205 (ctx->acregmax != CIFS_DEF_ACTIMEO)) { in smb3_fs_context_parse_param()
1209 ctx->acdirmax = ctx->acregmax = HZ * result.uint_32; in smb3_fs_context_parse_param()
1212 ctx->closetimeo = HZ * result.uint_32; in smb3_fs_context_parse_param()
1213 if (ctx->closetimeo > SMB3_MAX_DCLOSETIMEO) { in smb3_fs_context_parse_param()
1219 ctx->echo_interval = result.uint_32; in smb3_fs_context_parse_param()
1222 ctx->snapshot_time = result.uint_64; in smb3_fs_context_parse_param()
1230 ctx->max_credits = result.uint_32; in smb3_fs_context_parse_param()
1238 ctx->max_channels = result.uint_32; in smb3_fs_context_parse_param()
1241 ctx->multichannel = true; in smb3_fs_context_parse_param()
1249 ctx->max_cached_dirs = result.uint_32; in smb3_fs_context_parse_param()
1252 ctx->handle_timeout = result.uint_32; in smb3_fs_context_parse_param()
1253 if (ctx->handle_timeout > SMB3_MAX_HANDLE_TIMEOUT) { in smb3_fs_context_parse_param()
1259 kfree(ctx->UNC); in smb3_fs_context_parse_param()
1260 ctx->UNC = NULL; in smb3_fs_context_parse_param()
1261 switch (smb3_parse_devname(param->string, ctx)) { in smb3_fs_context_parse_param()
1274 ctx->source = smb3_fs_context_fullpath(ctx, '/'); in smb3_fs_context_parse_param()
1275 if (IS_ERR(ctx->source)) { in smb3_fs_context_parse_param()
1276 ctx->source = NULL; in smb3_fs_context_parse_param()
1280 fc->source = kstrdup(ctx->source, GFP_KERNEL); in smb3_fs_context_parse_param()
1287 kfree(ctx->username); in smb3_fs_context_parse_param()
1288 ctx->username = NULL; in smb3_fs_context_parse_param()
1289 if (ctx->nullauth) in smb3_fs_context_parse_param()
1293 ctx->nullauth = 1; in smb3_fs_context_parse_param()
1302 ctx->username = kstrdup(param->string, GFP_KERNEL); in smb3_fs_context_parse_param()
1303 if (ctx->username == NULL) { in smb3_fs_context_parse_param()
1309 kfree_sensitive(ctx->password); in smb3_fs_context_parse_param()
1310 ctx->password = NULL; in smb3_fs_context_parse_param()
1314 ctx->password = kstrdup(param->string, GFP_KERNEL); in smb3_fs_context_parse_param()
1315 if (ctx->password == NULL) { in smb3_fs_context_parse_param()
1321 kfree_sensitive(ctx->password2); in smb3_fs_context_parse_param()
1322 ctx->password2 = NULL; in smb3_fs_context_parse_param()
1326 ctx->password2 = kstrdup(param->string, GFP_KERNEL); in smb3_fs_context_parse_param()
1327 if (ctx->password2 == NULL) { in smb3_fs_context_parse_param()
1334 ctx->got_ip = false; in smb3_fs_context_parse_param()
1337 if (!cifs_convert_address((struct sockaddr *)&ctx->dstaddr, in smb3_fs_context_parse_param()
1343 ctx->got_ip = true; in smb3_fs_context_parse_param()
1352 kfree(ctx->domainname); in smb3_fs_context_parse_param()
1353 ctx->domainname = kstrdup(param->string, GFP_KERNEL); in smb3_fs_context_parse_param()
1354 if (ctx->domainname == NULL) { in smb3_fs_context_parse_param()
1362 (struct sockaddr *)&ctx->srcaddr, in smb3_fs_context_parse_param()
1376 kfree(ctx->iocharset); in smb3_fs_context_parse_param()
1377 ctx->iocharset = kstrdup(param->string, GFP_KERNEL); in smb3_fs_context_parse_param()
1378 if (ctx->iocharset == NULL) { in smb3_fs_context_parse_param()
1386 cifs_dbg(FYI, "iocharset set to %s\n", ctx->iocharset); in smb3_fs_context_parse_param()
1389 memset(ctx->source_rfc1001_name, 0x20, in smb3_fs_context_parse_param()
1400 ctx->source_rfc1001_name[i] = param->string[i]; in smb3_fs_context_parse_param()
1410 memset(ctx->target_rfc1001_name, 0x20, in smb3_fs_context_parse_param()
1421 ctx->target_rfc1001_name[i] = param->string[i]; in smb3_fs_context_parse_param()
1445 if (cifs_parse_smb_version(fc, param->string, ctx, is_smb3) != 0) in smb3_fs_context_parse_param()
1447 ctx->got_version = true; in smb3_fs_context_parse_param()
1450 if (cifs_parse_security_flavors(fc, param->string, ctx) != 0) in smb3_fs_context_parse_param()
1454 if (cifs_parse_cache_flavor(fc, param->string, ctx) != 0) in smb3_fs_context_parse_param()
1462 ctx->witness = true; in smb3_fs_context_parse_param()
1470 ctx->rootfs = true; in smb3_fs_context_parse_param()
1474 ctx->posix_paths = 0; in smb3_fs_context_parse_param()
1476 ctx->posix_paths = 1; in smb3_fs_context_parse_param()
1480 if (ctx->linux_ext == 1) in smb3_fs_context_parse_param()
1482 ctx->linux_ext = 0; in smb3_fs_context_parse_param()
1483 ctx->no_linux_ext = 1; in smb3_fs_context_parse_param()
1485 if (ctx->no_linux_ext == 1) in smb3_fs_context_parse_param()
1487 ctx->linux_ext = 1; in smb3_fs_context_parse_param()
1488 ctx->no_linux_ext = 0; in smb3_fs_context_parse_param()
1492 ctx->nocase = 1; in smb3_fs_context_parse_param()
1501 if (ctx->file_mode == in smb3_fs_context_parse_param()
1503 ctx->file_mode = S_IALLUGO; in smb3_fs_context_parse_param()
1504 ctx->nobrl = 1; in smb3_fs_context_parse_param()
1506 ctx->nobrl = 0; in smb3_fs_context_parse_param()
1510 ctx->nohandlecache = 1; in smb3_fs_context_parse_param()
1512 ctx->nohandlecache = 0; in smb3_fs_context_parse_param()
1515 ctx->mand_lock = 1; in smb3_fs_context_parse_param()
1518 ctx->setuids = result.negated; in smb3_fs_context_parse_param()
1521 ctx->intr = !result.negated; in smb3_fs_context_parse_param()
1524 ctx->setuidfromacl = 1; in smb3_fs_context_parse_param()
1527 ctx->nostrictsync = result.negated; in smb3_fs_context_parse_param()
1530 ctx->server_ino = !result.negated; in smb3_fs_context_parse_param()
1533 ctx->rwpidforward = 1; in smb3_fs_context_parse_param()
1536 ctx->mode_ace = 1; in smb3_fs_context_parse_param()
1539 ctx->cifs_acl = !result.negated; in smb3_fs_context_parse_param()
1542 ctx->no_psx_acl = result.negated; in smb3_fs_context_parse_param()
1545 ctx->local_lease = 1; in smb3_fs_context_parse_param()
1548 ctx->sign = true; in smb3_fs_context_parse_param()
1551 ctx->sign = true; in smb3_fs_context_parse_param()
1552 ctx->ignore_signature = true; in smb3_fs_context_parse_param()
1560 ctx->seal = 1; in smb3_fs_context_parse_param()
1570 ctx->fsc = true; in smb3_fs_context_parse_param()
1573 ctx->mfsymlinks = true; in smb3_fs_context_parse_param()
1576 ctx->multiuser = true; in smb3_fs_context_parse_param()
1579 ctx->sloppy = true; in smb3_fs_context_parse_param()
1582 ctx->nosharesock = true; in smb3_fs_context_parse_param()
1586 ctx->nopersistent = true; in smb3_fs_context_parse_param()
1587 if (ctx->persistent) { in smb3_fs_context_parse_param()
1592 ctx->persistent = true; in smb3_fs_context_parse_param()
1593 if ((ctx->nopersistent) || (ctx->resilient)) { in smb3_fs_context_parse_param()
1601 ctx->resilient = false; /* already the default */ in smb3_fs_context_parse_param()
1603 ctx->resilient = true; in smb3_fs_context_parse_param()
1604 if (ctx->persistent) { in smb3_fs_context_parse_param()
1613 ctx->sockopt_tcp_nodelay = false; in smb3_fs_context_parse_param()
1615 ctx->sockopt_tcp_nodelay = true; in smb3_fs_context_parse_param()
1618 ctx->domainauto = true; in smb3_fs_context_parse_param()
1621 ctx->rdma = true; in smb3_fs_context_parse_param()
1624 if (parse_reparse_flavor(fc, param->string, ctx)) in smb3_fs_context_parse_param()
1633 kfree_sensitive(ctx->password); in smb3_fs_context_parse_param()
1634 ctx->password = NULL; in smb3_fs_context_parse_param()
1635 kfree_sensitive(ctx->password2); in smb3_fs_context_parse_param()
1636 ctx->password2 = NULL; in smb3_fs_context_parse_param()
1642 struct smb3_fs_context *ctx; in smb3_init_fs_context() local
1646 ctx = kzalloc(sizeof(struct smb3_fs_context), GFP_KERNEL); in smb3_init_fs_context()
1647 if (unlikely(!ctx)) in smb3_init_fs_context()
1650 strscpy(ctx->workstation_name, nodename, sizeof(ctx->workstation_name)); in smb3_init_fs_context()
1657 memset(ctx->source_rfc1001_name, 0x20, RFC1001_NAME_LEN); in smb3_init_fs_context()
1659 ctx->source_rfc1001_name[i] = toupper(nodename[i]); in smb3_init_fs_context()
1661 ctx->source_rfc1001_name[RFC1001_NAME_LEN] = 0; in smb3_init_fs_context()
1666 ctx->target_rfc1001_name[0] = 0; in smb3_init_fs_context()
1667 ctx->cred_uid = current_uid(); in smb3_init_fs_context()
1668 ctx->linux_uid = current_uid(); in smb3_init_fs_context()
1669 ctx->linux_gid = current_gid(); in smb3_init_fs_context()
1671 ctx->bsize = CIFS_DEFAULT_IOSIZE; /* can improve cp performance significantly */ in smb3_init_fs_context()
1672 ctx->rasize = 0; /* 0 = use default (ie negotiated rsize) for read ahead pages */ in smb3_init_fs_context()
1680 ctx->remap = true; in smb3_init_fs_context()
1683 ctx->dir_mode = ctx->file_mode = S_IRUGO | S_IXUGO | S_IWUSR; in smb3_init_fs_context()
1687 ctx->posix_paths = 1; in smb3_init_fs_context()
1689 ctx->server_ino = 1; in smb3_init_fs_context()
1692 ctx->strict_io = true; in smb3_init_fs_context()
1694 ctx->acregmax = CIFS_DEF_ACTIMEO; in smb3_init_fs_context()
1695 ctx->acdirmax = CIFS_DEF_ACTIMEO; in smb3_init_fs_context()
1696 ctx->closetimeo = SMB3_DEF_DCLOSETIMEO; in smb3_init_fs_context()
1697 ctx->max_cached_dirs = MAX_CACHED_FIDS; in smb3_init_fs_context()
1699 ctx->handle_timeout = 0; /* See MS-SMB2 spec section 2.2.14.2.12 */ in smb3_init_fs_context()
1702 ctx->ops = &smb30_operations; in smb3_init_fs_context()
1703 ctx->vals = &smbdefault_values; in smb3_init_fs_context()
1705 ctx->echo_interval = SMB_ECHO_INTERVAL_DEFAULT; in smb3_init_fs_context()
1708 ctx->multichannel = false; in smb3_init_fs_context()
1709 ctx->max_channels = 1; in smb3_init_fs_context()
1711 ctx->backupuid_specified = false; /* no backup intent for a user */ in smb3_init_fs_context()
1712 ctx->backupgid_specified = false; /* no backup intent for a group */ in smb3_init_fs_context()
1714 ctx->retrans = 1; in smb3_init_fs_context()
1715 ctx->reparse_type = CIFS_REPARSE_TYPE_DEFAULT; in smb3_init_fs_context()
1724 fc->fs_private = ctx; in smb3_init_fs_context()
1730 smb3_cleanup_fs_context_contents(struct smb3_fs_context *ctx) in smb3_cleanup_fs_context_contents() argument
1732 if (ctx == NULL) in smb3_cleanup_fs_context_contents()
1738 kfree(ctx->username); in smb3_cleanup_fs_context_contents()
1739 ctx->username = NULL; in smb3_cleanup_fs_context_contents()
1740 kfree_sensitive(ctx->password); in smb3_cleanup_fs_context_contents()
1741 ctx->password = NULL; in smb3_cleanup_fs_context_contents()
1742 kfree_sensitive(ctx->password2); in smb3_cleanup_fs_context_contents()
1743 ctx->password2 = NULL; in smb3_cleanup_fs_context_contents()
1744 kfree(ctx->server_hostname); in smb3_cleanup_fs_context_contents()
1745 ctx->server_hostname = NULL; in smb3_cleanup_fs_context_contents()
1746 kfree(ctx->UNC); in smb3_cleanup_fs_context_contents()
1747 ctx->UNC = NULL; in smb3_cleanup_fs_context_contents()
1748 kfree(ctx->source); in smb3_cleanup_fs_context_contents()
1749 ctx->source = NULL; in smb3_cleanup_fs_context_contents()
1750 kfree(ctx->domainname); in smb3_cleanup_fs_context_contents()
1751 ctx->domainname = NULL; in smb3_cleanup_fs_context_contents()
1752 kfree(ctx->nodename); in smb3_cleanup_fs_context_contents()
1753 ctx->nodename = NULL; in smb3_cleanup_fs_context_contents()
1754 kfree(ctx->iocharset); in smb3_cleanup_fs_context_contents()
1755 ctx->iocharset = NULL; in smb3_cleanup_fs_context_contents()
1756 kfree(ctx->prepath); in smb3_cleanup_fs_context_contents()
1757 ctx->prepath = NULL; in smb3_cleanup_fs_context_contents()
1758 kfree(ctx->leaf_fullpath); in smb3_cleanup_fs_context_contents()
1759 ctx->leaf_fullpath = NULL; in smb3_cleanup_fs_context_contents()
1763 smb3_cleanup_fs_context(struct smb3_fs_context *ctx) in smb3_cleanup_fs_context() argument
1765 if (!ctx) in smb3_cleanup_fs_context()
1767 smb3_cleanup_fs_context_contents(ctx); in smb3_cleanup_fs_context()
1768 kfree(ctx); in smb3_cleanup_fs_context()
1773 struct smb3_fs_context *ctx = cifs_sb->ctx; in smb3_update_mnt_flags() local
1775 if (ctx->nodfs) in smb3_update_mnt_flags()
1780 if (ctx->noperm) in smb3_update_mnt_flags()
1785 if (ctx->setuids) in smb3_update_mnt_flags()
1790 if (ctx->setuidfromacl) in smb3_update_mnt_flags()
1795 if (ctx->server_ino) in smb3_update_mnt_flags()
1800 if (ctx->remap) in smb3_update_mnt_flags()
1805 if (ctx->sfu_remap) in smb3_update_mnt_flags()
1810 if (ctx->no_xattr) in smb3_update_mnt_flags()
1815 if (ctx->sfu_emul) in smb3_update_mnt_flags()
1820 if (ctx->nobrl) in smb3_update_mnt_flags()
1825 if (ctx->nohandlecache) in smb3_update_mnt_flags()
1830 if (ctx->nostrictsync) in smb3_update_mnt_flags()
1835 if (ctx->mand_lock) in smb3_update_mnt_flags()
1840 if (ctx->rwpidforward) in smb3_update_mnt_flags()
1845 if (ctx->mode_ace) in smb3_update_mnt_flags()
1850 if (ctx->cifs_acl) in smb3_update_mnt_flags()
1855 if (ctx->backupuid_specified) in smb3_update_mnt_flags()
1860 if (ctx->backupgid_specified) in smb3_update_mnt_flags()
1865 if (ctx->override_uid) in smb3_update_mnt_flags()
1870 if (ctx->override_gid) in smb3_update_mnt_flags()
1875 if (ctx->dynperm) in smb3_update_mnt_flags()
1880 if (ctx->fsc) in smb3_update_mnt_flags()
1885 if (ctx->multiuser) in smb3_update_mnt_flags()
1892 if (ctx->strict_io) in smb3_update_mnt_flags()
1897 if (ctx->direct_io) in smb3_update_mnt_flags()
1902 if (ctx->mfsymlinks) in smb3_update_mnt_flags()
1906 if (ctx->mfsymlinks) { in smb3_update_mnt_flags()
1907 if (ctx->sfu_emul) { in smb3_update_mnt_flags()