[rtems commit] dosfs: Fix warnings

Sebastian Huber sebh at rtems.org
Thu Mar 5 10:35:54 UTC 2015


Module:    rtems
Branch:    master
Commit:    c735cd5a1f24bcf5023fcd5fc4097a1fced45652
Changeset: http://git.rtems.org/rtems/commit/?id=c735cd5a1f24bcf5023fcd5fc4097a1fced45652

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Mar  5 10:34:28 2015 +0100

dosfs: Fix warnings

---

 cpukit/libfs/src/dosfs/fat_file.h     | 1 +
 cpukit/libfs/src/dosfs/msdos.h        | 9 +--------
 cpukit/libfs/src/dosfs/msdos_create.c | 8 ++++----
 cpukit/libfs/src/dosfs/msdos_eval.c   | 2 +-
 cpukit/libfs/src/dosfs/msdos_mknod.c  | 6 +++---
 cpukit/libfs/src/dosfs/msdos_rename.c | 2 +-
 cpukit/libfs/src/dosfs/msdos_rmnod.c  | 2 +-
 7 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/cpukit/libfs/src/dosfs/fat_file.h b/cpukit/libfs/src/dosfs/fat_file.h
index 9905757..0f491a9 100644
--- a/cpukit/libfs/src/dosfs/fat_file.h
+++ b/cpukit/libfs/src/dosfs/fat_file.h
@@ -39,6 +39,7 @@ extern "C" {
 
 typedef enum {
   FAT_DIRECTORY = 0,
+  FAT_HARD_LINK = 2, /* pseudo type */
   FAT_FILE = 4
 } fat_file_type_t;
 
diff --git a/cpukit/libfs/src/dosfs/msdos.h b/cpukit/libfs/src/dosfs/msdos.h
index e6cffbb..d1ce5ad 100644
--- a/cpukit/libfs/src/dosfs/msdos.h
+++ b/cpukit/libfs/src/dosfs/msdos.h
@@ -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  */
 #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
  * Structure
@@ -370,7 +363,7 @@ int msdos_dir_stat(
  *
  */
 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,
                      int                                     name_len,
                      mode_t                                  mode,
diff --git a/cpukit/libfs/src/dosfs/msdos_create.c b/cpukit/libfs/src/dosfs/msdos_create.c
index 9eab2fb..33bef08 100644
--- a/cpukit/libfs/src/dosfs/msdos_create.c
+++ b/cpukit/libfs/src/dosfs/msdos_create.c
@@ -59,7 +59,7 @@
  */
 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,
                  int                                      name_len,
                  mode_t                                   mode,
@@ -115,10 +115,10 @@ msdos_creat_node(const rtems_filesystem_location_info_t  *parent_loc,
     /* initialize directory/file 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;
     }
-    else if (type == MSDOS_HARD_LINK) {
+    else if (type == FAT_HARD_LINK) {
       /*
        * when we establish a (temporary) hard link,
        * 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
      * to do
      */
-    if (type == MSDOS_DIRECTORY)
+    if (type == FAT_DIRECTORY)
     {
         /* open new directory as fat-file */
         rc = fat_file_open(&fs_info->fat, &dir_pos, &fat_fd);
diff --git a/cpukit/libfs/src/dosfs/msdos_eval.c b/cpukit/libfs/src/dosfs/msdos_eval.c
index 46e6f0e..3c12946 100644
--- a/cpukit/libfs/src/dosfs/msdos_eval.c
+++ b/cpukit/libfs/src/dosfs/msdos_eval.c
@@ -64,7 +64,7 @@ static bool msdos_is_directory(
     rtems_filesystem_eval_path_get_currentloc( ctx );
   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(
diff --git a/cpukit/libfs/src/dosfs/msdos_mknod.c b/cpukit/libfs/src/dosfs/msdos_mknod.c
index 0b5bfd2..28b3463 100644
--- a/cpukit/libfs/src/dosfs/msdos_mknod.c
+++ b/cpukit/libfs/src/dosfs/msdos_mknod.c
@@ -43,18 +43,18 @@ int msdos_mknod(
 )
 {
     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.
      */
     if (S_ISDIR(mode))
     {
-       type = MSDOS_DIRECTORY;
+       type = FAT_DIRECTORY;
     }
     else if (S_ISREG(mode))
     {
-        type = MSDOS_REGULAR_FILE;
+        type = FAT_FILE;
     }
     else
         rtems_set_errno_and_return_minus_one(EINVAL);
diff --git a/cpukit/libfs/src/dosfs/msdos_rename.c b/cpukit/libfs/src/dosfs/msdos_rename.c
index c50bd93..47d70ec 100644
--- a/cpukit/libfs/src/dosfs/msdos_rename.c
+++ b/cpukit/libfs/src/dosfs/msdos_rename.c
@@ -51,7 +51,7 @@ msdos_rename(
      * existing file
      */
     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);
     if (rc != RC_OK)
     {
diff --git a/cpukit/libfs/src/dosfs/msdos_rmnod.c b/cpukit/libfs/src/dosfs/msdos_rmnod.c
index 44d582d..b91728c 100644
--- a/cpukit/libfs/src/dosfs/msdos_rmnod.c
+++ b/cpukit/libfs/src/dosfs/msdos_rmnod.c
@@ -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;
     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;
 




More information about the vc mailing list