Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ufs/lfs Merge -r1.37 of ufs_dirhash.c:
details: https://anonhg.NetBSD.org/src/rev/550ae024322f
branches: trunk
changeset: 346014:550ae024322f
user: dholland <dholland%NetBSD.org@localhost>
date: Mon Jun 20 01:53:38 2016 +0000
description:
Merge -r1.37 of ufs_dirhash.c:
clear i_dirhash sooner, but what lock protects it?
diffstat:
sys/ufs/lfs/ulfs_dirhash.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diffs (53 lines):
diff -r 7207101692f6 -r 550ae024322f sys/ufs/lfs/ulfs_dirhash.c
--- a/sys/ufs/lfs/ulfs_dirhash.c Mon Jun 20 01:50:13 2016 +0000
+++ b/sys/ufs/lfs/ulfs_dirhash.c Mon Jun 20 01:53:38 2016 +0000
@@ -1,5 +1,5 @@
-/* $NetBSD: ulfs_dirhash.c,v 1.16 2016/06/20 00:00:47 dholland Exp $ */
-/* from NetBSD: ufs_dirhash.c,v 1.36 2014/02/25 18:30:13 pooka Exp */
+/* $NetBSD: ulfs_dirhash.c,v 1.17 2016/06/20 01:53:38 dholland Exp $ */
+/* from NetBSD: ufs_dirhash.c,v 1.37 2014/12/20 00:28:05 christos Exp */
/*
* Copyright (c) 2001, 2002 Ian Dowse. All rights reserved.
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ulfs_dirhash.c,v 1.16 2016/06/20 00:00:47 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ulfs_dirhash.c,v 1.17 2016/06/20 01:53:38 dholland Exp $");
/*
* This implements a hash-based lookup scheme for ULFS directories.
@@ -258,6 +258,7 @@
return (0);
fail:
+ ip->i_dirhash = NULL;
DIRHASH_UNLOCK(dh);
if (dh->dh_hash != NULL) {
for (i = 0; i < narrays; i++)
@@ -269,7 +270,6 @@
kmem_free(dh->dh_blkfree, dh->dh_blkfreesz);
mutex_destroy(&dh->dh_lock);
pool_cache_put(ulfsdirhash_cache, dh);
- ip->i_dirhash = NULL;
atomic_add_int(&ulfs_dirhashmem, -memreqd);
return (-1);
}
@@ -286,6 +286,8 @@
if ((dh = ip->i_dirhash) == NULL)
return;
+ ip->i_dirhash = NULL;
+
if (dh->dh_onlist) {
DIRHASHLIST_LOCK();
if (dh->dh_onlist)
@@ -306,7 +308,6 @@
}
mutex_destroy(&dh->dh_lock);
pool_cache_put(ulfsdirhash_cache, dh);
- ip->i_dirhash = NULL;
atomic_add_int(&ulfs_dirhashmem, -mem);
}
Home |
Main Index |
Thread Index |
Old Index