diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h index b7dac748aaf9..8cb6d2e2ad8d 100644 --- a/drivers/staging/exfat/exfat.h +++ b/drivers/staging/exfat/exfat.h @@ -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 diff --git a/drivers/staging/exfat/exfat_core.c b/drivers/staging/exfat/exfat_core.c index 43aaa9566260..0331fa6724ff 100644 --- a/drivers/staging/exfat/exfat_core.c +++ b/drivers/staging/exfat/exfat_core.c @@ -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); diff --git a/drivers/staging/exfat/exfat_super.c b/drivers/staging/exfat/exfat_super.c index bc175b3366ac..dcf90b5f147b 100644 --- a/drivers/staging/exfat/exfat_super.c +++ b/drivers/staging/exfat/exfat_super.c @@ -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;