summaryrefslogtreecommitdiff
path: root/core/fs/fat
diff options
context:
space:
mode:
authorLiu Aleaxander <Aleaxander@gmail.com>2009-11-20 13:08:42 +0800
committerLiu Aleaxander <Aleaxander@gmail.com>2009-11-20 13:08:42 +0800
commit7acda33d12dea2117bbfd9ba138104d680efcd85 (patch)
tree117fe252a8d4a70d156466f6bcb8fbb3bf836e75 /core/fs/fat
parent84b1443afbfe24eb6e338e8636e8e3759b9093d5 (diff)
downloadsyslinux-7acda33d12dea2117bbfd9ba138104d680efcd85.tar.gz
core:fs: Use a much better union structure in file structure
Remove the u1 and u2 union, and merge the related fileds as a group, and then make a big union. Then we don't need to use u1 or u2 to reference these fileds any more but use it directly just like there are no union structures here:) Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
Diffstat (limited to 'core/fs/fat')
-rw-r--r--core/fs/fat/fat.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/fs/fat/fat.c b/core/fs/fat/fat.c
index e8a82acc..0c3b5b91 100644
--- a/core/fs/fat/fat.c
+++ b/core/fs/fat/fat.c
@@ -95,7 +95,7 @@ static inline void close_pvt(struct open_file_t *of)
static void vfat_close_file(struct file *file)
{
- close_pvt(file->u1.open_file);
+ close_pvt(file->open_file);
}
@@ -290,7 +290,7 @@ static uint32_t vfat_getfssec(struct file *gfile, char *buf, int sectors,
bool *have_more)
{
uint32_t bytes_read = sectors << SECTOR_SHIFT;
- struct open_file_t *file = gfile->u1.open_file;
+ struct open_file_t *file = gfile->open_file;
struct fs_info *fs = gfile->fs;
if (sectors > file->file_left)
@@ -662,8 +662,8 @@ static void vfat_searchdir(char *filename, struct file *file)
open_file->file_left = (file_len + SECTOR_SIZE -1) >> SECTOR_SHIFT;
}
- file->u2.file_len = file_len;
- file->u1.open_file = open_file;
+ file->file_len = file_len;
+ file->open_file = open_file;
}
/*
@@ -695,7 +695,7 @@ struct dirent* vfat_readdir(struct file *dir)
struct cache_struct *cs;
struct fat_dir_entry *fat_dir;
struct fat_long_name_entry *long_dir;
- struct open_file_t *file = dir->u1.open_file;
+ struct open_file_t *file = dir->open_file;
struct fs_info *fs = dir->fs;
sector = file->file_sector;