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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [cpukit/] [libfs/] [src/] [imfs/] [imfs_unmount.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*
2
 *  IMFS_unmount
3
 *
4
 *  This routine will look at a mount table entry that we are going to
5
 *  add to the mount table. If the mount point
6
 *  rtems_filesystem_location_info_t struct refers to a node that is a
7
 *  directory that has a file system mounted on it, the node will be
8
 *  marked as a mount point by * setting its directory.mt_fs pointer
9
 *  to NULL. This indicates that a directory is no longer mounted on
10
 *  this node.
11
 *
12
 *  COPYRIGHT (c) 1989-1999.
13
 *  On-Line Applications Research Corporation (OAR).
14
 *
15
 *  The license and distribution terms for this file may be
16
 *  found in the file LICENSE in this distribution or at
17
 *  http://www.OARcorp.com/rtems/license.html.
18
 *
19
 *  imfs_unmount.c,v 1.5 2002/01/04 18:30:58 joel Exp
20
 */
21
 
22
#if HAVE_CONFIG_H
23
#include "config.h"
24
#endif
25
 
26
#include <errno.h>
27
 
28
#include "imfs.h"
29
#include <rtems/libio_.h>
30
#include <rtems/seterr.h>
31
 
32
int IMFS_unmount(
33
  rtems_filesystem_mount_table_entry_t *mt_entry
34
)
35
{
36
  IMFS_jnode_t  *node;
37
 
38
  node = mt_entry->mt_point_node.node_access;
39
 
40
  /*
41
   * Is the node that we are mounting onto a directory node ?
42
   */
43
 
44
  if ( node->type != IMFS_DIRECTORY )
45
    rtems_set_errno_and_return_minus_one( ENOTDIR );
46
 
47
  /*
48
   * Did the node indicate that there was a directory mounted here?
49
   */
50
 
51
  if ( node->info.directory.mt_fs == NULL )
52
    rtems_set_errno_and_return_minus_one( EINVAL );  /* XXX */
53
 
54
  /*
55
   * Set the mt_fs pointer to indicate that there is no longer
56
   * a file system mounted to this point.
57
   */
58
 
59
  node->info.directory.mt_fs = NULL;
60
 
61
  return 0;
62
}

powered by: WebSVN 2.1.0

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