source:
rtems/cpukit/libfs/src/dosfs/msdos_free.c
@
01c5b9d7
Last change on this file since 01c5b9d7 was f36a7bfc, checked in by Joel Sherrill <joel.sherrill@…>, on 02/28/02 at 20:43:50 | |
---|---|
|
|
File size: 1.3 KB |
Line | |
---|---|
1 | /* |
2 | * Free node handler implementation for the filesystem |
3 | * operations table. |
4 | * |
5 | * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia |
6 | * Author: Eugeny S. Mints <Eugeny.Mints@oktet.ru> |
7 | * |
8 | * The license and distribution terms for this file may be |
9 | * found in the file LICENSE in this distribution or at |
10 | * http://www.OARcorp.com/rtems/license.html. |
11 | * |
12 | * @(#) $Id$ |
13 | */ |
14 | |
15 | #if HAVE_CONFIG_H |
16 | #include "config.h" |
17 | #endif |
18 | |
19 | #include <rtems.h> |
20 | #include <rtems/libio_.h> |
21 | |
22 | #include <errno.h> |
23 | |
24 | #include "fat.h" |
25 | #include "fat_fat_operations.h" |
26 | #include "fat_file.h" |
27 | |
28 | #include "msdos.h" |
29 | |
30 | /* msdos_free_node_info -- |
31 | * Call fat-file close routine. |
32 | * |
33 | * PARAMETERS: |
34 | * pathloc - node description |
35 | * |
36 | * RETURNS: |
37 | * RC_OK on success, or -1 code if error occured |
38 | * |
39 | */ |
40 | int |
41 | msdos_free_node_info(rtems_filesystem_location_info_t *pathloc) |
42 | { |
43 | int rc = RC_OK; |
44 | rtems_status_code sc = RTEMS_SUCCESSFUL; |
45 | msdos_fs_info_t *fs_info = pathloc->mt_entry->fs_info; |
46 | |
47 | sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT, |
48 | MSDOS_VOLUME_SEMAPHORE_TIMEOUT); |
49 | if (sc != RTEMS_SUCCESSFUL) |
50 | set_errno_and_return_minus_one(EIO); |
51 | |
52 | rc = fat_file_close(pathloc->mt_entry, pathloc->node_access); |
53 | |
54 | rtems_semaphore_release(fs_info->vol_sema); |
55 | return rc; |
56 | } |
Note: See TracBrowser
for help on using the repository browser.