diff options
| author | Liu Aleaxander <Aleaxander@gmail.com> | 2009-11-20 13:08:42 +0800 |
|---|---|---|
| committer | Liu Aleaxander <Aleaxander@gmail.com> | 2009-11-20 13:08:42 +0800 |
| commit | 7acda33d12dea2117bbfd9ba138104d680efcd85 (patch) | |
| tree | 117fe252a8d4a70d156466f6bcb8fbb3bf836e75 /core/include | |
| parent | 84b1443afbfe24eb6e338e8636e8e3759b9093d5 (diff) | |
| download | syslinux-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/include')
| -rw-r--r-- | core/include/fs.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/core/include/fs.h b/core/include/fs.h index 35d46ed4..28b66793 100644 --- a/core/include/fs.h +++ b/core/include/fs.h @@ -86,13 +86,18 @@ struct open_file_t; struct file { struct fs_info *fs; union { - struct inode *inode; /* the file-specific information */ - struct open_file_t *open_file; - } u1; - union { - uint32_t offset; /* for next read */ - uint32_t file_len; - } u2; + /* For the new universal-path_lookup */ + struct { + struct inode *inode; /* The file-specific information */ + uint32_t offset; /* for next read */ + }; + + /* For the old searhdir method */ + struct { + struct open_file_t *open_file;/* The fs-specific open file struct */ + uint32_t file_len; + }; + }; }; |
