linux/fs/smb/client/fs_context.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *   Copyright (C) 2020, Microsoft Corporation.
 *
 *   Author(s): Steve French <[email protected]>
 *              David Howells <[email protected]>
 */

/*
#include <linux/module.h>
#include <linux/nsproxy.h>
#include <linux/slab.h>
#include <linux/magic.h>
#include <linux/security.h>
#include <net/net_namespace.h>
#ifdef CONFIG_CIFS_DFS_UPCALL
#include "dfs_cache.h"
#endif
*/

#include <linux/ctype.h>
#include <linux/fs_context.h>
#include <linux/fs_parser.h>
#include <linux/fs.h>
#include <linux/mount.h>
#include <linux/parser.h>
#include <linux/utsname.h>
#include "cifsfs.h"
#include "cifspdu.h"
#include "cifsglob.h"
#include "cifsproto.h"
#include "cifs_unicode.h"
#include "cifs_debug.h"
#include "cifs_fs_sb.h"
#include "ntlmssp.h"
#include "nterr.h"
#include "rfc1002pdu.h"
#include "fs_context.h"

DEFINE_MUTEX();

static const match_table_t cifs_smb_version_tokens =;

static const match_table_t cifs_secflavor_tokens =;

const struct fs_parameter_spec smb3_fs_parameters[] =;

static int
cifs_parse_security_flavors(struct fs_context *fc, char *value, struct smb3_fs_context *ctx)
{}

static const match_table_t cifs_cacheflavor_tokens =;

static int
cifs_parse_cache_flavor(struct fs_context *fc, char *value, struct smb3_fs_context *ctx)
{}

static const match_table_t reparse_flavor_tokens =;

static int parse_reparse_flavor(struct fs_context *fc, char *value,
				struct smb3_fs_context *ctx)
{}

#define DUP_CTX_STR(field)

int
smb3_fs_context_dup(struct smb3_fs_context *new_ctx, struct smb3_fs_context *ctx)
{}

static int
cifs_parse_smb_version(struct fs_context *fc, char *value, struct smb3_fs_context *ctx, bool is_smb3)
{}

int smb3_parse_opt(const char *options, const char *key, char **val)
{}

/*
 * Remove duplicate path delimiters. Windows is supposed to do that
 * but there are some bugs that prevent rename from working if there are
 * multiple delimiters.
 *
 * Return a sanitized duplicate of @path or NULL for empty prefix paths.
 * Otherwise, return ERR_PTR.
 *
 * @gfp indicates the GFP_* flags for kstrdup.
 * The caller is responsible for freeing the original.
 */
#define IS_DELIM(c)
char *cifs_sanitize_prepath(char *prepath, gfp_t gfp)
{}

/*
 * Return full path based on the values of @ctx->{UNC,prepath}.
 *
 * It is assumed that both values were already parsed by smb3_parse_devname().
 */
char *smb3_fs_context_fullpath(const struct smb3_fs_context *ctx, char dirsep)
{}

/*
 * Parse a devname into substrings and populate the ctx->UNC and ctx->prepath
 * fields with the result. Returns 0 on success and an error otherwise
 * (e.g. ENOMEM or EINVAL)
 */
int
smb3_parse_devname(const char *devname, struct smb3_fs_context *ctx)
{}

static void smb3_fs_context_free(struct fs_context *fc);
static int smb3_fs_context_parse_param(struct fs_context *fc,
				       struct fs_parameter *param);
static int smb3_fs_context_parse_monolithic(struct fs_context *fc,
					    void *data);
static int smb3_get_tree(struct fs_context *fc);
static int smb3_reconfigure(struct fs_context *fc);

static const struct fs_context_operations smb3_fs_context_ops =;

/*
 * Parse a monolithic block of data from sys_mount().
 * smb3_fs_context_parse_monolithic - Parse key[=val][,key[=val]]* mount data
 * @ctx: The superblock configuration to fill in.
 * @data: The data to parse
 *
 * Parse a blob of data that's in key[=val][,key[=val]]* form.  This can be
 * called from the ->monolithic_mount_data() fs_context operation.
 *
 * Returns 0 on success or the error returned by the ->parse_option() fs_context
 * operation on failure.
 */
static int smb3_fs_context_parse_monolithic(struct fs_context *fc,
					   void *data)
{}

/*
 * Validate the preparsed information in the config.
 */
static int smb3_fs_context_validate(struct fs_context *fc)
{}

static int smb3_get_tree_common(struct fs_context *fc)
{}

/*
 * Create an SMB3 superblock from the parameters passed.
 */
static int smb3_get_tree(struct fs_context *fc)
{}

static void smb3_fs_context_free(struct fs_context *fc)
{}

/*
 * Compare the old and new proposed context during reconfigure
 * and check if the changes are compatible.
 */
static int smb3_verify_reconfigure_ctx(struct fs_context *fc,
				       struct smb3_fs_context *new_ctx,
				       struct smb3_fs_context *old_ctx, bool need_recon)
{}

#define STEAL_STRING(cifs_sb, ctx, field)

#define STEAL_STRING_SENSITIVE(cifs_sb, ctx, field)

static int smb3_reconfigure(struct fs_context *fc)
{}

static int smb3_fs_context_parse_param(struct fs_context *fc,
				      struct fs_parameter *param)
{}

int smb3_init_fs_context(struct fs_context *fc)
{}

void
smb3_cleanup_fs_context_contents(struct smb3_fs_context *ctx)
{}

void
smb3_cleanup_fs_context(struct smb3_fs_context *ctx)
{}

void smb3_update_mnt_flags(struct cifs_sb_info *cifs_sb)
{}