Lines Matching refs:fc

309 static int nfs_validate_transport_protocol(struct fs_context *fc,  in nfs_validate_transport_protocol()  argument
325 return nfs_invalf(fc, "NFS: Unsupported transport protocol udp"); in nfs_validate_transport_protocol()
351 static int nfs_auth_info_add(struct fs_context *fc, in nfs_auth_info_add() argument
365 return nfs_invalf(fc, "NFS: too many sec= flavors"); in nfs_auth_info_add()
374 static int nfs_parse_security_flavors(struct fs_context *fc, in nfs_parse_security_flavors() argument
377 struct nfs_fs_context *ctx = nfs_fc2context(fc); in nfs_parse_security_flavors()
422 return nfs_invalf(fc, "NFS: sec=%s option not recognized", p); in nfs_parse_security_flavors()
425 ret = nfs_auth_info_add(fc, &ctx->auth_info, pseudoflavor); in nfs_parse_security_flavors()
433 static int nfs_parse_version_string(struct fs_context *fc, in nfs_parse_version_string() argument
436 struct nfs_fs_context *ctx = nfs_fc2context(fc); in nfs_parse_version_string()
467 return nfs_invalf(fc, "NFS: Unsupported NFS version"); in nfs_parse_version_string()
475 static int nfs_fs_context_parse_param(struct fs_context *fc, in nfs_fs_context_parse_param() argument
479 struct nfs_fs_context *ctx = nfs_fc2context(fc); in nfs_fs_context_parse_param()
486 opt = fs_parse(fc, nfs_fs_parameters, param, &result); in nfs_fs_context_parse_param()
490 if (fc->security) in nfs_fs_context_parse_param()
495 if (fc->source) in nfs_fs_context_parse_param()
496 return nfs_invalf(fc, "NFS: Multiple sources not supported"); in nfs_fs_context_parse_param()
497 fc->source = param->string; in nfs_fs_context_parse_param()
682 ret = nfs_parse_version_string(fc, param->key + 1); in nfs_fs_context_parse_param()
688 ret = nfs_parse_version_string(fc, param->string); in nfs_fs_context_parse_param()
693 ret = nfs_parse_security_flavors(fc, param); in nfs_fs_context_parse_param()
759 len = rpc_pton(fc->net_ns, param->string, param->size, in nfs_fs_context_parse_param()
780 len = rpc_pton(fc->net_ns, param->string, param->size, in nfs_fs_context_parse_param()
863 return nfs_invalf(fc, "NFS: Bad mount option value specified"); in nfs_fs_context_parse_param()
865 return nfs_invalf(fc, "NFS: Bad IP address specified"); in nfs_fs_context_parse_param()
867 return nfs_invalf(fc, "NFS: Value for '%s' out of range", param->key); in nfs_fs_context_parse_param()
869 return nfs_invalf(fc, "NFS: Unrecognized transport protocol"); in nfs_fs_context_parse_param()
881 static int nfs_parse_source(struct fs_context *fc, in nfs_parse_source() argument
884 struct nfs_fs_context *ctx = nfs_fc2context(fc); in nfs_parse_source()
885 const char *dev_name = fc->source; in nfs_parse_source()
934 return nfs_invalf(fc, "NFS: device name not in host:path format"); in nfs_parse_source()
936 nfs_errorf(fc, "NFS: not enough memory to parse device name"); in nfs_parse_source()
939 nfs_errorf(fc, "NFS: server hostname too long"); in nfs_parse_source()
942 nfs_errorf(fc, "NFS: export pathname too long"); in nfs_parse_source()
946 static inline bool is_remount_fc(struct fs_context *fc) in is_remount_fc() argument
948 return fc->root != NULL; in is_remount_fc()
967 static int nfs23_parse_monolithic(struct fs_context *fc, in nfs23_parse_monolithic() argument
970 struct nfs_fs_context *ctx = nfs_fc2context(fc); in nfs23_parse_monolithic()
1086 ret = vfs_parse_fs_string(fc, "context", in nfs23_parse_monolithic()
1100 ret = nfs_validate_transport_protocol(fc, ctx); in nfs23_parse_monolithic()
1108 return generic_parse_monolithic(fc, data); in nfs23_parse_monolithic()
1111 if (is_remount_fc(fc)) { in nfs23_parse_monolithic()
1115 return nfs_invalf(fc, "NFS: mount program didn't pass any mount data"); in nfs23_parse_monolithic()
1118 return nfs_invalf(fc, "NFS: nfs_mount_data version does not support v3"); in nfs23_parse_monolithic()
1121 return nfs_invalf(fc, "NFS: nfs_mount_data version supports only AUTH_SYS"); in nfs23_parse_monolithic()
1127 return nfs_invalf(fc, "NFS: mount program didn't pass remote address"); in nfs23_parse_monolithic()
1130 return nfs_invalf(fc, "NFS: invalid root filehandle"); in nfs23_parse_monolithic()
1133 return nfs_invalf(fc, "NFS: invalid binary mount data"); in nfs23_parse_monolithic()
1199 static int nfs4_parse_monolithic(struct fs_context *fc, in nfs4_parse_monolithic() argument
1202 struct nfs_fs_context *ctx = nfs_fc2context(fc); in nfs4_parse_monolithic()
1208 if (is_remount_fc(fc)) in nfs4_parse_monolithic()
1210 return nfs_invalf(fc, in nfs4_parse_monolithic()
1217 return generic_parse_monolithic(fc, data); in nfs4_parse_monolithic()
1277 ret = nfs_validate_transport_protocol(fc, ctx); in nfs4_parse_monolithic()
1285 return nfs_invalf(fc, "NFS4: Invalid number of RPC auth flavours %d", in nfs4_parse_monolithic()
1289 return nfs_invalf(fc, "NFS4: mount program didn't pass remote address"); in nfs4_parse_monolithic()
1296 static int nfs_fs_context_parse_monolithic(struct fs_context *fc, in nfs_fs_context_parse_monolithic() argument
1299 if (fc->fs_type == &nfs_fs_type) in nfs_fs_context_parse_monolithic()
1300 return nfs23_parse_monolithic(fc, data); in nfs_fs_context_parse_monolithic()
1303 if (fc->fs_type == &nfs4_fs_type) in nfs_fs_context_parse_monolithic()
1304 return nfs4_parse_monolithic(fc, data); in nfs_fs_context_parse_monolithic()
1307 return nfs_invalf(fc, "NFS: Unsupported monolithic data version"); in nfs_fs_context_parse_monolithic()
1313 static int nfs_fs_context_validate(struct fs_context *fc) in nfs_fs_context_validate() argument
1315 struct nfs_fs_context *ctx = nfs_fc2context(fc); in nfs_fs_context_validate()
1323 if (!fc->source) in nfs_fs_context_validate()
1354 ret = nfs_validate_transport_protocol(fc, ctx); in nfs_fs_context_validate()
1380 ret = nfs_parse_source(fc, max_namelen, max_pathlen); in nfs_fs_context_validate()
1395 if (fc->fs_type != ctx->nfs_mod->nfs_fs) { in nfs_fs_context_validate()
1396 module_put(fc->fs_type->owner); in nfs_fs_context_validate()
1398 fc->fs_type = ctx->nfs_mod->nfs_fs; in nfs_fs_context_validate()
1403 return nfs_invalf(fc, "NFS: Device name not specified"); in nfs_fs_context_validate()
1405 nfs_errorf(fc, "NFS: NFSv4 is not compiled into kernel"); in nfs_fs_context_validate()
1408 return nfs_invalf(fc, "NFS: mount program didn't pass remote address"); in nfs_fs_context_validate()
1410 return nfs_invalf(fc, "NFS: Mount server address does not match mountproto= option"); in nfs_fs_context_validate()
1412 return nfs_invalf(fc, "NFS: Server address does not match proto= option"); in nfs_fs_context_validate()
1414 return nfs_invalf(fc, "NFS: Mount option vers=%u does not support minorversion=%u", in nfs_fs_context_validate()
1417 return nfs_invalf(fc, "NFS: 'Migration' not supported for this NFS version"); in nfs_fs_context_validate()
1419 nfs_errorf(fc, "NFS: Version unavailable"); in nfs_fs_context_validate()
1426 static int nfs_get_tree(struct fs_context *fc) in nfs_get_tree() argument
1428 struct nfs_fs_context *ctx = nfs_fc2context(fc); in nfs_get_tree()
1429 int err = nfs_fs_context_validate(fc); in nfs_get_tree()
1434 return ctx->nfs_mod->rpc_ops->try_get_tree(fc); in nfs_get_tree()
1436 return nfs_get_tree_common(fc); in nfs_get_tree()
1445 static int nfs_fs_context_dup(struct fs_context *fc, struct fs_context *src_fc) in nfs_fs_context_dup() argument
1467 fc->fs_private = ctx; in nfs_fs_context_dup()
1471 static void nfs_fs_context_free(struct fs_context *fc) in nfs_fs_context_free() argument
1473 struct nfs_fs_context *ctx = nfs_fc2context(fc); in nfs_fs_context_free()
1505 static int nfs_init_fs_context(struct fs_context *fc) in nfs_init_fs_context() argument
1523 if (fc->root) { in nfs_init_fs_context()
1525 struct nfs_server *nfss = fc->root->d_sb->s_fs_info; in nfs_init_fs_context()
1546 if (fc->net_ns != net) { in nfs_init_fs_context()
1547 put_net(fc->net_ns); in nfs_init_fs_context()
1548 fc->net_ns = get_net(net); in nfs_init_fs_context()
1567 fc->s_iflags |= SB_I_STABLE_WRITES; in nfs_init_fs_context()
1569 fc->fs_private = ctx; in nfs_init_fs_context()
1570 fc->ops = &nfs_fs_context_ops; in nfs_init_fs_context()