Lines Matching full:fc

330 static int nfs_validate_transport_protocol(struct fs_context *fc,  in nfs_validate_transport_protocol()  argument
356 return nfs_invalf(fc, "NFS: Unsupported transport protocol udp"); in nfs_validate_transport_protocol()
358 return nfs_invalf(fc, "NFS: Transport does not support xprtsec"); in nfs_validate_transport_protocol()
384 static int nfs_auth_info_add(struct fs_context *fc, in nfs_auth_info_add() argument
398 return nfs_invalf(fc, "NFS: too many sec= flavors"); in nfs_auth_info_add()
407 static int nfs_parse_security_flavors(struct fs_context *fc, in nfs_parse_security_flavors() argument
410 struct nfs_fs_context *ctx = nfs_fc2context(fc); in nfs_parse_security_flavors()
455 return nfs_invalf(fc, "NFS: sec=%s option not recognized", p); in nfs_parse_security_flavors()
458 ret = nfs_auth_info_add(fc, &ctx->auth_info, pseudoflavor); in nfs_parse_security_flavors()
466 static int nfs_parse_xprtsec_policy(struct fs_context *fc, in nfs_parse_xprtsec_policy() argument
469 struct nfs_fs_context *ctx = nfs_fc2context(fc); in nfs_parse_xprtsec_policy()
484 return nfs_invalf(fc, "NFS: Unrecognized transport security policy"); in nfs_parse_xprtsec_policy()
489 static int nfs_parse_version_string(struct fs_context *fc, in nfs_parse_version_string() argument
492 struct nfs_fs_context *ctx = nfs_fc2context(fc); in nfs_parse_version_string()
523 return nfs_invalf(fc, "NFS: Unsupported NFS version"); in nfs_parse_version_string()
531 static int nfs_fs_context_parse_param(struct fs_context *fc, in nfs_fs_context_parse_param() argument
535 struct nfs_fs_context *ctx = nfs_fc2context(fc); in nfs_fs_context_parse_param()
542 opt = fs_parse(fc, nfs_fs_parameters, param, &result); in nfs_fs_context_parse_param()
546 if (fc->security) in nfs_fs_context_parse_param()
551 if (fc->source) in nfs_fs_context_parse_param()
552 return nfs_invalf(fc, "NFS: Multiple sources not supported"); in nfs_fs_context_parse_param()
553 fc->source = param->string; in nfs_fs_context_parse_param()
747 ret = nfs_parse_version_string(fc, param->key + 1); in nfs_fs_context_parse_param()
755 ret = nfs_parse_version_string(fc, param->string); in nfs_fs_context_parse_param()
760 ret = nfs_parse_security_flavors(fc, param); in nfs_fs_context_parse_param()
765 ret = nfs_parse_xprtsec_policy(fc, param); in nfs_fs_context_parse_param()
835 len = rpc_pton(fc->net_ns, param->string, param->size, in nfs_fs_context_parse_param()
856 len = rpc_pton(fc->net_ns, param->string, param->size, in nfs_fs_context_parse_param()
944 return nfs_invalf(fc, "NFS: Bad mount option value specified"); in nfs_fs_context_parse_param()
946 return nfs_invalf(fc, "NFS: Bad IP address specified"); in nfs_fs_context_parse_param()
948 return nfs_invalf(fc, "NFS: Value for '%s' out of range", param->key); in nfs_fs_context_parse_param()
950 return nfs_invalf(fc, "NFS: Unrecognized transport protocol"); in nfs_fs_context_parse_param()
954 * Split fc->source into "hostname:export_path".
962 static int nfs_parse_source(struct fs_context *fc, in nfs_parse_source() argument
965 struct nfs_fs_context *ctx = nfs_fc2context(fc); in nfs_parse_source()
966 const char *dev_name = fc->source; in nfs_parse_source()
1015 return nfs_invalf(fc, "NFS: device name not in host:path format"); in nfs_parse_source()
1017 nfs_errorf(fc, "NFS: not enough memory to parse device name"); in nfs_parse_source()
1020 nfs_errorf(fc, "NFS: server hostname too long"); in nfs_parse_source()
1023 nfs_errorf(fc, "NFS: export pathname too long"); in nfs_parse_source()
1027 static inline bool is_remount_fc(struct fs_context *fc) in is_remount_fc() argument
1029 return fc->root != NULL; in is_remount_fc()
1048 static int nfs23_parse_monolithic(struct fs_context *fc, in nfs23_parse_monolithic() argument
1051 struct nfs_fs_context *ctx = nfs_fc2context(fc); in nfs23_parse_monolithic()
1125 if (!is_remount_fc(fc)) { in nfs23_parse_monolithic()
1170 ret = vfs_parse_fs_string(fc, "context", in nfs23_parse_monolithic()
1184 ret = nfs_validate_transport_protocol(fc, ctx); in nfs23_parse_monolithic()
1192 return generic_parse_monolithic(fc, data); in nfs23_parse_monolithic()
1195 if (is_remount_fc(fc)) { in nfs23_parse_monolithic()
1199 return nfs_invalf(fc, "NFS: mount program didn't pass any mount data"); in nfs23_parse_monolithic()
1202 return nfs_invalf(fc, "NFS: nfs_mount_data version does not support v3"); in nfs23_parse_monolithic()
1205 return nfs_invalf(fc, "NFS: nfs_mount_data version supports only AUTH_SYS"); in nfs23_parse_monolithic()
1211 return nfs_invalf(fc, "NFS: mount program didn't pass remote address"); in nfs23_parse_monolithic()
1214 return nfs_invalf(fc, "NFS: invalid root filehandle"); in nfs23_parse_monolithic()
1217 return nfs_invalf(fc, "NFS: invalid binary mount data"); in nfs23_parse_monolithic()
1283 static int nfs4_parse_monolithic(struct fs_context *fc, in nfs4_parse_monolithic() argument
1286 struct nfs_fs_context *ctx = nfs_fc2context(fc); in nfs4_parse_monolithic()
1292 if (is_remount_fc(fc)) in nfs4_parse_monolithic()
1294 return nfs_invalf(fc, in nfs4_parse_monolithic()
1301 return generic_parse_monolithic(fc, data); in nfs4_parse_monolithic()
1361 ret = nfs_validate_transport_protocol(fc, ctx); in nfs4_parse_monolithic()
1369 return nfs_invalf(fc, "NFS4: Invalid number of RPC auth flavours %d", in nfs4_parse_monolithic()
1373 return nfs_invalf(fc, "NFS4: mount program didn't pass remote address"); in nfs4_parse_monolithic()
1380 static int nfs_fs_context_parse_monolithic(struct fs_context *fc, in nfs_fs_context_parse_monolithic() argument
1383 if (fc->fs_type == &nfs_fs_type) in nfs_fs_context_parse_monolithic()
1384 return nfs23_parse_monolithic(fc, data); in nfs_fs_context_parse_monolithic()
1387 if (fc->fs_type == &nfs4_fs_type) in nfs_fs_context_parse_monolithic()
1388 return nfs4_parse_monolithic(fc, data); in nfs_fs_context_parse_monolithic()
1391 return nfs_invalf(fc, "NFS: Unsupported monolithic data version"); in nfs_fs_context_parse_monolithic()
1397 static int nfs_fs_context_validate(struct fs_context *fc) in nfs_fs_context_validate() argument
1399 struct nfs_fs_context *ctx = nfs_fc2context(fc); in nfs_fs_context_validate()
1407 if (!fc->source) in nfs_fs_context_validate()
1438 ret = nfs_validate_transport_protocol(fc, ctx); in nfs_fs_context_validate()
1464 ret = nfs_parse_source(fc, max_namelen, max_pathlen); in nfs_fs_context_validate()
1479 if (fc->fs_type != ctx->nfs_mod->nfs_fs) { in nfs_fs_context_validate()
1480 module_put(fc->fs_type->owner); in nfs_fs_context_validate()
1482 fc->fs_type = ctx->nfs_mod->nfs_fs; in nfs_fs_context_validate()
1487 return nfs_invalf(fc, "NFS: Device name not specified"); in nfs_fs_context_validate()
1489 nfs_errorf(fc, "NFS: NFSv4 is not compiled into kernel"); in nfs_fs_context_validate()
1492 return nfs_invalf(fc, "NFS: mount program didn't pass remote address"); in nfs_fs_context_validate()
1494 return nfs_invalf(fc, "NFS: Mount server address does not match mountproto= option"); in nfs_fs_context_validate()
1496 return nfs_invalf(fc, "NFS: Server address does not match proto= option"); in nfs_fs_context_validate()
1498 return nfs_invalf(fc, "NFS: Mount option vers=%u does not support minorversion=%u", in nfs_fs_context_validate()
1501 return nfs_invalf(fc, "NFS: 'Migration' not supported for this NFS version"); in nfs_fs_context_validate()
1503 nfs_errorf(fc, "NFS: Version unavailable"); in nfs_fs_context_validate()
1510 static int nfs_get_tree(struct fs_context *fc) in nfs_get_tree() argument
1512 struct nfs_fs_context *ctx = nfs_fc2context(fc); in nfs_get_tree()
1513 int err = nfs_fs_context_validate(fc); in nfs_get_tree()
1518 return ctx->nfs_mod->rpc_ops->try_get_tree(fc); in nfs_get_tree()
1520 return nfs_get_tree_common(fc); in nfs_get_tree()
1529 static int nfs_fs_context_dup(struct fs_context *fc, struct fs_context *src_fc) in nfs_fs_context_dup() argument
1551 fc->fs_private = ctx; in nfs_fs_context_dup()
1555 static void nfs_fs_context_free(struct fs_context *fc) in nfs_fs_context_free() argument
1557 struct nfs_fs_context *ctx = nfs_fc2context(fc); in nfs_fs_context_free()
1589 static int nfs_init_fs_context(struct fs_context *fc) in nfs_init_fs_context() argument
1607 if (fc->root) { in nfs_init_fs_context()
1609 struct nfs_server *nfss = fc->root->d_sb->s_fs_info; in nfs_init_fs_context()
1630 if (fc->net_ns != net) { in nfs_init_fs_context()
1631 put_net(fc->net_ns); in nfs_init_fs_context()
1632 fc->net_ns = get_net(net); in nfs_init_fs_context()
1654 fc->s_iflags |= SB_I_STABLE_WRITES; in nfs_init_fs_context()
1656 fc->fs_private = ctx; in nfs_init_fs_context()
1657 fc->ops = &nfs_fs_context_ops; in nfs_init_fs_context()