source: rtems/c/src/lib/libc/imfs_unmount.c @ b2b4835

4.104.114.84.95
Last change on this file since b2b4835 was 08311cc3, checked in by Joel Sherrill <joel.sherrill@…>, on 11/17/99 at 17:51:34

Updated copyright notice.

  • 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-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 *  $Id$
20 */
21
22#include <errno.h>
23
24#include "imfs.h"
25#include "libio_.h"
26
27int IMFS_unmount(
28  rtems_filesystem_mount_table_entry_t *mt_entry
29)
30{
31  IMFS_jnode_t  *node;
32
33  node = mt_entry->mt_point_node.node_access;
34
35  /*
36   * Is the node that we are mounting onto a directory node ?
37   */
38
39  if ( node->type != IMFS_DIRECTORY )
40    set_errno_and_return_minus_one( ENOTDIR );
41
42  /*
43   * Did the node indicate that there was a directory mounted here?
44   */
45
46  if ( node->info.directory.mt_fs == NULL )
47    set_errno_and_return_minus_one( EINVAL );  /* XXX */
48
49  /*
50   * Set the mt_fs pointer to indicate that there is no longer
51   * a file system mounted to this point.
52   */
53 
54  node->info.directory.mt_fs = NULL;
55
56  return 0;
57}
Note: See TracBrowser for help on using the repository browser.