From 94b357c2b31be20b51784dc6f2ae837d58777cbd Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 5 Nov 1999 21:10:54 +0000 Subject: Unmount was failing as a side-effect of splitting the rmnod handler and not handling every case properly. --- cpukit/libfs/src/imfs/imfs_unlink.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'cpukit/libfs/src/imfs/imfs_unlink.c') diff --git a/cpukit/libfs/src/imfs/imfs_unlink.c b/cpukit/libfs/src/imfs/imfs_unlink.c index e138064e61..03938937f4 100644 --- a/cpukit/libfs/src/imfs/imfs_unlink.c +++ b/cpukit/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; } -- cgit v1.2.3