summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorValdis Kletnieks <valdis.kletnieks@vt.edu>2019-10-24 11:53:17 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-24 22:52:33 -0400
commitc76c4ad5470cd907ed9c432f0e8cabd924cc2b54 (patch)
tree52c02a2fb5eb25ce93d8af8778789d761a192fd5 /drivers
parentab5a321da0082f1877dab619f56b966997dbc4fb (diff)
downloadlinux-c76c4ad5470cd907ed9c432f0e8cabd924cc2b54.tar.bz2
staging: exfat: Clean up return codes - FFS_FILEEXIST
Convert FFS_FILEEXIST to -EEXIST Signed-off-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu> Link: https://lore.kernel.org/r/20191024155327.1095907-7-Valdis.Kletnieks@vt.edu Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/exfat/exfat.h1
-rw-r--r--drivers/staging/exfat/exfat_core.c2
-rw-r--r--drivers/staging/exfat/exfat_super.c14
3 files changed, 8 insertions, 9 deletions
diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
index 0c8e8606472b..b7dac748aaf9 100644
--- a/drivers/staging/exfat/exfat.h
+++ b/drivers/staging/exfat/exfat.h
@@ -216,7 +216,6 @@ static inline u16 get_row_index(u16 i)
#define FFS_SEMAPHOREERR 6
#define FFS_INVALIDPATH 7
#define FFS_INVALIDFID 8
-#define FFS_FILEEXIST 10
#define FFS_NOTOPENED 12
#define FFS_MAXOPENED 13
#define FFS_EOF 15
diff --git a/drivers/staging/exfat/exfat_core.c b/drivers/staging/exfat/exfat_core.c
index 5ac57e573764..43aaa9566260 100644
--- a/drivers/staging/exfat/exfat_core.c
+++ b/drivers/staging/exfat/exfat_core.c
@@ -2828,7 +2828,7 @@ s32 fat_generate_dos_name(struct super_block *sb, struct chain_t *p_dir,
}
if ((count == 0) || (count >= 1024))
- return FFS_FILEEXIST;
+ return -EEXIST;
fat_attach_count_to_dos_name(p_dosname->name, count);
/* Now dos_name has DOS~????.EXT */
diff --git a/drivers/staging/exfat/exfat_super.c b/drivers/staging/exfat/exfat_super.c
index cf0300a4e0f4..bc175b3366ac 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -1294,7 +1294,7 @@ static int ffsMoveFile(struct inode *old_parent_inode, struct file_id_t *fid,
new_clu.flags = new_fid->flags;
if (!is_dir_empty(sb, &new_clu)) {
- ret = FFS_FILEEXIST;
+ ret = -EEXIST;
goto out;
}
}
@@ -2162,7 +2162,7 @@ static int ffsRemoveDir(struct inode *inode, struct file_id_t *fid)
clu_to_free.flags = fid->flags;
if (!is_dir_empty(sb, &clu_to_free)) {
- ret = FFS_FILEEXIST;
+ ret = -EEXIST;
goto out;
}
@@ -2364,7 +2364,7 @@ static int exfat_create(struct inode *dir, struct dentry *dentry, umode_t mode,
if (err) {
if (err == FFS_INVALIDPATH)
err = -EINVAL;
- else if (err == FFS_FILEEXIST)
+ else if (err == -EEXIST)
err = -EEXIST;
else if (err == -ENOSPC)
err = -ENOSPC;
@@ -2575,7 +2575,7 @@ static int exfat_symlink(struct inode *dir, struct dentry *dentry,
if (err) {
if (err == FFS_INVALIDPATH)
err = -EINVAL;
- else if (err == FFS_FILEEXIST)
+ else if (err == -EEXIST)
err = -EEXIST;
else if (err == -ENOSPC)
err = -ENOSPC;
@@ -2645,7 +2645,7 @@ static int exfat_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
if (err) {
if (err == FFS_INVALIDPATH)
err = -EINVAL;
- else if (err == FFS_FILEEXIST)
+ else if (err == -EEXIST)
err = -EEXIST;
else if (err == -ENOSPC)
err = -ENOSPC;
@@ -2699,7 +2699,7 @@ static int exfat_rmdir(struct inode *dir, struct dentry *dentry)
if (err) {
if (err == FFS_INVALIDPATH)
err = -EINVAL;
- else if (err == FFS_FILEEXIST)
+ else if (err == -EEXIST)
err = -ENOTEMPTY;
else if (err == -ENOENT)
err = -ENOENT;
@@ -2756,7 +2756,7 @@ static int exfat_rename(struct inode *old_dir, struct dentry *old_dentry,
err = -EPERM;
else if (err == FFS_INVALIDPATH)
err = -EINVAL;
- else if (err == FFS_FILEEXIST)
+ else if (err == -EEXIST)
err = -EEXIST;
else if (err == -ENOENT)
err = -ENOENT;