Re: [PATCH v8 03/13] exfat: add inode operations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
> Signed-off-by: Sungjong Seo <sj1557.seo@xxxxxxxxxxx>
> ---
>  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@xxxxxxxxx

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux