summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs/src/dosfs
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/libfs/src/dosfs')
-rw-r--r--cpukit/libfs/src/dosfs/fat.c2
-rw-r--r--cpukit/libfs/src/dosfs/fat_fat_operations.c12
-rw-r--r--cpukit/libfs/src/dosfs/msdos.h6
-rw-r--r--cpukit/libfs/src/dosfs/msdos_conv.c2
-rw-r--r--cpukit/libfs/src/dosfs/msdos_conv_default.c2
-rw-r--r--cpukit/libfs/src/dosfs/msdos_conv_utf8.c2
-rw-r--r--cpukit/libfs/src/dosfs/msdos_create.c2
-rw-r--r--cpukit/libfs/src/dosfs/msdos_dir.c16
-rw-r--r--cpukit/libfs/src/dosfs/msdos_file.c7
-rw-r--r--cpukit/libfs/src/dosfs/msdos_init.c4
-rw-r--r--cpukit/libfs/src/dosfs/msdos_misc.c7
-rw-r--r--cpukit/libfs/src/dosfs/msdos_mknod.c2
12 files changed, 34 insertions, 30 deletions
diff --git a/cpukit/libfs/src/dosfs/fat.c b/cpukit/libfs/src/dosfs/fat.c
index 9229406dec..88b4a2859b 100644
--- a/cpukit/libfs/src/dosfs/fat.c
+++ b/cpukit/libfs/src/dosfs/fat.c
@@ -93,7 +93,6 @@ fat_buf_release(fat_fs_info_t *fs_info)
uint32_t sec_num = fs_info->c.blk_num;
bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) &&
(sec_num < fs_info->vol.rdir_loc));
- uint32_t blk = fat_sector_num_to_block_num(fs_info, sec_num);
uint32_t blk_ofs = fat_sector_offset_to_block_offset(fs_info,
sec_num,
0);
@@ -115,6 +114,7 @@ fat_buf_release(fat_fs_info_t *fs_info)
for (i = 1; i < fs_info->vol.fats; i++)
{
rtems_bdbuf_buffer *bd;
+ uint32_t blk;
sec_num = fs_info->c.blk_num + fs_info->vol.fat_length * i,
blk = fat_sector_num_to_block_num(fs_info, sec_num);
diff --git a/cpukit/libfs/src/dosfs/fat_fat_operations.c b/cpukit/libfs/src/dosfs/fat_fat_operations.c
index 24a408f9c7..fe6bbf03ce 100644
--- a/cpukit/libfs/src/dosfs/fat_fat_operations.c
+++ b/cpukit/libfs/src/dosfs/fat_fat_operations.c
@@ -203,9 +203,9 @@ fat_free_fat_clusters_chain(
cur_cln = next_cln;
}
- fs_info->vol.next_cl = chain;
- if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
- fs_info->vol.free_cls += freed_cls_cnt;
+ fs_info->vol.next_cl = chain;
+ if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
+ fs_info->vol.free_cls += freed_cls_cnt;
fat_buf_release(fs_info);
if (rc1 != RC_OK)
@@ -356,7 +356,7 @@ fat_set_fat_cluster(
if (rc != RC_OK)
return rc;
- *sec_buf &= 0x00;
+ *sec_buf = 0x00;
*sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8);
@@ -364,7 +364,7 @@ fat_set_fat_cluster(
}
else
{
- *(sec_buf + ofs + 1) &= 0x00;
+ *(sec_buf + ofs + 1) = 0x00;
*(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8);
}
@@ -372,7 +372,7 @@ fat_set_fat_cluster(
else
{
fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK;
- *(sec_buf + ofs) &= 0x00;
+ *(sec_buf + ofs) = 0x00;
*(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF);
diff --git a/cpukit/libfs/src/dosfs/msdos.h b/cpukit/libfs/src/dosfs/msdos.h
index df9600a02d..e6d650c8d5 100644
--- a/cpukit/libfs/src/dosfs/msdos.h
+++ b/cpukit/libfs/src/dosfs/msdos.h
@@ -11,7 +11,7 @@
* Author: Eugeny S. Mints <Eugeny.Mints@oktet.ru>
*
* Modifications to support UTF-8 in the file system are
- * Copyright (c) 2013 embedded brains GmbH.
+ * Copyright (c) 2013 embedded brains GmbH & Co. KG
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
@@ -72,12 +72,12 @@ typedef struct msdos_fs_info_s
rtems_dosfs_convert_control *converter;
} msdos_fs_info_t;
-RTEMS_INLINE_ROUTINE void msdos_fs_lock(msdos_fs_info_t *fs_info)
+static inline void msdos_fs_lock(msdos_fs_info_t *fs_info)
{
rtems_recursive_mutex_lock(&fs_info->vol_mutex);
}
-RTEMS_INLINE_ROUTINE void msdos_fs_unlock(msdos_fs_info_t *fs_info)
+static inline void msdos_fs_unlock(msdos_fs_info_t *fs_info)
{
rtems_recursive_mutex_unlock(&fs_info->vol_mutex);
}
diff --git a/cpukit/libfs/src/dosfs/msdos_conv.c b/cpukit/libfs/src/dosfs/msdos_conv.c
index 7efd5a7e80..ba28a07512 100644
--- a/cpukit/libfs/src/dosfs/msdos_conv.c
+++ b/cpukit/libfs/src/dosfs/msdos_conv.c
@@ -25,7 +25,7 @@
* October 1992
*
* Modifications to support UTF-8 in the file system are
- * Copyright (c) 2013 embedded brains GmbH.
+ * Copyright (c) 2013 embedded brains GmbH & Co. KG
*/
#ifdef HAVE_CONFIG_H
diff --git a/cpukit/libfs/src/dosfs/msdos_conv_default.c b/cpukit/libfs/src/dosfs/msdos_conv_default.c
index 2a42738db0..43cff88c6c 100644
--- a/cpukit/libfs/src/dosfs/msdos_conv_default.c
+++ b/cpukit/libfs/src/dosfs/msdos_conv_default.c
@@ -7,7 +7,7 @@
*/
/*
- * Copyright (c) 2013 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2013 embedded brains GmbH & Co. KG
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
diff --git a/cpukit/libfs/src/dosfs/msdos_conv_utf8.c b/cpukit/libfs/src/dosfs/msdos_conv_utf8.c
index 332d33d2dc..36027eb2f3 100644
--- a/cpukit/libfs/src/dosfs/msdos_conv_utf8.c
+++ b/cpukit/libfs/src/dosfs/msdos_conv_utf8.c
@@ -7,7 +7,7 @@
*/
/*
- * Copyright (c) 2013 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2013 embedded brains GmbH & Co. KG
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
diff --git a/cpukit/libfs/src/dosfs/msdos_create.c b/cpukit/libfs/src/dosfs/msdos_create.c
index 26df0451c9..f71969f787 100644
--- a/cpukit/libfs/src/dosfs/msdos_create.c
+++ b/cpukit/libfs/src/dosfs/msdos_create.c
@@ -202,7 +202,7 @@ msdos_creat_node(const rtems_filesystem_location_info_t *parent_loc,
fs_info->fat.vol.bpc,
&unused);
if (rc != RC_OK)
- goto err;
+ goto error;
/*
* dot and dotdot entries are identical to new node except the
diff --git a/cpukit/libfs/src/dosfs/msdos_dir.c b/cpukit/libfs/src/dosfs/msdos_dir.c
index 093020cbfd..d9585635d9 100644
--- a/cpukit/libfs/src/dosfs/msdos_dir.c
+++ b/cpukit/libfs/src/dosfs/msdos_dir.c
@@ -11,7 +11,7 @@
* Author: Eugeny S. Mints <Eugeny.Mints@oktet.ru>
*
* Modifications to support UTF-8 in the file system are
- * Copyright (c) 2013 embedded brains GmbH.
+ * Copyright (c) 2013 embedded brains GmbH & Co. KG
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
@@ -339,14 +339,14 @@ msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count)
iop->offset = iop->offset + sizeof(struct dirent);
cmpltd += (sizeof(struct dirent));
count -= (sizeof(struct dirent));
+ }
- /* inode number extracted, close fat-file */
- rc = fat_file_close(&fs_info->fat, tmp_fat_fd);
- if (rc != RC_OK)
- {
- msdos_fs_unlock(fs_info);
- return rc;
- }
+ /* inode number extracted, close fat-file */
+ rc = fat_file_close(&fs_info->fat, tmp_fat_fd);
+ if (rc != RC_OK)
+ {
+ msdos_fs_unlock(fs_info);
+ return rc;
}
}
diff --git a/cpukit/libfs/src/dosfs/msdos_file.c b/cpukit/libfs/src/dosfs/msdos_file.c
index d142968337..e25f292484 100644
--- a/cpukit/libfs/src/dosfs/msdos_file.c
+++ b/cpukit/libfs/src/dosfs/msdos_file.c
@@ -179,7 +179,7 @@ msdos_file_ftruncate(rtems_libio_t *iop, off_t length)
length,
&new_length);
if (rc == RC_OK && length != new_length) {
- fat_file_truncate(&fs_info->fat, fat_fd, old_length);
+ (void) fat_file_truncate(&fs_info->fat, fat_fd, old_length);
errno = ENOSPC;
rc = -1;
}
@@ -223,6 +223,11 @@ msdos_file_sync(rtems_libio_t *iop)
}
rc = fat_sync(&fs_info->fat);
+ if (rc != RC_OK)
+ {
+ msdos_fs_unlock(fs_info);
+ return rc;
+ }
msdos_fs_unlock(fs_info);
diff --git a/cpukit/libfs/src/dosfs/msdos_init.c b/cpukit/libfs/src/dosfs/msdos_init.c
index 36f1442a26..2ea3c025c7 100644
--- a/cpukit/libfs/src/dosfs/msdos_init.c
+++ b/cpukit/libfs/src/dosfs/msdos_init.c
@@ -11,10 +11,10 @@
* Author: Eugeny S. Mints <Eugeny.Mints@oktet.ru>
*
* Modifications to support reference counting in the file system are
- * Copyright (c) 2012 embedded brains GmbH.
+ * Copyright (c) 2012 embedded brains GmbH & Co. KG
*
* Modifications to support UTF-8 in the file system are
- * Copyright (c) 2013 embedded brains GmbH.
+ * Copyright (c) 2013 embedded brains GmbH & Co. KG
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
diff --git a/cpukit/libfs/src/dosfs/msdos_misc.c b/cpukit/libfs/src/dosfs/msdos_misc.c
index a82389bc42..cd59c494ea 100644
--- a/cpukit/libfs/src/dosfs/msdos_misc.c
+++ b/cpukit/libfs/src/dosfs/msdos_misc.c
@@ -11,7 +11,7 @@
* Author: Eugeny S. Mints <Eugeny.Mints@oktet.ru>
*
* Modifications to support UTF-8 in the file system are
- * Copyright (c) 2013 embedded brains GmbH.
+ * Copyright (c) 2013 embedded brains GmbH & Co. KG
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
@@ -288,7 +288,6 @@ msdos_long_to_short(rtems_dosfs_convert_control *converter,
&codepage_name_len);
if (eno == EINVAL)
{
- eno = 0;
type = MSDOS_NAME_LONG;
}
else
@@ -1304,7 +1303,6 @@ static int
msdos_find_file_in_directory (
const uint8_t *filename_converted,
const size_t name_len_for_compare,
- const size_t name_len_for_save,
const msdos_name_type_t name_type,
msdos_fs_info_t *fs_info,
fat_file_fd_t *fat_fd,
@@ -1747,6 +1745,8 @@ msdos_add_file (
/* Get position of short file name entry */
ret = msdos_get_pos(fs_info, fat_fd, bts2rd, short_file_offset,
&dir_pos->sname);
+ if (ret != RC_OK)
+ return ret;
/*
* Handle the entry writes.
@@ -1918,7 +1918,6 @@ msdos_find_name_in_fat_file (
retval = msdos_find_file_in_directory (
buffer,
name_len_for_compare,
- name_len_for_save,
name_type,
fs_info,
fat_fd,
diff --git a/cpukit/libfs/src/dosfs/msdos_mknod.c b/cpukit/libfs/src/dosfs/msdos_mknod.c
index 934805c5f1..8fe01e4985 100644
--- a/cpukit/libfs/src/dosfs/msdos_mknod.c
+++ b/cpukit/libfs/src/dosfs/msdos_mknod.c
@@ -44,7 +44,7 @@ int msdos_mknod(
)
{
int rc = RC_OK;
- fat_file_type_t type = 0;
+ fat_file_type_t type = FAT_DIRECTORY;
/*
* Figure out what type of msdos node this is.