Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/fs/udf Remove dubious vhold()/holdrele() from write_logv...
details: https://anonhg.NetBSD.org/src/rev/2a033a373b16
branches: trunk
changeset: 340850:2a033a373b16
user: hannken <hannken%NetBSD.org@localhost>
date: Tue Oct 06 08:57:34 2015 +0000
description:
Remove dubious vhold()/holdrele() from write_logvol_dscr strategies.
The udf_node already gets locked with UDF_LOCK_NODE() and udf_reclaim()
will wait for the lock to clear.
diffstat:
sys/fs/udf/udf_strat_direct.c | 11 ++---------
sys/fs/udf/udf_strat_rmw.c | 8 ++------
sys/fs/udf/udf_strat_sequential.c | 12 ++----------
3 files changed, 6 insertions(+), 25 deletions(-)
diffs (129 lines):
diff -r 4e3e9bbd6c02 -r 2a033a373b16 sys/fs/udf/udf_strat_direct.c
--- a/sys/fs/udf/udf_strat_direct.c Tue Oct 06 01:18:47 2015 +0000
+++ b/sys/fs/udf/udf_strat_direct.c Tue Oct 06 08:57:34 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_strat_direct.c,v 1.12 2013/10/30 08:41:38 mrg Exp $ */
+/* $NetBSD: udf_strat_direct.c,v 1.13 2015/10/06 08:57:34 hannken Exp $ */
/*
* Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: udf_strat_direct.c,v 1.12 2013/10/30 08:41:38 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udf_strat_direct.c,v 1.13 2015/10/06 08:57:34 hannken Exp $");
#endif /* not lint */
@@ -118,8 +118,6 @@
UDF_UNLOCK_NODE(udf_node, 0);
wakeup(&udf_node->outstanding_nodedscr);
}
- /* unreference the vnode so it can be recycled */
- holdrele(udf_node->vnode);
putiobuf(buf);
}
@@ -208,9 +206,6 @@
if (error)
goto out;
- /* add reference to the vnode to prevent recycling */
- vhold(udf_node->vnode);
-
if (waitfor) {
DPRINTF(WRITE, ("udf_write_nodedscr: sync write\n"));
@@ -224,8 +219,6 @@
/* will be UNLOCKED in call back */
return error;
}
-
- holdrele(udf_node->vnode);
out:
udf_node->outstanding_nodedscr--;
if (udf_node->outstanding_nodedscr == 0) {
diff -r 4e3e9bbd6c02 -r 2a033a373b16 sys/fs/udf/udf_strat_rmw.c
--- a/sys/fs/udf/udf_strat_rmw.c Tue Oct 06 01:18:47 2015 +0000
+++ b/sys/fs/udf/udf_strat_rmw.c Tue Oct 06 08:57:34 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_strat_rmw.c,v 1.26 2015/09/12 19:50:08 christos Exp $ */
+/* $NetBSD: udf_strat_rmw.c,v 1.27 2015/10/06 08:57:34 hannken Exp $ */
/*
* Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: udf_strat_rmw.c,v 1.26 2015/09/12 19:50:08 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udf_strat_rmw.c,v 1.27 2015/10/06 08:57:34 hannken Exp $");
#endif /* not lint */
@@ -719,9 +719,6 @@
if (error)
return error;
- /* paranoia: add reference to the vnode to prevent recycling */
- vhold(udf_node->vnode);
-
/* get our eccline */
eccline = udf_geteccline(ump, sectornr, 0);
eccsect = sectornr - eccline->start_sector;
@@ -761,7 +758,6 @@
UDF_UNLOCK_NODE(udf_node, 0);
wakeup(&udf_node->outstanding_nodedscr);
}
- holdrele(udf_node->vnode);
udf_puteccline(eccline);
/* XXX waitfor not used */
diff -r 4e3e9bbd6c02 -r 2a033a373b16 sys/fs/udf/udf_strat_sequential.c
--- a/sys/fs/udf/udf_strat_sequential.c Tue Oct 06 01:18:47 2015 +0000
+++ b/sys/fs/udf/udf_strat_sequential.c Tue Oct 06 08:57:34 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_strat_sequential.c,v 1.13 2014/03/23 09:34:42 christos Exp $ */
+/* $NetBSD: udf_strat_sequential.c,v 1.14 2015/10/06 08:57:34 hannken Exp $ */
/*
* Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: udf_strat_sequential.c,v 1.13 2014/03/23 09:34:42 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udf_strat_sequential.c,v 1.14 2015/10/06 08:57:34 hannken Exp $");
#endif /* not lint */
@@ -129,9 +129,6 @@
wakeup(&udf_node->outstanding_nodedscr);
}
- /* unreference the vnode so it can be recycled */
- holdrele(udf_node->vnode);
-
putiobuf(buf);
}
@@ -219,9 +216,6 @@
goto out;
}
- /* add reference to the vnode to prevent recycling */
- vhold(udf_node->vnode);
-
if (waitfor) {
DPRINTF(WRITE, ("udf_write_logvol_dscr: sync write\n"));
@@ -235,8 +229,6 @@
/* will be UNLOCKED in call back */
return error;
}
-
- holdrele(udf_node->vnode);
out:
udf_node->outstanding_nodedscr--;
if (udf_node->outstanding_nodedscr == 0) {
Home |
Main Index |
Thread Index |
Old Index