aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/exfat
diff options
context:
space:
mode:
authorValdis Kletnieks <valdis.kletnieks@vt.edu>2019-10-24 11:53:18 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-24 22:53:20 -0400
commit03eac8d594738fc6a678a4df2176d17f9ee130f4 (patch)
tree3d6d3f9d221007f8320ad22618605b038045d5a5 /drivers/staging/exfat
parentc76c4ad5470cd907ed9c432f0e8cabd924cc2b54 (diff)
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>
Diffstat (limited to 'drivers/staging/exfat')
-rw-r--r--drivers/staging/exfat/exfat.h1
-rw-r--r--drivers/staging/exfat/exfat_core.c10
-rw-r--r--drivers/staging/exfat/exfat_super.c10
3 files changed, 10 insertions, 11 deletions
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;