From 972c4e43674c8f7855eb1ff4ccb9c2ec3be05bc0 Mon Sep 17 00:00:00 2001 From: hannken Date: Sat, 14 Jun 2014 07:39:00 +0000 Subject: Change dk_lookup() to return an anonymous vnode not associated with any file system. Change all consumers of dk_lookup() to get the device from "v_rdev" instead of VOP_GETATTR() as specfs does not support VOP_GETATTR(). Devices obtained with dk_lookup() will no longer disappear on forced unmounts. Fix for PR kern/48849 (root mirror raid fails on shutdown) Welcome to 6.99.44 --- sys/dev/dm/dm_target_linear.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'sys/dev/dm/dm_target_linear.c') diff --git a/sys/dev/dm/dm_target_linear.c b/sys/dev/dm/dm_target_linear.c index 7a03f173fe2..098445be784 100644 --- a/sys/dev/dm/dm_target_linear.c +++ b/sys/dev/dm/dm_target_linear.c @@ -1,4 +1,4 @@ -/* $NetBSD: dm_target_linear.c,v 1.13 2011/10/14 09:23:30 hannken Exp $ */ +/* $NetBSD: dm_target_linear.c,v 1.14 2014/06/14 07:39:00 hannken Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -192,22 +192,14 @@ int dm_target_linear_deps(dm_table_entry_t * table_en, prop_array_t prop_array) { dm_target_linear_config_t *tlc; - struct vattr va; - - int error; if (table_en->target_config == NULL) return ENOENT; tlc = table_en->target_config; - vn_lock(tlc->pdev->pdev_vnode, LK_SHARED | LK_RETRY); - error = VOP_GETATTR(tlc->pdev->pdev_vnode, &va, curlwp->l_cred); - VOP_UNLOCK(tlc->pdev->pdev_vnode); - if (error != 0) - return error; - - prop_array_add_uint64(prop_array, (uint64_t) va.va_rdev); + prop_array_add_uint64(prop_array, + (uint64_t) tlc->pdev->pdev_vnode->v_rdev); return 0; } -- cgit