staging: exfat: Clean up return codes - FFS_INVALIDPATH

Convert FFS_INVALIDPATH to -EINVAL

Signed-off-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Link: https://lore.kernel.org/r/20191024155327.1095907-8-Valdis.Kletnieks@vt.edu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Valdis Kletnieks 2019-10-24 11:53:18 -04:00 committed by Greg Kroah-Hartman
parent c76c4ad547
commit 03eac8d594
3 changed files with 10 additions and 11 deletions

View File

@ -214,7 +214,6 @@ static inline u16 get_row_index(u16 i)
#define FFS_NOTMOUNTED 4
#define FFS_ALIGNMENTERR 5
#define FFS_SEMAPHOREERR 6
#define FFS_INVALIDPATH 7
#define FFS_INVALIDFID 8
#define FFS_NOTOPENED 12
#define FFS_MAXOPENED 13

View File

@ -2571,7 +2571,7 @@ s32 get_num_entries_and_dos_name(struct super_block *sb, struct chain_t *p_dir,
num_entries = p_fs->fs_func->calc_num_entries(p_uniname);
if (num_entries == 0)
return FFS_INVALIDPATH;
return -EINVAL;
if (p_fs->vol_type != EXFAT) {
nls_uniname_to_dosname(sb, p_dosname, p_uniname, &lossy);
@ -2583,7 +2583,7 @@ s32 get_num_entries_and_dos_name(struct super_block *sb, struct chain_t *p_dir,
} else {
for (r = reserved_names; *r; r++) {
if (!strncmp((void *)p_dosname->name, *r, 8))
return FFS_INVALIDPATH;
return -EINVAL;
}
if (p_dosname->name_case != 0xFF)
@ -2962,11 +2962,11 @@ s32 resolve_path(struct inode *inode, char *path, struct chain_t *p_dir,
struct file_id_t *fid = &(EXFAT_I(inode)->fid);
if (strscpy(name_buf, path, sizeof(name_buf)) < 0)
return FFS_INVALIDPATH;
return -EINVAL;
nls_cstring_to_uniname(sb, p_uniname, name_buf, &lossy);
if (lossy)
return FFS_INVALIDPATH;
return -EINVAL;
fid->size = i_size_read(inode);
@ -3506,7 +3506,7 @@ s32 move_file(struct inode *inode, struct chain_t *p_olddir, s32 oldentry,
/* check if the source and target directory is the same */
if (fs_func->get_entry_type(epmov) == TYPE_DIR &&
fs_func->get_entry_clu0(epmov) == p_newdir->dir)
return FFS_INVALIDPATH;
return -EINVAL;
buf_lock(sb, sector_mov);

View File

@ -2362,7 +2362,7 @@ static int exfat_create(struct inode *dir, struct dentry *dentry, umode_t mode,
err = ffsCreateFile(dir, (u8 *)dentry->d_name.name, FM_REGULAR, &fid);
if (err) {
if (err == FFS_INVALIDPATH)
if (err == -EINVAL)
err = -EINVAL;
else if (err == -EEXIST)
err = -EEXIST;
@ -2573,7 +2573,7 @@ static int exfat_symlink(struct inode *dir, struct dentry *dentry,
err = ffsCreateFile(dir, (u8 *)dentry->d_name.name, FM_SYMLINK, &fid);
if (err) {
if (err == FFS_INVALIDPATH)
if (err == -EINVAL)
err = -EINVAL;
else if (err == -EEXIST)
err = -EEXIST;
@ -2643,7 +2643,7 @@ static int exfat_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
err = ffsCreateDir(dir, (u8 *)dentry->d_name.name, &fid);
if (err) {
if (err == FFS_INVALIDPATH)
if (err == -EINVAL)
err = -EINVAL;
else if (err == -EEXIST)
err = -EEXIST;
@ -2697,7 +2697,7 @@ static int exfat_rmdir(struct inode *dir, struct dentry *dentry)
err = ffsRemoveDir(dir, &(EXFAT_I(inode)->fid));
if (err) {
if (err == FFS_INVALIDPATH)
if (err == -EINVAL)
err = -EINVAL;
else if (err == -EEXIST)
err = -ENOTEMPTY;
@ -2754,7 +2754,7 @@ static int exfat_rename(struct inode *old_dir, struct dentry *old_dentry,
if (err) {
if (err == -EPERM)
err = -EPERM;
else if (err == FFS_INVALIDPATH)
else if (err == -EINVAL)
err = -EINVAL;
else if (err == -EEXIST)
err = -EEXIST;