[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191229141550.w66jnp2ayvd4bkk3@pali>
Date: Sun, 29 Dec 2019 15:15:50 +0100
From: Pali Rohár <pali.rohar@...il.com>
To: Namjae Jeon <namjae.jeon@...sung.com>
Cc: linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
gregkh@...uxfoundation.org, valdis.kletnieks@...edu, hch@....de,
sj1557.seo@...sung.com, linkinjeon@...il.com
Subject: Re: [PATCH v8 03/13] exfat: add inode operations
On Friday 20 December 2019 01:24:09 Namjae Jeon wrote:
> This adds the implementation of inode operations for exfat.
>
> Signed-off-by: Namjae Jeon <namjae.jeon@...sung.com>
> Signed-off-by: Sungjong Seo <sj1557.seo@...sung.com>
> ---
> fs/exfat/inode.c | 694 ++++++++++++++++++++++
> fs/exfat/namei.c | 1459 ++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 2153 insertions(+)
> create mode 100644 fs/exfat/inode.c
> create mode 100644 fs/exfat/namei.c
...
> diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c
> new file mode 100644
> index 000000000000..1bda97b82ef4
> --- /dev/null
> +++ b/fs/exfat/namei.c
...
> +
> +/*
> + * Name Resolution Functions :
> + * Zero if it was successful; otherwise nonzero.
> + */
> +static int __exfat_resolve_path(struct inode *inode, const unsigned char *path,
> + struct exfat_chain *p_dir, struct exfat_uni_name *p_uniname,
> + int lookup)
> +{
> + int namelen;
> + int lossy = NLS_NAME_NO_LOSSY;
> + struct super_block *sb = inode->i_sb;
> + struct exfat_sb_info *sbi = EXFAT_SB(sb);
> + struct exfat_inode_info *ei = EXFAT_I(inode);
> +
> + /* DOT and DOTDOT are handled by VFS layer */
> +
> + /* strip all trailing spaces */
> + /* DO NOTHING : Is needed? */
Hello, this comment looks like a TODO item which should be fixed.
> +
> + /* strip all trailing periods */
> + namelen = __exfat_striptail_len(strlen(path), path);
> + if (!namelen)
> + return -ENOENT;
> +
> + /* the limitation of linux? */
And this one too.
> + if (strlen(path) > (MAX_NAME_LENGTH * MAX_CHARSET_SIZE))
> + return -ENAMETOOLONG;
> +
> + /*
> + * strip all leading spaces :
> + * "MS windows 7" supports leading spaces.
> + * So we should skip this preprocessing for compatibility.
> + */
> +
> + /* file name conversion :
> + * If lookup case, we allow bad-name for compatibility.
> + */
> + namelen = exfat_nls_vfsname_to_uni16s(sb, path, namelen, p_uniname,
> + &lossy);
> + if (namelen < 0)
> + return namelen; /* return error value */
> +
> + if ((lossy && !lookup) || !namelen)
> + return -EINVAL;
> +
> + exfat_chain_set(p_dir, ei->start_clu,
> + EXFAT_B_TO_CLU(i_size_read(inode), sbi), ei->flags);
> +
> + return 0;
> +}
> +
--
Pali Rohár
pali.rohar@...il.com
Download attachment "signature.asc" of type "application/pgp-signature" (196 bytes)
Powered by blists - more mailing lists