diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-11-05 21:10:54 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-11-05 21:10:54 +0000 |
commit | 94b357c2b31be20b51784dc6f2ae837d58777cbd (patch) | |
tree | 73e3ec3694451a65df6b0688e3e0e04175ea0528 /c/src/libfs/src/imfs/imfs_unlink.c | |
parent | Removed. (diff) | |
download | rtems-94b357c2b31be20b51784dc6f2ae837d58777cbd.tar.bz2 |
Unmount was failing as a side-effect of splitting the rmnod handler
and not handling every case properly.
Diffstat (limited to '')
-rw-r--r-- | c/src/libfs/src/imfs/imfs_unlink.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/c/src/libfs/src/imfs/imfs_unlink.c b/c/src/libfs/src/imfs/imfs_unlink.c index e138064e61..03938937f4 100644 --- a/c/src/libfs/src/imfs/imfs_unlink.c +++ b/c/src/libfs/src/imfs/imfs_unlink.c @@ -49,9 +49,10 @@ int IMFS_unlink( the_link.node_access = node->info.hard_link.link_node; /* - * If this is the last referance to the node - * Free the node that the link points to. + * If removing the last hard link to a node, then we need + * to remove the node that is a link and the node itself. */ + node->info.hard_link.link_node->st_nlink --; IMFS_update_ctime( node->info.hard_link.link_node ); if ( node->info.hard_link.link_node->st_nlink < 1) { @@ -61,7 +62,11 @@ int IMFS_unlink( } } - result = (*loc->handlers->rmnod)( &the_link ); + /* + * Now actually free the node we were asked to free. + */ + + result = (*loc->handlers->rmnod)( loc ); return result; } |