Commit 65b88d81 authored by Valdis Kletnieks's avatar Valdis Kletnieks Committed by Greg Kroah-Hartman

staging: exfat: Clean up the namespace pollution part 8

Rename all the FAT_* functions to exfat_fat_*.
Signed-off-by: default avatarValdis Kletnieks <Valdis.Kletnieks@vt.edu>
Link: https://lore.kernel.org/r/20191112211238.156490-13-Valdis.Kletnieks@vt.eduSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 99a4b135
...@@ -739,12 +739,12 @@ void nls_cstring_to_uniname(struct super_block *sb, ...@@ -739,12 +739,12 @@ void nls_cstring_to_uniname(struct super_block *sb,
/* buffer cache management */ /* buffer cache management */
void exfat_buf_init(struct super_block *sb); void exfat_buf_init(struct super_block *sb);
void exfat_buf_shutdown(struct super_block *sb); void exfat_buf_shutdown(struct super_block *sb);
int FAT_read(struct super_block *sb, u32 loc, u32 *content); int exfat_fat_read(struct super_block *sb, u32 loc, u32 *content);
s32 FAT_write(struct super_block *sb, u32 loc, u32 content); s32 exfat_fat_write(struct super_block *sb, u32 loc, u32 content);
u8 *FAT_getblk(struct super_block *sb, sector_t sec); u8 *exfat_fat_getblk(struct super_block *sb, sector_t sec);
void FAT_modify(struct super_block *sb, sector_t sec); void exfat_fat_modify(struct super_block *sb, sector_t sec);
void FAT_release_all(struct super_block *sb); void exfat_fat_release_all(struct super_block *sb);
void FAT_sync(struct super_block *sb); void exfat_fat_sync(struct super_block *sb);
u8 *exfat_buf_getblk(struct super_block *sb, sector_t sec); u8 *exfat_buf_getblk(struct super_block *sb, sector_t sec);
void exfat_buf_modify(struct super_block *sb, sector_t sec); void exfat_buf_modify(struct super_block *sb, sector_t sec);
void exfat_buf_lock(struct super_block *sb, sector_t sec); void exfat_buf_lock(struct super_block *sb, sector_t sec);
......
...@@ -193,7 +193,7 @@ void exfat_buf_shutdown(struct super_block *sb) ...@@ -193,7 +193,7 @@ void exfat_buf_shutdown(struct super_block *sb)
{ {
} }
static int __FAT_read(struct super_block *sb, u32 loc, u32 *content) static int __exfat_fat_read(struct super_block *sb, u32 loc, u32 *content)
{ {
s32 off; s32 off;
u32 _content; u32 _content;
...@@ -206,7 +206,7 @@ static int __FAT_read(struct super_block *sb, u32 loc, u32 *content) ...@@ -206,7 +206,7 @@ static int __FAT_read(struct super_block *sb, u32 loc, u32 *content)
(loc >> (p_bd->sector_size_bits - 2)); (loc >> (p_bd->sector_size_bits - 2));
off = (loc << 2) & p_bd->sector_size_mask; off = (loc << 2) & p_bd->sector_size_mask;
fat_sector = FAT_getblk(sb, sec); fat_sector = exfat_fat_getblk(sb, sec);
if (!fat_sector) if (!fat_sector)
return -1; return -1;
...@@ -226,18 +226,18 @@ static int __FAT_read(struct super_block *sb, u32 loc, u32 *content) ...@@ -226,18 +226,18 @@ static int __FAT_read(struct super_block *sb, u32 loc, u32 *content)
* returns 0 on success * returns 0 on success
* -1 on error * -1 on error
*/ */
int FAT_read(struct super_block *sb, u32 loc, u32 *content) int exfat_fat_read(struct super_block *sb, u32 loc, u32 *content)
{ {
s32 ret; s32 ret;
mutex_lock(&f_mutex); mutex_lock(&f_mutex);
ret = __FAT_read(sb, loc, content); ret = __exfat_fat_read(sb, loc, content);
mutex_unlock(&f_mutex); mutex_unlock(&f_mutex);
return ret; return ret;
} }
static s32 __FAT_write(struct super_block *sb, u32 loc, u32 content) static s32 __exfat_fat_write(struct super_block *sb, u32 loc, u32 content)
{ {
s32 off; s32 off;
sector_t sec; sector_t sec;
...@@ -249,7 +249,7 @@ static s32 __FAT_write(struct super_block *sb, u32 loc, u32 content) ...@@ -249,7 +249,7 @@ static s32 __FAT_write(struct super_block *sb, u32 loc, u32 content)
(p_bd->sector_size_bits - 2)); (p_bd->sector_size_bits - 2));
off = (loc << 2) & p_bd->sector_size_mask; off = (loc << 2) & p_bd->sector_size_mask;
fat_sector = FAT_getblk(sb, sec); fat_sector = exfat_fat_getblk(sb, sec);
if (!fat_sector) if (!fat_sector)
return -1; return -1;
...@@ -257,22 +257,22 @@ static s32 __FAT_write(struct super_block *sb, u32 loc, u32 content) ...@@ -257,22 +257,22 @@ static s32 __FAT_write(struct super_block *sb, u32 loc, u32 content)
SET32_A(fat_entry, content); SET32_A(fat_entry, content);
FAT_modify(sb, sec); exfat_fat_modify(sb, sec);
return 0; return 0;
} }
int FAT_write(struct super_block *sb, u32 loc, u32 content) int exfat_fat_write(struct super_block *sb, u32 loc, u32 content)
{ {
s32 ret; s32 ret;
mutex_lock(&f_mutex); mutex_lock(&f_mutex);
ret = __FAT_write(sb, loc, content); ret = __exfat_fat_write(sb, loc, content);
mutex_unlock(&f_mutex); mutex_unlock(&f_mutex);
return ret; return ret;
} }
u8 *FAT_getblk(struct super_block *sb, sector_t sec) u8 *exfat_fat_getblk(struct super_block *sb, sector_t sec)
{ {
struct buf_cache_t *bp; struct buf_cache_t *bp;
struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info); struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info);
...@@ -307,7 +307,7 @@ u8 *FAT_getblk(struct super_block *sb, sector_t sec) ...@@ -307,7 +307,7 @@ u8 *FAT_getblk(struct super_block *sb, sector_t sec)
return bp->buf_bh->b_data; return bp->buf_bh->b_data;
} }
void FAT_modify(struct super_block *sb, sector_t sec) void exfat_fat_modify(struct super_block *sb, sector_t sec)
{ {
struct buf_cache_t *bp; struct buf_cache_t *bp;
...@@ -316,7 +316,7 @@ void FAT_modify(struct super_block *sb, sector_t sec) ...@@ -316,7 +316,7 @@ void FAT_modify(struct super_block *sb, sector_t sec)
sector_write(sb, sec, bp->buf_bh, 0); sector_write(sb, sec, bp->buf_bh, 0);
} }
void FAT_release_all(struct super_block *sb) void exfat_fat_release_all(struct super_block *sb)
{ {
struct buf_cache_t *bp; struct buf_cache_t *bp;
struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info); struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info);
...@@ -341,7 +341,7 @@ void FAT_release_all(struct super_block *sb) ...@@ -341,7 +341,7 @@ void FAT_release_all(struct super_block *sb)
mutex_unlock(&f_mutex); mutex_unlock(&f_mutex);
} }
void FAT_sync(struct super_block *sb) void exfat_fat_sync(struct super_block *sb)
{ {
struct buf_cache_t *bp; struct buf_cache_t *bp;
struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info); struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info);
......
...@@ -283,7 +283,7 @@ static s32 exfat_alloc_cluster(struct super_block *sb, s32 num_alloc, ...@@ -283,7 +283,7 @@ static s32 exfat_alloc_cluster(struct super_block *sb, s32 num_alloc,
num_clusters++; num_clusters++;
if (p_chain->flags == 0x01) { if (p_chain->flags == 0x01) {
if (FAT_write(sb, new_clu, CLUSTER_32(~0)) < 0) if (exfat_fat_write(sb, new_clu, CLUSTER_32(~0)) < 0)
return -EIO; return -EIO;
} }
...@@ -291,7 +291,7 @@ static s32 exfat_alloc_cluster(struct super_block *sb, s32 num_alloc, ...@@ -291,7 +291,7 @@ static s32 exfat_alloc_cluster(struct super_block *sb, s32 num_alloc,
p_chain->dir = new_clu; p_chain->dir = new_clu;
} else { } else {
if (p_chain->flags == 0x01) { if (p_chain->flags == 0x01) {
if (FAT_write(sb, last_clu, new_clu) < 0) if (exfat_fat_write(sb, last_clu, new_clu) < 0)
return -EIO; return -EIO;
} }
} }
...@@ -375,7 +375,7 @@ static void exfat_free_cluster(struct super_block *sb, struct chain_t *p_chain, ...@@ -375,7 +375,7 @@ static void exfat_free_cluster(struct super_block *sb, struct chain_t *p_chain,
if (clr_alloc_bitmap(sb, clu - 2) != 0) if (clr_alloc_bitmap(sb, clu - 2) != 0)
break; break;
if (FAT_read(sb, clu, &clu) == -1) if (exfat_fat_read(sb, clu, &clu) == -1)
break; break;
num_clusters++; num_clusters++;
} while ((clu != CLUSTER_32(0)) && (clu != CLUSTER_32(~0))); } while ((clu != CLUSTER_32(0)) && (clu != CLUSTER_32(~0)));
...@@ -395,7 +395,7 @@ static u32 find_last_cluster(struct super_block *sb, struct chain_t *p_chain) ...@@ -395,7 +395,7 @@ static u32 find_last_cluster(struct super_block *sb, struct chain_t *p_chain)
if (p_chain->flags == 0x03) { if (p_chain->flags == 0x03) {
clu += p_chain->size - 1; clu += p_chain->size - 1;
} else { } else {
while ((FAT_read(sb, clu, &next) == 0) && while ((exfat_fat_read(sb, clu, &next) == 0) &&
(next != CLUSTER_32(~0))) { (next != CLUSTER_32(~0))) {
if (p_fs->dev_ejected) if (p_fs->dev_ejected)
break; break;
...@@ -422,7 +422,7 @@ s32 count_num_clusters(struct super_block *sb, struct chain_t *p_chain) ...@@ -422,7 +422,7 @@ s32 count_num_clusters(struct super_block *sb, struct chain_t *p_chain)
} else { } else {
for (i = 2; i < p_fs->num_clusters; i++) { for (i = 2; i < p_fs->num_clusters; i++) {
count++; count++;
if (FAT_read(sb, clu, &clu) != 0) if (exfat_fat_read(sb, clu, &clu) != 0)
return 0; return 0;
if (clu == CLUSTER_32(~0)) if (clu == CLUSTER_32(~0))
break; break;
...@@ -461,12 +461,12 @@ void exfat_chain_cont_cluster(struct super_block *sb, u32 chain, s32 len) ...@@ -461,12 +461,12 @@ void exfat_chain_cont_cluster(struct super_block *sb, u32 chain, s32 len)
return; return;
while (len > 1) { while (len > 1) {
if (FAT_write(sb, chain, chain + 1) < 0) if (exfat_fat_write(sb, chain, chain + 1) < 0)
break; break;
chain++; chain++;
len--; len--;
} }
FAT_write(sb, chain, CLUSTER_32(~0)); exfat_fat_write(sb, chain, CLUSTER_32(~0));
} }
/* /*
...@@ -538,7 +538,7 @@ s32 load_alloc_bitmap(struct super_block *sb) ...@@ -538,7 +538,7 @@ s32 load_alloc_bitmap(struct super_block *sb)
} }
} }
if (FAT_read(sb, clu.dir, &clu.dir) != 0) if (exfat_fat_read(sb, clu.dir, &clu.dir) != 0)
return -EIO; return -EIO;
} }
...@@ -760,7 +760,7 @@ s32 load_upcase_table(struct super_block *sb) ...@@ -760,7 +760,7 @@ s32 load_upcase_table(struct super_block *sb)
break; break;
return 0; return 0;
} }
if (FAT_read(sb, clu.dir, &clu.dir) != 0) if (exfat_fat_read(sb, clu.dir, &clu.dir) != 0)
return -EIO; return -EIO;
} }
/* load default upcase table */ /* load default upcase table */
...@@ -1180,7 +1180,7 @@ static s32 __write_partial_entries_in_entry_set(struct super_block *sb, ...@@ -1180,7 +1180,7 @@ static s32 __write_partial_entries_in_entry_set(struct super_block *sb,
if (es->alloc_flag == 0x03) { if (es->alloc_flag == 0x03) {
clu++; clu++;
} else { } else {
if (FAT_read(sb, clu, &clu) == -1) if (exfat_fat_read(sb, clu, &clu) == -1)
goto err_out; goto err_out;
} }
sec = START_SECTOR(clu); sec = START_SECTOR(clu);
...@@ -1242,7 +1242,7 @@ static s32 _walk_fat_chain(struct super_block *sb, struct chain_t *p_dir, ...@@ -1242,7 +1242,7 @@ static s32 _walk_fat_chain(struct super_block *sb, struct chain_t *p_dir,
cur_clu += clu_offset; cur_clu += clu_offset;
} else { } else {
while (clu_offset > 0) { while (clu_offset > 0) {
if (FAT_read(sb, cur_clu, &cur_clu) == -1) if (exfat_fat_read(sb, cur_clu, &cur_clu) == -1)
return -EIO; return -EIO;
clu_offset--; clu_offset--;
} }
...@@ -1450,7 +1450,7 @@ struct entry_set_cache_t *get_entry_set_in_dir(struct super_block *sb, ...@@ -1450,7 +1450,7 @@ struct entry_set_cache_t *get_entry_set_in_dir(struct super_block *sb,
if (es->alloc_flag == 0x03) { if (es->alloc_flag == 0x03) {
clu++; clu++;
} else { } else {
if (FAT_read(sb, clu, &clu) == -1) if (exfat_fat_read(sb, clu, &clu) == -1)
goto err_out; goto err_out;
} }
sec = START_SECTOR(clu); sec = START_SECTOR(clu);
...@@ -1575,7 +1575,7 @@ static s32 search_deleted_or_unused_entry(struct super_block *sb, ...@@ -1575,7 +1575,7 @@ static s32 search_deleted_or_unused_entry(struct super_block *sb,
else else
clu.dir = CLUSTER_32(~0); clu.dir = CLUSTER_32(~0);
} else { } else {
if (FAT_read(sb, clu.dir, &clu.dir) != 0) if (exfat_fat_read(sb, clu.dir, &clu.dir) != 0)
return -1; return -1;
} }
} }
...@@ -1625,7 +1625,7 @@ static s32 find_empty_entry(struct inode *inode, struct chain_t *p_dir, s32 num_ ...@@ -1625,7 +1625,7 @@ static s32 find_empty_entry(struct inode *inode, struct chain_t *p_dir, s32 num_
p_fs->hint_uentry.clu.flags = 0x01; p_fs->hint_uentry.clu.flags = 0x01;
} }
if (clu.flags == 0x01) if (clu.flags == 0x01)
if (FAT_write(sb, last_clu, clu.dir) < 0) if (exfat_fat_write(sb, last_clu, clu.dir) < 0)
return -EIO; return -EIO;
if (p_fs->hint_uentry.entry == -1) { if (p_fs->hint_uentry.entry == -1) {
...@@ -1822,7 +1822,7 @@ static s32 exfat_find_dir_entry(struct super_block *sb, struct chain_t *p_dir, ...@@ -1822,7 +1822,7 @@ static s32 exfat_find_dir_entry(struct super_block *sb, struct chain_t *p_dir,
else else
clu.dir = CLUSTER_32(~0); clu.dir = CLUSTER_32(~0);
} else { } else {
if (FAT_read(sb, clu.dir, &clu.dir) != 0) if (exfat_fat_read(sb, clu.dir, &clu.dir) != 0)
return -2; return -2;
} }
} }
...@@ -1903,7 +1903,7 @@ s32 count_dos_name_entries(struct super_block *sb, struct chain_t *p_dir, ...@@ -1903,7 +1903,7 @@ s32 count_dos_name_entries(struct super_block *sb, struct chain_t *p_dir,
else else
clu.dir = CLUSTER_32(~0); clu.dir = CLUSTER_32(~0);
} else { } else {
if (FAT_read(sb, clu.dir, &clu.dir) != 0) if (exfat_fat_read(sb, clu.dir, &clu.dir) != 0)
return -EIO; return -EIO;
} }
} }
...@@ -1963,7 +1963,7 @@ bool is_dir_empty(struct super_block *sb, struct chain_t *p_dir) ...@@ -1963,7 +1963,7 @@ bool is_dir_empty(struct super_block *sb, struct chain_t *p_dir)
else else
clu.dir = CLUSTER_32(~0); clu.dir = CLUSTER_32(~0);
} }
if (FAT_read(sb, clu.dir, &clu.dir) != 0) if (exfat_fat_read(sb, clu.dir, &clu.dir) != 0)
break; break;
} }
......
...@@ -457,7 +457,7 @@ static int ffsUmountVol(struct super_block *sb) ...@@ -457,7 +457,7 @@ static int ffsUmountVol(struct super_block *sb)
free_upcase_table(sb); free_upcase_table(sb);
free_alloc_bitmap(sb); free_alloc_bitmap(sb);
FAT_release_all(sb); exfat_fat_release_all(sb);
exfat_buf_release_all(sb); exfat_buf_release_all(sb);
/* close the block device */ /* close the block device */
...@@ -722,8 +722,8 @@ static int ffsReadFile(struct inode *inode, struct file_id_t *fid, void *buffer, ...@@ -722,8 +722,8 @@ static int ffsReadFile(struct inode *inode, struct file_id_t *fid, void *buffer,
} }
while (clu_offset > 0) { while (clu_offset > 0) {
/* clu = FAT_read(sb, clu); */ /* clu = exfat_fat_read(sb, clu); */
if (FAT_read(sb, clu, &clu) == -1) { if (exfat_fat_read(sb, clu, &clu) == -1) {
ret = -EIO; ret = -EIO;
goto out; goto out;
} }
...@@ -868,8 +868,8 @@ static int ffsWriteFile(struct inode *inode, struct file_id_t *fid, ...@@ -868,8 +868,8 @@ static int ffsWriteFile(struct inode *inode, struct file_id_t *fid,
while ((clu_offset > 0) && (clu != CLUSTER_32(~0))) { while ((clu_offset > 0) && (clu != CLUSTER_32(~0))) {
last_clu = clu; last_clu = clu;
/* clu = FAT_read(sb, clu); */ /* clu = exfat_fat_read(sb, clu); */
if (FAT_read(sb, clu, &clu) == -1) { if (exfat_fat_read(sb, clu, &clu) == -1) {
ret = -EIO; ret = -EIO;
goto out; goto out;
} }
...@@ -911,7 +911,7 @@ static int ffsWriteFile(struct inode *inode, struct file_id_t *fid, ...@@ -911,7 +911,7 @@ static int ffsWriteFile(struct inode *inode, struct file_id_t *fid,
modified = true; modified = true;
} }
if (new_clu.flags == 0x01) if (new_clu.flags == 0x01)
FAT_write(sb, last_clu, new_clu.dir); exfat_fat_write(sb, last_clu, new_clu.dir);
} }
num_clusters += num_alloced; num_clusters += num_alloced;
...@@ -1081,7 +1081,7 @@ static int ffsTruncateFile(struct inode *inode, u64 old_size, u64 new_size) ...@@ -1081,7 +1081,7 @@ static int ffsTruncateFile(struct inode *inode, u64 old_size, u64 new_size)
} else { } else {
while (num_clusters > 0) { while (num_clusters > 0) {
last_clu = clu.dir; last_clu = clu.dir;
if (FAT_read(sb, clu.dir, &clu.dir) == -1) { if (exfat_fat_read(sb, clu.dir, &clu.dir) == -1) {
ret = -EIO; ret = -EIO;
goto out; goto out;
} }
...@@ -1123,7 +1123,7 @@ static int ffsTruncateFile(struct inode *inode, u64 old_size, u64 new_size) ...@@ -1123,7 +1123,7 @@ static int ffsTruncateFile(struct inode *inode, u64 old_size, u64 new_size)
/* (2) cut off from the FAT chain */ /* (2) cut off from the FAT chain */
if (last_clu != CLUSTER_32(0)) { if (last_clu != CLUSTER_32(0)) {
if (fid->flags == 0x01) if (fid->flags == 0x01)
FAT_write(sb, last_clu, CLUSTER_32(~0)); exfat_fat_write(sb, last_clu, CLUSTER_32(~0));
} }
/* (3) free the clusters */ /* (3) free the clusters */
...@@ -1687,7 +1687,7 @@ static int ffsMapCluster(struct inode *inode, s32 clu_offset, u32 *clu) ...@@ -1687,7 +1687,7 @@ static int ffsMapCluster(struct inode *inode, s32 clu_offset, u32 *clu)
while ((clu_offset > 0) && (*clu != CLUSTER_32(~0))) { while ((clu_offset > 0) && (*clu != CLUSTER_32(~0))) {
last_clu = *clu; last_clu = *clu;
if (FAT_read(sb, *clu, clu) == -1) { if (exfat_fat_read(sb, *clu, clu) == -1) {
ret = -EIO; ret = -EIO;
goto out; goto out;
} }
...@@ -1727,7 +1727,7 @@ static int ffsMapCluster(struct inode *inode, s32 clu_offset, u32 *clu) ...@@ -1727,7 +1727,7 @@ static int ffsMapCluster(struct inode *inode, s32 clu_offset, u32 *clu)
modified = true; modified = true;
} }
if (new_clu.flags == 0x01) if (new_clu.flags == 0x01)
FAT_write(sb, last_clu, new_clu.dir); exfat_fat_write(sb, last_clu, new_clu.dir);
} }
num_clusters += num_alloced; num_clusters += num_alloced;
...@@ -1888,8 +1888,8 @@ static int ffsReadDir(struct inode *inode, struct dir_entry_t *dir_entry) ...@@ -1888,8 +1888,8 @@ static int ffsReadDir(struct inode *inode, struct dir_entry_t *dir_entry)
} }
while (clu_offset > 0) { while (clu_offset > 0) {
/* clu.dir = FAT_read(sb, clu.dir); */ /* clu.dir = exfat_fat_read(sb, clu.dir); */
if (FAT_read(sb, clu.dir, &clu.dir) == -1) { if (exfat_fat_read(sb, clu.dir, &clu.dir) == -1) {
ret = -EIO; ret = -EIO;
goto out; goto out;
} }
...@@ -1983,8 +1983,8 @@ static int ffsReadDir(struct inode *inode, struct dir_entry_t *dir_entry) ...@@ -1983,8 +1983,8 @@ static int ffsReadDir(struct inode *inode, struct dir_entry_t *dir_entry)
else else
clu.dir = CLUSTER_32(~0); clu.dir = CLUSTER_32(~0);
} else { } else {
/* clu.dir = FAT_read(sb, clu.dir); */ /* clu.dir = exfat_fat_read(sb, clu.dir); */
if (FAT_read(sb, clu.dir, &clu.dir) == -1) { if (exfat_fat_read(sb, clu.dir, &clu.dir) == -1) {
ret = -EIO; ret = -EIO;
goto out; goto out;
} }
...@@ -3821,7 +3821,7 @@ static void exfat_debug_kill_sb(struct super_block *sb) ...@@ -3821,7 +3821,7 @@ static void exfat_debug_kill_sb(struct super_block *sb)
* dirty. We use this to simulate device removal. * dirty. We use this to simulate device removal.
*/ */
mutex_lock(&p_fs->v_mutex); mutex_lock(&p_fs->v_mutex);
FAT_release_all(sb); exfat_fat_release_all(sb);
exfat_buf_release_all(sb); exfat_buf_release_all(sb);
mutex_unlock(&p_fs->v_mutex); mutex_unlock(&p_fs->v_mutex);
......
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