summaryrefslogtreecommitdiffstats
path: root/c/src/exec/libfs/src/dosfs/msdos_free.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2002-02-28 20:43:50 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2002-02-28 20:43:50 +0000
commitf36a7bfcde756cae3b3e933f0e688137fb684be8 (patch)
tree0d1c325e5c12913674c0e1d6ddfd656fa8c0fcd8 /c/src/exec/libfs/src/dosfs/msdos_free.c
parent2002-02-28 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-f36a7bfcde756cae3b3e933f0e688137fb684be8.tar.bz2
2002-02-28 Victor V. Vengerov <vvv@oktet.ru>
* DOS filesystem including FAT12, FAT16, and FAT32 support submitted. * src/dosfs, src/dosfs/Makefile.am, src/dosfs/stamp-h2.in, src/dosfs/config.h.in, src/dosfs/dosfs.h, src/dosfs/fat.c, src/dosfs/fat.h, src/dosfs/fat_fat_operations.c, src/dosfs/fat_fat_operations.h, src/dosfs/fat_file.c, src/dosfs/fat_file.h, src/dosfs/msdos.h, src/dosfs/msdos_create.c, src/dosfs/msdos_dir.c, src/dosfs/msdos_eval.c, src/dosfs/msdos_file.c, src/dosfs/msdos_free.c, src/dosfs/msdos_fsunmount.c, src/dosfs/msdos_handlers_dir.c, src/dosfs/msdos_handlers_file.c, src/dosfs/msdos_init.c, src/dosfs/msdos_initsupp.c, src/dosfs/msdos_misc.c, src/dosfs/msdos_mknod.c, src/dosfs/msdos_node_type.c, src/dosfs/.cvsignore: New files. * configure.ac, src/Makefile.am, wrapup/Makefile.am: Modified to reflect addition.
Diffstat (limited to 'c/src/exec/libfs/src/dosfs/msdos_free.c')
-rw-r--r--c/src/exec/libfs/src/dosfs/msdos_free.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/c/src/exec/libfs/src/dosfs/msdos_free.c b/c/src/exec/libfs/src/dosfs/msdos_free.c
new file mode 100644
index 0000000000..c0d5938dbb
--- /dev/null
+++ b/c/src/exec/libfs/src/dosfs/msdos_free.c
@@ -0,0 +1,56 @@
+/*
+ * Free node handler implementation for the filesystem
+ * operations table.
+ *
+ * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia
+ * Author: Eugeny S. Mints <Eugeny.Mints@oktet.ru>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * @(#) $Id$
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems.h>
+#include <rtems/libio_.h>
+
+#include <errno.h>
+
+#include "fat.h"
+#include "fat_fat_operations.h"
+#include "fat_file.h"
+
+#include "msdos.h"
+
+/* msdos_free_node_info --
+ * Call fat-file close routine.
+ *
+ * PARAMETERS:
+ * pathloc - node description
+ *
+ * RETURNS:
+ * RC_OK on success, or -1 code if error occured
+ *
+ */
+int
+msdos_free_node_info(rtems_filesystem_location_info_t *pathloc)
+{
+ int rc = RC_OK;
+ rtems_status_code sc = RTEMS_SUCCESSFUL;
+ msdos_fs_info_t *fs_info = pathloc->mt_entry->fs_info;
+
+ sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
+ MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
+ if (sc != RTEMS_SUCCESSFUL)
+ set_errno_and_return_minus_one(EIO);
+
+ rc = fat_file_close(pathloc->mt_entry, pathloc->node_access);
+
+ rtems_semaphore_release(fs_info->vol_sema);
+ return rc;
+}