summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs/src/dosfs/msdos_node_type.c
blob: 517dabda3f73dd91d55dcc69b3e84a1d3e3b0954 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
 *  The following returns the type of node that the loc refers to.
 *
 *  Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia
 *  Author: Eugeny S. Mints <Eugeny.Mints@oktet.ru>
 *
 *  The license and distribution terms for this file may be
 *  found in the file LICENSE in this distribution or at
 *  http://www.OARcorp.com/rtems/license.html.
 *
 *  @(#) $Id$
 */

#if HAVE_CONFIG_H
#include "config.h"
#endif

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <stdlib.h>
#include <rtems.h>

#include <rtems/libio_.h>

#include "fat.h"
#include "fat_fat_operations.h"
#include "fat_file.h"

#include "msdos.h"

/* msdos_node_type --
 *     Determine type of the node that the pathloc refers to.
 * 
 * PARAMETERS:
 *     pathloc - node description
 *
 * RETURNS:
 *     node type
 *
 */
rtems_filesystem_node_types_t 
msdos_node_type(rtems_filesystem_location_info_t *pathloc)
{
    fat_file_fd_t *fat_fd;

    /* 
     * we don't need to obtain the volume semaphore here because node_type_h 
     * call always follows evalpath_h call(hence link increment occured) and 
     * hence node_access memory can't be freed during processing node_type_h 
     * call
     */
    fat_fd = pathloc->node_access;
 
    return fat_fd->fat_file_type;  
}