source: rtems/cpukit/libfs/src/imfs/imfs_mount.c @ c499856

4.115
Last change on this file since c499856 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 902 bytes
Line 
1/**
2 * @file
3 *
4 * @brief Mount an IMFS
5 * @ingroup IMFS
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-1999.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  Modifications to support reference counting in the file system are
13 *  Copyright (c) 2012 embedded brains GmbH.
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.rtems.org/license/LICENSE.
18 */
19
20#if HAVE_CONFIG_H
21  #include "config.h"
22#endif
23
24#include "imfs.h"
25
26int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry )
27{
28  int rv = 0;
29  IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access;
30
31  if ( IMFS_is_directory( node ) ) {
32    if ( node->info.directory.mt_fs == NULL ) {
33      node->info.directory.mt_fs = mt_entry;
34    } else {
35      errno = EBUSY;
36      rv = -1;
37    }
38  } else {
39    errno = ENOTDIR;
40    rv = -1;
41  }
42
43  return rv;
44}
Note: See TracBrowser for help on using the repository browser.