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

4.115
Last change on this file since c17d0b3 was c65afce4, checked in by Sebastian Huber <sebastian.huber@…>, on 07/07/12 at 13:46:33

dosfs: Use fs_info instead of mt_entry

  • Property mode set to 100644
File size: 1.3 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
12#if HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#include <sys/types.h>
17#include <fcntl.h>
18#include <unistd.h>
19#include <stdlib.h>
20#include <stdio.h>
21
22#include <rtems.h>
23#include <rtems/libio_.h>
24
25#include "fat.h"
26#include "fat_fat_operations.h"
27#include "fat_file.h"
28
29#include "msdos.h"
30
31/* msdos_shut_down --
32 *     Shut down MSDOS filesystem - free all allocated resources (don't
33 *     return if deallocation of some resource failed - free as much as
34 *     possible).
35 *
36 * PARAMETERS:
37 *     temp_mt_entry - mount table entry
38 *
39 */
40void
41msdos_shut_down(rtems_filesystem_mount_table_entry_t *temp_mt_entry)
42{
43    msdos_fs_info_t *fs_info = temp_mt_entry->fs_info;
44    fat_file_fd_t   *fat_fd = temp_mt_entry->mt_fs_root->location.node_access;
45
46    /* close fat-file which correspondes to root directory */
47    fat_file_close(&fs_info->fat, fat_fd);
48
49    fat_shutdown_drive(&fs_info->fat);
50
51    rtems_semaphore_delete(fs_info->vol_sema);
52    free(fs_info->cl_buf);
53    free(temp_mt_entry->fs_info);
54}
Note: See TracBrowser for help on using the repository browser.