Commit 2f2e2886 authored by Valdis Kletnieks's avatar Valdis Kletnieks Committed by Greg Kroah-Hartman

staging: exfat: Clean up return codes - FFS_FULL

Start cleaning up the odd scheme of return codes, starting with FFS_FULL
Signed-off-by: default avatarValdis Kletnieks <Valdis.Kletnieks@vt.edu>
Link: https://lore.kernel.org/r/20191024155327.1095907-2-Valdis.Kletnieks@vt.eduSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f306bde1
...@@ -221,7 +221,6 @@ static inline u16 get_row_index(u16 i) ...@@ -221,7 +221,6 @@ static inline u16 get_row_index(u16 i)
#define FFS_PERMISSIONERR 11 #define FFS_PERMISSIONERR 11
#define FFS_NOTOPENED 12 #define FFS_NOTOPENED 12
#define FFS_MAXOPENED 13 #define FFS_MAXOPENED 13
#define FFS_FULL 14
#define FFS_EOF 15 #define FFS_EOF 15
#define FFS_DIRBUSY 16 #define FFS_DIRBUSY 16
#define FFS_MEMORYERR 17 #define FFS_MEMORYERR 17
......
...@@ -3216,7 +3216,7 @@ s32 create_dir(struct inode *inode, struct chain_t *p_dir, ...@@ -3216,7 +3216,7 @@ s32 create_dir(struct inode *inode, struct chain_t *p_dir,
/* find_empty_entry must be called before alloc_cluster */ /* find_empty_entry must be called before alloc_cluster */
dentry = find_empty_entry(inode, p_dir, num_entries); dentry = find_empty_entry(inode, p_dir, num_entries);
if (dentry < 0) if (dentry < 0)
return FFS_FULL; return -ENOSPC;
clu.dir = CLUSTER_32(~0); clu.dir = CLUSTER_32(~0);
clu.size = 0; clu.size = 0;
...@@ -3227,7 +3227,7 @@ s32 create_dir(struct inode *inode, struct chain_t *p_dir, ...@@ -3227,7 +3227,7 @@ s32 create_dir(struct inode *inode, struct chain_t *p_dir,
if (ret < 0) if (ret < 0)
return FFS_MEDIAERR; return FFS_MEDIAERR;
else if (ret == 0) else if (ret == 0)
return FFS_FULL; return -ENOSPC;
ret = clear_cluster(sb, clu.dir); ret = clear_cluster(sb, clu.dir);
if (ret != FFS_SUCCESS) if (ret != FFS_SUCCESS)
...@@ -3319,7 +3319,7 @@ s32 create_file(struct inode *inode, struct chain_t *p_dir, ...@@ -3319,7 +3319,7 @@ s32 create_file(struct inode *inode, struct chain_t *p_dir,
/* find_empty_entry must be called before alloc_cluster() */ /* find_empty_entry must be called before alloc_cluster() */
dentry = find_empty_entry(inode, p_dir, num_entries); dentry = find_empty_entry(inode, p_dir, num_entries);
if (dentry < 0) if (dentry < 0)
return FFS_FULL; return -ENOSPC;
/* (1) update the directory entry */ /* (1) update the directory entry */
/* fill the dos name directory entry information of the created file. /* fill the dos name directory entry information of the created file.
...@@ -3418,7 +3418,7 @@ s32 rename_file(struct inode *inode, struct chain_t *p_dir, s32 oldentry, ...@@ -3418,7 +3418,7 @@ s32 rename_file(struct inode *inode, struct chain_t *p_dir, s32 oldentry,
newentry = find_empty_entry(inode, p_dir, num_new_entries); newentry = find_empty_entry(inode, p_dir, num_new_entries);
if (newentry < 0) { if (newentry < 0) {
buf_unlock(sb, sector_old); buf_unlock(sb, sector_old);
return FFS_FULL; return -ENOSPC;
} }
epnew = get_entry_in_dir(sb, p_dir, newentry, &sector_new); epnew = get_entry_in_dir(sb, p_dir, newentry, &sector_new);
...@@ -3529,7 +3529,7 @@ s32 move_file(struct inode *inode, struct chain_t *p_olddir, s32 oldentry, ...@@ -3529,7 +3529,7 @@ s32 move_file(struct inode *inode, struct chain_t *p_olddir, s32 oldentry,
newentry = find_empty_entry(inode, p_newdir, num_new_entries); newentry = find_empty_entry(inode, p_newdir, num_new_entries);
if (newentry < 0) { if (newentry < 0) {
buf_unlock(sb, sector_mov); buf_unlock(sb, sector_mov);
return FFS_FULL; return -ENOSPC;
} }
epnew = get_entry_in_dir(sb, p_newdir, newentry, &sector_new); epnew = get_entry_in_dir(sb, p_newdir, newentry, &sector_new);
......
...@@ -1051,7 +1051,7 @@ static int ffsWriteFile(struct inode *inode, struct file_id_t *fid, ...@@ -1051,7 +1051,7 @@ static int ffsWriteFile(struct inode *inode, struct file_id_t *fid,
*wcount = write_bytes; *wcount = write_bytes;
if (num_alloced == 0) if (num_alloced == 0)
ret = FFS_FULL; ret = -ENOSPC;
else if (p_fs->dev_ejected) else if (p_fs->dev_ejected)
ret = FFS_MEDIAERR; ret = FFS_MEDIAERR;
...@@ -1807,7 +1807,7 @@ static int ffsMapCluster(struct inode *inode, s32 clu_offset, u32 *clu) ...@@ -1807,7 +1807,7 @@ static int ffsMapCluster(struct inode *inode, s32 clu_offset, u32 *clu)
ret = FFS_MEDIAERR; ret = FFS_MEDIAERR;
goto out; goto out;
} else if (num_alloced == 0) { } else if (num_alloced == 0) {
ret = FFS_FULL; ret = -ENOSPC;
goto out; goto out;
} }
...@@ -2366,7 +2366,7 @@ static int exfat_create(struct inode *dir, struct dentry *dentry, umode_t mode, ...@@ -2366,7 +2366,7 @@ static int exfat_create(struct inode *dir, struct dentry *dentry, umode_t mode,
err = -EINVAL; err = -EINVAL;
else if (err == FFS_FILEEXIST) else if (err == FFS_FILEEXIST)
err = -EEXIST; err = -EEXIST;
else if (err == FFS_FULL) else if (err == -ENOSPC)
err = -ENOSPC; err = -ENOSPC;
else if (err == FFS_NAMETOOLONG) else if (err == FFS_NAMETOOLONG)
err = -ENAMETOOLONG; err = -ENAMETOOLONG;
...@@ -2577,7 +2577,7 @@ static int exfat_symlink(struct inode *dir, struct dentry *dentry, ...@@ -2577,7 +2577,7 @@ static int exfat_symlink(struct inode *dir, struct dentry *dentry,
err = -EINVAL; err = -EINVAL;
else if (err == FFS_FILEEXIST) else if (err == FFS_FILEEXIST)
err = -EEXIST; err = -EEXIST;
else if (err == FFS_FULL) else if (err == -ENOSPC)
err = -ENOSPC; err = -ENOSPC;
else else
err = -EIO; err = -EIO;
...@@ -2589,7 +2589,7 @@ static int exfat_symlink(struct inode *dir, struct dentry *dentry, ...@@ -2589,7 +2589,7 @@ static int exfat_symlink(struct inode *dir, struct dentry *dentry,
if (err) { if (err) {
ffsRemoveFile(dir, &fid); ffsRemoveFile(dir, &fid);
if (err == FFS_FULL) if (err == -ENOSPC)
err = -ENOSPC; err = -ENOSPC;
else else
err = -EIO; err = -EIO;
...@@ -2647,7 +2647,7 @@ static int exfat_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) ...@@ -2647,7 +2647,7 @@ static int exfat_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
err = -EINVAL; err = -EINVAL;
else if (err == FFS_FILEEXIST) else if (err == FFS_FILEEXIST)
err = -EEXIST; err = -EEXIST;
else if (err == FFS_FULL) else if (err == -ENOSPC)
err = -ENOSPC; err = -ENOSPC;
else if (err == FFS_NAMETOOLONG) else if (err == FFS_NAMETOOLONG)
err = -ENAMETOOLONG; err = -ENAMETOOLONG;
...@@ -2760,7 +2760,7 @@ static int exfat_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -2760,7 +2760,7 @@ static int exfat_rename(struct inode *old_dir, struct dentry *old_dentry,
err = -EEXIST; err = -EEXIST;
else if (err == FFS_NOTFOUND) else if (err == FFS_NOTFOUND)
err = -ENOENT; err = -ENOENT;
else if (err == FFS_FULL) else if (err == -ENOSPC)
err = -ENOSPC; err = -ENOSPC;
else else
err = -EIO; err = -EIO;
...@@ -3115,7 +3115,7 @@ static int exfat_bmap(struct inode *inode, sector_t sector, sector_t *phys, ...@@ -3115,7 +3115,7 @@ static int exfat_bmap(struct inode *inode, sector_t sector, sector_t *phys,
err = ffsMapCluster(inode, clu_offset, &cluster); err = ffsMapCluster(inode, clu_offset, &cluster);
if (err) { if (err) {
if (err == FFS_FULL) if (err == -ENOSPC)
return -ENOSPC; return -ENOSPC;
else else
return -EIO; return -EIO;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment