source: rtems/cpukit/libfs/src/dosfs/msdos_fsunmount.c @ cf0539b1

4.104.114.84.95
Last change on this file since cf0539b1 was cf0539b1, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:54:17

2003-09-04 Joel Sherrill <joel@…>

  • src/dosfs/dosfs.h, src/dosfs/fat.h, src/dosfs/fat_fat_operations.h, 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/imfs/deviceio.c, src/imfs/imfs.h, src/imfs/imfs_chown.c, src/imfs/imfs_config.c, src/imfs/imfs_creat.c, src/imfs/imfs_debug.c, src/imfs/imfs_directory.c, src/imfs/imfs_eval.c, src/imfs/imfs_fchmod.c, src/imfs/imfs_fcntl.c, src/imfs/imfs_fdatasync.c, src/imfs/imfs_free.c, src/imfs/imfs_fsunmount.c, src/imfs/imfs_getchild.c, src/imfs/imfs_gtkn.c, src/imfs/imfs_handlers_device.c, src/imfs/imfs_handlers_directory.c, src/imfs/imfs_handlers_link.c, src/imfs/imfs_handlers_memfile.c, src/imfs/imfs_init.c, src/imfs/imfs_initsupp.c, src/imfs/imfs_link.c, src/imfs/imfs_mknod.c, src/imfs/imfs_mount.c, src/imfs/imfs_ntype.c, src/imfs/imfs_readlink.c, src/imfs/imfs_rmnod.c, src/imfs/imfs_stat.c, src/imfs/imfs_symlink.c, src/imfs/imfs_unixstub.c, src/imfs/imfs_unlink.c, src/imfs/imfs_unmount.c, src/imfs/imfs_utime.c, src/imfs/ioman.c, src/imfs/linearfile.c, src/imfs/memfile.c, src/imfs/miniimfs_init.c: URL for license changed.
  • Property mode set to 100644
File size: 1.7 KB
Line 
1/*
2 *  MSDOS shut down handler implementation
3 *
4 *  Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia
5 *  Author: Eugeny S. Mints <Eugeny.Mints@oktet.ru>
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 *
11 *  @(#) $Id$
12 */
13
14#if HAVE_CONFIG_H
15#include "config.h"
16#endif
17
18#include <sys/types.h>
19#include <fcntl.h>
20#include <unistd.h>
21#include <stdlib.h>
22#include <stdio.h>
23
24#include <assert.h>
25#include <rtems.h>
26#include <rtems/libio_.h>
27
28#include "fat.h"
29#include "fat_fat_operations.h"
30#include "fat_file.h"
31
32#include "msdos.h"
33
34/* msdos_shut_down --
35 *     Shut down MSDOS filesystem - free all allocated resources (don't
36 *     return if deallocation of some resource failed - free as much as
37 *     possible).
38 *
39 * PARAMETERS:
40 *     temp_mt_entry - mount table entry
41 *
42 * RETURNS:
43 *     RC_OK on success, or -1 if error occured (errno set apropriately).
44 *
45 */
46int
47msdos_shut_down(rtems_filesystem_mount_table_entry_t *temp_mt_entry)
48{
49    int              rc = RC_OK;
50    msdos_fs_info_t *fs_info = temp_mt_entry->fs_info;
51    fat_file_fd_t   *fat_fd = temp_mt_entry->mt_fs_root.node_access;
52
53    /* close fat-file which correspondes to root directory */
54    if (fat_file_close(temp_mt_entry, fat_fd) != RC_OK)
55    {
56        /* no return - try to free as much as possible */
57        rc = -1;
58    }
59
60    if (fat_shutdown_drive(temp_mt_entry) != RC_OK)
61    {
62        /* no return - try to free as much as possible */
63        rc = -1;
64    }
65 
66    rtems_semaphore_delete(fs_info->vol_sema);
67    free(fs_info->cl_buf);
68    free(temp_mt_entry->fs_info);
69 
70    return rc;
71}
Note: See TracBrowser for help on using the repository browser.