aboutsummaryrefslogtreecommitdiff
path: root/libdiskfs/peropen-rele.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdiskfs/peropen-rele.c')
-rw-r--r--libdiskfs/peropen-rele.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/libdiskfs/peropen-rele.c b/libdiskfs/peropen-rele.c
index 877137bb..e8d83b55 100644
--- a/libdiskfs/peropen-rele.c
+++ b/libdiskfs/peropen-rele.c
@@ -1,5 +1,5 @@
-/*
- Copyright (C) 1994, 1996, 1997 Free Software Foundation
+/*
+ Copyright (C) 1994, 1996, 1997, 2014-2019 Free Software Foundation
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -12,8 +12,7 @@
General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+ along with the GNU Hurd. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/file.h>
#include "priv.h"
@@ -33,14 +32,9 @@ diskfs_release_peropen (struct peropen *po)
if (po->shadow_root_parent)
mach_port_deallocate (mach_task_self (), po->shadow_root_parent);
-
- if (po->lock_status != LOCK_UN)
- {
- pthread_mutex_lock (&po->np->lock);
- fshelp_acquire_lock (&po->np->userlock, &po->lock_status,
- &po->np->lock, LOCK_UN);
- diskfs_nput (po->np);
- }
+ fshelp_rlock_drop_peropen (&po->lock_status);
+ if (fshelp_rlock_peropen_status(&po->lock_status) != LOCK_UN)
+ diskfs_nput (po->np);
else
diskfs_nrele (po->np);