OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [cpukit/] [libfs/] [src/] [dosfs/] [msdos_free.c] - Blame information for rev 1771

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*
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
 *  @(#) msdos_free.c,v 1.1 2002/02/28 20:43:50 joel Exp
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
}

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.