linux/fs/fat/namei_vfat.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 *  linux/fs/vfat/namei.c
 *
 *  Written 1992,1993 by Werner Almesberger
 *
 *  Windows95/Windows NT compatible extended MSDOS filesystem
 *    by Gordon Chaffee Copyright (C) 1995.  Send bug reports for the
 *    VFAT filesystem to <[email protected]>.  Specify
 *    what file operation caused you trouble and if you can duplicate
 *    the problem, send a script that demonstrates it.
 *
 *  Short name translation 1999, 2001 by Wolfram Pienkoss <[email protected]>
 *
 *  Support Multibyte characters and cleanup by
 *				OGAWA Hirofumi <[email protected]>
 */

#include <linux/module.h>
#include <linux/ctype.h>
#include <linux/slab.h>
#include <linux/namei.h>
#include <linux/kernel.h>
#include <linux/iversion.h>
#include "fat.h"

static inline unsigned long vfat_d_version(struct dentry *dentry)
{}

static inline void vfat_d_version_set(struct dentry *dentry,
				      unsigned long version)
{}

/*
 * If new entry was created in the parent, it could create the 8.3
 * alias (the shortname of logname).  So, the parent may have the
 * negative-dentry which matches the created 8.3 alias.
 *
 * If it happened, the negative dentry isn't actually negative
 * anymore.  So, drop it.
 */
static int vfat_revalidate_shortname(struct dentry *dentry)
{}

static int vfat_revalidate(struct dentry *dentry, unsigned int flags)
{}

static int vfat_revalidate_ci(struct dentry *dentry, unsigned int flags)
{}

/* returns the length of a struct qstr, ignoring trailing dots */
static unsigned int __vfat_striptail_len(unsigned int len, const char *name)
{}

static unsigned int vfat_striptail_len(const struct qstr *qstr)
{}

/*
 * Compute the hash for the vfat name corresponding to the dentry.
 * Note: if the name is invalid, we leave the hash code unchanged so
 * that the existing dentry can be used. The vfat fs routines will
 * return ENOENT or EINVAL as appropriate.
 */
static int vfat_hash(const struct dentry *dentry, struct qstr *qstr)
{}

/*
 * Compute the hash for the vfat name corresponding to the dentry.
 * Note: if the name is invalid, we leave the hash code unchanged so
 * that the existing dentry can be used. The vfat fs routines will
 * return ENOENT or EINVAL as appropriate.
 */
static int vfat_hashi(const struct dentry *dentry, struct qstr *qstr)
{}

/*
 * Case insensitive compare of two vfat names.
 */
static int vfat_cmpi(const struct dentry *dentry,
		unsigned int len, const char *str, const struct qstr *name)
{}

/*
 * Case sensitive compare of two vfat names.
 */
static int vfat_cmp(const struct dentry *dentry,
		unsigned int len, const char *str, const struct qstr *name)
{}

static const struct dentry_operations vfat_ci_dentry_ops =;

static const struct dentry_operations vfat_dentry_ops =;

/* Characters that are undesirable in an MS-DOS file name */

static inline bool vfat_bad_char(wchar_t w)
{}

static inline bool vfat_replace_char(wchar_t w)
{}

static wchar_t vfat_skip_char(wchar_t w)
{}

static inline int vfat_is_used_badchars(const wchar_t *s, int len)
{}

static int vfat_find_form(struct inode *dir, unsigned char *name)
{}

/*
 * 1) Valid characters for the 8.3 format alias are any combination of
 * letters, uppercase alphabets, digits, any of the
 * following special characters:
 *     $ % ' ` - @ { } ~ ! # ( ) & _ ^
 * In this case Longfilename is not stored in disk.
 *
 * WinNT's Extension:
 * File name and extension name is contain uppercase/lowercase
 * only. And it is expressed by CASE_LOWER_BASE and CASE_LOWER_EXT.
 *
 * 2) File name is 8.3 format, but it contain the uppercase and
 * lowercase char, muliti bytes char, etc. In this case numtail is not
 * added, but Longfilename is stored.
 *
 * 3) When the one except for the above, or the following special
 * character are contained:
 *        .   [ ] ; , + =
 * numtail is added, and Longfilename must be stored in disk .
 */
struct shortname_info {};
#define INIT_SHORTNAME_INFO(x)

static inline int to_shortname_char(struct nls_table *nls,
				    unsigned char *buf, int buf_size,
				    wchar_t *src, struct shortname_info *info)
{}

/*
 * Given a valid longname, create a unique shortname.  Make sure the
 * shortname does not exist
 * Returns negative number on error, 0 for a normal
 * return, and 1 for valid shortname
 */
static int vfat_create_shortname(struct inode *dir, struct nls_table *nls,
				 wchar_t *uname, int ulen,
				 unsigned char *name_res, unsigned char *lcase)
{}

/* Translate a string, including coded sequences into Unicode */
static int
xlate_to_uni(const unsigned char *name, int len, unsigned char *outname,
	     int *longlen, int *outlen, int escape, int utf8,
	     struct nls_table *nls)
{}

static int vfat_build_slots(struct inode *dir, const unsigned char *name,
			    int len, int is_dir, int cluster,
			    struct timespec64 *ts,
			    struct msdos_dir_slot *slots, int *nr_slots)
{}

static int vfat_add_entry(struct inode *dir, const struct qstr *qname,
			  int is_dir, int cluster, struct timespec64 *ts,
			  struct fat_slot_info *sinfo)
{}

static int vfat_find(struct inode *dir, const struct qstr *qname,
		     struct fat_slot_info *sinfo)
{}

static struct dentry *vfat_lookup(struct inode *dir, struct dentry *dentry,
				  unsigned int flags)
{}

static int vfat_create(struct mnt_idmap *idmap, struct inode *dir,
		       struct dentry *dentry, umode_t mode, bool excl)
{}

static int vfat_rmdir(struct inode *dir, struct dentry *dentry)
{}

static int vfat_unlink(struct inode *dir, struct dentry *dentry)
{}

static int vfat_mkdir(struct mnt_idmap *idmap, struct inode *dir,
		      struct dentry *dentry, umode_t mode)
{}

static int vfat_get_dotdot_de(struct inode *inode, struct buffer_head **bh,
			      struct msdos_dir_entry **de)
{}

static int vfat_sync_ipos(struct inode *dir, struct inode *inode)
{}

static int vfat_update_dotdot_de(struct inode *dir, struct inode *inode,
				 struct buffer_head *dotdot_bh,
				 struct msdos_dir_entry *dotdot_de)
{}

static void vfat_update_dir_metadata(struct inode *dir, struct timespec64 *ts)
{}

static int vfat_rename(struct inode *old_dir, struct dentry *old_dentry,
		       struct inode *new_dir, struct dentry *new_dentry)
{}

static void vfat_exchange_ipos(struct inode *old_inode, struct inode *new_inode,
			       loff_t old_i_pos, loff_t new_i_pos)
{}

static void vfat_move_nlink(struct inode *src, struct inode *dst)
{}

static int vfat_rename_exchange(struct inode *old_dir, struct dentry *old_dentry,
				struct inode *new_dir, struct dentry *new_dentry)
{}

static int vfat_rename2(struct mnt_idmap *idmap, struct inode *old_dir,
			struct dentry *old_dentry, struct inode *new_dir,
			struct dentry *new_dentry, unsigned int flags)
{}

static const struct inode_operations vfat_dir_inode_operations =;

static void setup(struct super_block *sb)
{}

static int vfat_fill_super(struct super_block *sb, struct fs_context *fc)
{}

static int vfat_get_tree(struct fs_context *fc)
{}

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

static const struct fs_context_operations vfat_context_ops =;

static int vfat_init_fs_context(struct fs_context *fc)
{}

static struct file_system_type vfat_fs_type =;
MODULE_ALIAS_FS();

static int __init init_vfat_fs(void)
{}

static void __exit exit_vfat_fs(void)
{}

MODULE_LICENSE();
MODULE_DESCRIPTION();
MODULE_AUTHOR();

module_init()
module_exit()