source: rtems/cpukit/libfs/src/imfs/imfs_unmount.c @ 07a3253d

4.104.114.84.95
Last change on this file since 07a3253d was 07a3253d, checked in by Joel Sherrill <joel.sherrill@…>, on 11/23/98 at 19:07:58

Added base version of file system infrastructure. This includes a major
overhaul of the RTEMS system call interface. This base file system is
the "In-Memory File System" aka IMFS.

The design and implementation was done by the following people:

+ Joel Sherrill (joel@…)
+ Jennifer Averett (jennifer@…)
+ Steve "Mr Mount" Salitasc (salitasc@…)
+ Kerwin Wade (wade@…)

PROBLEMS
========

+ It is VERY likely that merging this will break the UNIX port. This

can/will be fixed.

+ There is likely some reentrancy/mutual exclusion needed.

+ Eventually, there should be a "mini-IMFS" description table to

eliminate links, symlinks, etc to save memory. All you need to
have "classic RTEMS" functionality is technically directories
and device IO. All the rest could be left out to save memory.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
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-1998.
13 *  On-Line Applications Research Corporation (OAR).
14 *  Copyright assigned to U.S. Government, 1994.
15 *
16 *  The license and distribution terms for this file may be
17 *  found in the file LICENSE in this distribution or at
18 *  http://www.OARcorp.com/rtems/license.html.
19 *
20 *  $Id$
21 */
22
23#include <errno.h>
24
25#include "imfs.h"
26#include "libio_.h"
27
28int IMFS_unmount(
29  rtems_filesystem_mount_table_entry_t *mt_entry
30)
31{
32  IMFS_jnode_t  *node;
33
34  node = mt_entry->mt_point_node.node_access;
35
36  /*
37   * Is the node that we are mounting onto a directory node ?
38   */
39
40  if ( node->type != IMFS_DIRECTORY )
41    set_errno_and_return_minus_one( ENOTDIR );
42
43  /*
44   * Did the node indicate that there was a directory mounted here?
45   */
46
47  if ( node->info.directory.mt_fs == NULL )
48    set_errno_and_return_minus_one( EINVAL );  /* XXX */
49
50  /*
51   * Set the mt_fs pointer to indicate that there is no longer
52   * a file system mounted to this point.
53   */
54 
55  node->info.directory.mt_fs = NULL;
56
57  return 0;
58}
Note: See TracBrowser for help on using the repository browser.