diff options
author | Chris Johns <chrisj@rtems.org> | 2009-04-29 08:31:27 +0000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2009-04-29 08:31:27 +0000 |
commit | 07d6fd513f1c4d3c6905c880948671de1181fac2 (patch) | |
tree | 4dabf3fdd0b056bba7b0e9beb40f01277e5c2776 /cpukit/libfs/src/dosfs/fat_file.h | |
parent | 2009-04-28 Chris Johns <chrisj@rtems.org> (diff) | |
download | rtems-07d6fd513f1c4d3c6905c880948671de1181fac2.tar.bz2 |
2009-04-29 Chris Johns <chrisj@rtems.org>
* libcsupport/include/rtems/libio.h: Add rtems_off64_t for
internal use. Update the internal off_t to the 64bit offset.
* libnetworking/lib/ftpfs.c, libnetworking/lib/tftpDriver.c,
libfs/src/nfsclient/src/nfs.c, libfs/src/imfs/imfs_fifo.c,
libfs/src/imfs/memfile.c, libfs/src/imfs/imfs_directory.c,
libfs/src/imfs/imfs.h, libfs/src/imfs/deviceio.c: Change off_t to
rtems_off64_t.
* libmisc/shell/main_msdosfmt.c: Add an info level so the format
code can tell the user what is happening. Add more options to
control the format configuration.
* libfs/src/dosfs/msdos_format.c: Add a print function to display
the format progress and print statements. Select a better default
cluster size depending on the size of the disk. This lowers the
size of the FAT on large disks. Read and maintain the MRB
partition information.
* libfs/src/dosfs/dosfs.h, libfs/src/dosfs/fat.h,
libfs/src/dosfs/fat_file.c, libfs/src/dosfs/fat_file.h,
libfs/src/dosfs/msdos.h, libfs/src/dosfs/msdos_conv.c,
libfs/src/dosfs/msdos_create.c, libfs/src/dosfs/msdos_file.c,
libfs/src/dosfs/msdos_handlers_dir.c,
libfs/src/dosfs/msdos_handlers_file.c,
libfs/src/dosfs/msdos_init.c, libfs/src/dosfs/msdos_initsupp.c,
libfs/src/dosfs/msdos_misc.c, libfs/src/dosfs/msdos_mknod.c: Add
long file name support. Change off_t to rtems_off64_t.
Diffstat (limited to 'cpukit/libfs/src/dosfs/fat_file.h')
-rw-r--r-- | cpukit/libfs/src/dosfs/fat_file.h | 57 |
1 files changed, 27 insertions, 30 deletions
diff --git a/cpukit/libfs/src/dosfs/fat_file.h b/cpukit/libfs/src/dosfs/fat_file.h index 48b89c604e..01ab73ef98 100644 --- a/cpukit/libfs/src/dosfs/fat_file.h +++ b/cpukit/libfs/src/dosfs/fat_file.h @@ -20,6 +20,8 @@ #include <time.h> +#include "fat.h" + #ifdef __cplusplus extern "C" { #endif @@ -57,30 +59,27 @@ typedef struct fat_file_map_s */ typedef struct fat_file_fd_s { - Chain_Node link; /* - * fat-file descriptors organized into hash; - * collision lists are handled via link - * field - */ - uint32_t links_num; /* - * the number of fat_file_open call on - * this fat-file - */ - uint32_t ino; /* inode, file serial number :)))) */ - fat_file_type_t fat_file_type; - uint32_t size_limit; - uint32_t fat_file_size; /* length */ - uint32_t info_cln; - uint32_t cln; - uint16_t info_ofs; - unsigned char first_char; - uint8_t flags; - fat_file_map_t map; - time_t mtime; + rtems_chain_node link; /* + * fat-file descriptors organized into hash; + * collision lists are handled via link + * field + */ + uint32_t links_num; /* + * the number of fat_file_open call on + * this fat-file + */ + uint32_t ino; /* inode, file serial number :)))) */ + fat_file_type_t fat_file_type; + uint32_t size_limit; + uint32_t fat_file_size; /* length */ + uint32_t cln; + fat_dir_pos_t dir_pos; + uint8_t flags; + fat_file_map_t map; + time_t mtime; } fat_file_fd_t; - #define FAT_FILE_REMOVED 0x01 #define FAT_FILE_IS_REMOVED(p)\ @@ -101,8 +100,8 @@ typedef struct fat_file_fd_s #define FAT_ROOTDIR_CLUSTER_NUM 0x01 #define FAT_FD_OF_ROOT_DIR(fat_fd) \ - ((fat_fd->info_cln == FAT_ROOTDIR_CLUSTER_NUM ) && \ - (fat_fd->info_ofs == 0)) + ((fat_fd->dir_pos.sname.cln == FAT_ROOTDIR_CLUSTER_NUM) && \ + (fat_fd->dir_pos.sname.ofs == 0)) #define FAT_EOF 0x00 @@ -122,19 +121,17 @@ typedef struct fat_file_fd_s static inline uint32_t fat_construct_key( rtems_filesystem_mount_table_entry_t *mt_entry, - uint32_t cl, - uint32_t ofs) + fat_pos_t *pos) { - return ( ((fat_cluster_num_to_sector512_num(mt_entry, cl) + - (ofs >> FAT_SECTOR512_BITS)) << 4) + - ((ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); + return ( ((fat_cluster_num_to_sector512_num(mt_entry, pos->cln) + + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + + ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); } /* Prototypes for "fat-file" operations */ int fat_file_open(rtems_filesystem_mount_table_entry_t *mt_entry, - uint32_t cln, - uint32_t ofs, + fat_dir_pos_t *dir_pos, fat_file_fd_t **fat_fd); int |