dosfs: Fix warnings

This commit is contained in:
Sebastian Huber
2015-03-05 10:34:28 +01:00
parent 6fd5b4e486
commit c735cd5a1f
7 changed files with 12 additions and 18 deletions

View File

@@ -39,6 +39,7 @@ extern "C" {
typedef enum { typedef enum {
FAT_DIRECTORY = 0, FAT_DIRECTORY = 0,
FAT_HARD_LINK = 2, /* pseudo type */
FAT_FILE = 4 FAT_FILE = 4
} fat_file_type_t; } fat_file_type_t;

View File

@@ -85,13 +85,6 @@ extern const rtems_filesystem_file_handlers_r msdos_file_handlers;
* of ticks to help debugging or if you need such a */ * of ticks to help debugging or if you need such a */
#define MSDOS_VOLUME_SEMAPHORE_TIMEOUT RTEMS_NO_TIMEOUT #define MSDOS_VOLUME_SEMAPHORE_TIMEOUT RTEMS_NO_TIMEOUT
/* Node types */
typedef enum {
MSDOS_DIRECTORY = 0,
MSDOS_REGULAR_FILE = 4,
MSDOS_HARD_LINK = 2 /* pseudo type */
} msdos_node_type_t;
/* /*
* Macros for fetching fields from 32 bytes long FAT Directory Entry * Macros for fetching fields from 32 bytes long FAT Directory Entry
* Structure * Structure
@@ -370,7 +363,7 @@ int msdos_dir_stat(
* *
*/ */
int msdos_creat_node(const rtems_filesystem_location_info_t *parent_loc, int msdos_creat_node(const rtems_filesystem_location_info_t *parent_loc,
msdos_node_type_t type, fat_file_type_t type,
const char *name, const char *name,
int name_len, int name_len,
mode_t mode, mode_t mode,

View File

@@ -59,7 +59,7 @@
*/ */
int int
msdos_creat_node(const rtems_filesystem_location_info_t *parent_loc, msdos_creat_node(const rtems_filesystem_location_info_t *parent_loc,
msdos_node_type_t type, fat_file_type_t type,
const char *name, const char *name,
int name_len, int name_len,
mode_t mode, mode_t mode,
@@ -115,10 +115,10 @@ msdos_creat_node(const rtems_filesystem_location_info_t *parent_loc,
/* initialize directory/file size */ /* initialize directory/file size */
*MSDOS_DIR_FILE_SIZE(short_node) = MSDOS_INIT_DIR_SIZE; *MSDOS_DIR_FILE_SIZE(short_node) = MSDOS_INIT_DIR_SIZE;
if (type == MSDOS_DIRECTORY) { if (type == FAT_DIRECTORY) {
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_DIRECTORY; *MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_DIRECTORY;
} }
else if (type == MSDOS_HARD_LINK) { else if (type == FAT_HARD_LINK) {
/* /*
* when we establish a (temporary) hard link, * when we establish a (temporary) hard link,
* we must copy some information from the original * we must copy some information from the original
@@ -177,7 +177,7 @@ msdos_creat_node(const rtems_filesystem_location_info_t *parent_loc,
* if we create a new file we are done, if directory there are more steps * if we create a new file we are done, if directory there are more steps
* to do * to do
*/ */
if (type == MSDOS_DIRECTORY) if (type == FAT_DIRECTORY)
{ {
/* open new directory as fat-file */ /* open new directory as fat-file */
rc = fat_file_open(&fs_info->fat, &dir_pos, &fat_fd); rc = fat_file_open(&fs_info->fat, &dir_pos, &fat_fd);

View File

@@ -64,7 +64,7 @@ static bool msdos_is_directory(
rtems_filesystem_eval_path_get_currentloc( ctx ); rtems_filesystem_eval_path_get_currentloc( ctx );
fat_file_fd_t *fat_fd = currentloc->node_access; fat_file_fd_t *fat_fd = currentloc->node_access;
return fat_fd->fat_file_type == MSDOS_DIRECTORY; return fat_fd->fat_file_type == FAT_DIRECTORY;
} }
static rtems_filesystem_eval_path_generic_status msdos_eval_token( static rtems_filesystem_eval_path_generic_status msdos_eval_token(

View File

@@ -43,18 +43,18 @@ int msdos_mknod(
) )
{ {
int rc = RC_OK; int rc = RC_OK;
msdos_node_type_t type = 0; fat_file_type_t type = 0;
/* /*
* Figure out what type of msdos node this is. * Figure out what type of msdos node this is.
*/ */
if (S_ISDIR(mode)) if (S_ISDIR(mode))
{ {
type = MSDOS_DIRECTORY; type = FAT_DIRECTORY;
} }
else if (S_ISREG(mode)) else if (S_ISREG(mode))
{ {
type = MSDOS_REGULAR_FILE; type = FAT_FILE;
} }
else else
rtems_set_errno_and_return_minus_one(EINVAL); rtems_set_errno_and_return_minus_one(EINVAL);

View File

@@ -51,7 +51,7 @@ msdos_rename(
* existing file * existing file
*/ */
rc = msdos_creat_node(new_parent_loc, rc = msdos_creat_node(new_parent_loc,
MSDOS_HARD_LINK,new_name,new_namelen,S_IFREG, FAT_HARD_LINK,new_name,new_namelen,S_IFREG,
old_fat_fd); old_fat_fd);
if (rc != RC_OK) if (rc != RC_OK)
{ {

View File

@@ -28,7 +28,7 @@ msdos_rmnod(const rtems_filesystem_location_info_t *parent_pathloc,
msdos_fs_info_t *fs_info = pathloc->mt_entry->fs_info; msdos_fs_info_t *fs_info = pathloc->mt_entry->fs_info;
fat_file_fd_t *fat_fd = pathloc->node_access; fat_file_fd_t *fat_fd = pathloc->node_access;
if (fat_fd->fat_file_type == MSDOS_DIRECTORY) if (fat_fd->fat_file_type == FAT_FILE)
{ {
bool is_empty = false; bool is_empty = false;