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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libc/] [imfs_unmount.c] - Blame information for rev 507

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
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: imfs_unmount.c,v 1.2 2001-09-27 12:01:15 chris Exp $
20
 */
21
 
22
#include <errno.h>
23
 
24
#include "imfs.h"
25
#include "libio_.h"
26
 
27
int 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
}

powered by: WebSVN 2.1.0

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