source: rtems/cpukit/libfs/src/imfs/imfs_rmnod.c @ 3c96bee

4.115
Last change on this file since 3c96bee was ef5e452, checked in by Alex Ivanov <alexivanov97@…>, on 12/20/12 at 15:45:31

libfs: Doxygen Enhancement Task #1

  • Property mode set to 100644
File size: 936 bytes
Line 
1/**
2 * @file
3 *
4 * @brief IMFS Node Removal Handler
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.com/license/LICENSE.
18 */
19
20#if HAVE_CONFIG_H
21  #include "config.h"
22#endif
23
24#include "imfs.h"
25
26int IMFS_rmnod(
27  const rtems_filesystem_location_info_t *parentloc,
28  const rtems_filesystem_location_info_t *loc
29)
30{
31  int rv = 0;
32  IMFS_jnode_t *node = loc->node_access;
33
34  node = (*node->control->node_remove)( node );
35  if ( node != NULL ) {
36    --node->reference_count;
37    --node->st_nlink;
38    if ( node->Parent != NULL ) {
39      IMFS_remove_from_directory( node );
40    }
41  } else {
42    rv = -1;
43  }
44
45  return rv;
46}
Note: See TracBrowser for help on using the repository browser.