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

5
Last change on this file since 3b77417 was 3b77417, checked in by Sebastian Huber <sebastian.huber@…>, on 12/13/17 at 15:15:25

dosfs: Use self-contained recursive mutex

Update #2843.

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/**
2 * @file
3 *
4 * @brief Shut Down MSDOS FileSystem
5 * @ingroup libfs_msdos MSDOS FileSystem
6 */
7
8/*
9 *  Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia
10 *  Author: Eugeny S. Mints <Eugeny.Mints@oktet.ru>
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.org/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <sys/types.h>
22#include <fcntl.h>
23#include <unistd.h>
24#include <stdlib.h>
25#include <stdio.h>
26
27#include <rtems.h>
28#include <rtems/libio_.h>
29
30#include "fat.h"
31#include "fat_fat_operations.h"
32#include "fat_file.h"
33
34#include "msdos.h"
35
36/* msdos_shut_down --
37 *     Shut down MSDOS filesystem - free all allocated resources (don't
38 *     return if deallocation of some resource failed - free as much as
39 *     possible).
40 *
41 * PARAMETERS:
42 *     temp_mt_entry - mount table entry
43 *
44 */
45void
46msdos_shut_down(rtems_filesystem_mount_table_entry_t *temp_mt_entry)
47{
48    msdos_fs_info_t *fs_info = temp_mt_entry->fs_info;
49    fat_file_fd_t   *fat_fd = temp_mt_entry->mt_fs_root->location.node_access;
50    rtems_dosfs_convert_control *converter = fs_info->converter;
51
52    /* close fat-file which corresponds to root directory */
53    fat_file_close(&fs_info->fat, fat_fd);
54
55    fat_shutdown_drive(&fs_info->fat);
56
57    rtems_recursive_mutex_destroy(&fs_info->vol_mutex);
58    (*converter->handler->destroy)( converter );
59    free(fs_info->cl_buf);
60    free(temp_mt_entry->fs_info);
61}
Note: See TracBrowser for help on using the repository browser.