source: rtems/c/src/exec/libfs/src/imfs/imfs_unmount.c @ d6b1d73

4.104.114.84.95
Last change on this file since d6b1d73 was d6b1d73, checked in by Joel Sherrill <joel.sherrill@…>, on 01/22/01 at 14:05:14

2001-01-22 Ralf Corsepius <corsepiu@…>

  • configure.in: Add src/imfs/config.h
  • src/imfs/Makefile.am: Add INCLUDES += -I. to pickup config.h
  • src/imfs/.cvsignore: Add config.h and stamp-h
  • src/imfs/*.c: Add config.h support.
  • 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#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
31int IMFS_unmount(
32  rtems_filesystem_mount_table_entry_t *mt_entry
33)
34{
35  IMFS_jnode_t  *node;
36
37  node = mt_entry->mt_point_node.node_access;
38
39  /*
40   * Is the node that we are mounting onto a directory node ?
41   */
42
43  if ( node->type != IMFS_DIRECTORY )
44    set_errno_and_return_minus_one( ENOTDIR );
45
46  /*
47   * Did the node indicate that there was a directory mounted here?
48   */
49
50  if ( node->info.directory.mt_fs == NULL )
51    set_errno_and_return_minus_one( EINVAL );  /* XXX */
52
53  /*
54   * Set the mt_fs pointer to indicate that there is no longer
55   * a file system mounted to this point.
56   */
57 
58  node->info.directory.mt_fs = NULL;
59
60  return 0;
61}
Note: See TracBrowser for help on using the repository browser.