diff options
| author | hannken <hannken@NetBSD.org> | 2014-06-14 07:39:00 +0000 |
|---|---|---|
| committer | hannken <hannken@NetBSD.org> | 2014-06-14 07:39:00 +0000 |
| commit | 972c4e43674c8f7855eb1ff4ccb9c2ec3be05bc0 (patch) | |
| tree | e2c9bfd67c6e90a9ceb05b5d48bc465955949342 /sys/dev/dm/dm_target_snapshot.c | |
| parent | 88f50c82d078baa660c1e8b3792370f7b177ce03 (diff) | |
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
Diffstat (limited to 'sys/dev/dm/dm_target_snapshot.c')
| -rw-r--r-- | sys/dev/dm/dm_target_snapshot.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/sys/dev/dm/dm_target_snapshot.c b/sys/dev/dm/dm_target_snapshot.c index 72d7cd43848..685e94ac6f3 100644 --- a/sys/dev/dm/dm_target_snapshot.c +++ b/sys/dev/dm/dm_target_snapshot.c @@ -1,4 +1,4 @@ -/* $NetBSD: dm_target_snapshot.c,v 1.15 2011/10/14 09:23:30 hannken Exp $ */ +/* $NetBSD: dm_target_snapshot.c,v 1.16 2014/06/14 07:39:00 hannken Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -348,33 +348,18 @@ dm_target_snapshot_deps(dm_table_entry_t * table_en, prop_array_t prop_array) { dm_target_snapshot_config_t *tsc; - struct vattr va; - - int error; if (table_en->target_config == NULL) return 0; tsc = table_en->target_config; - vn_lock(tsc->tsc_snap_dev->pdev_vnode, LK_SHARED | LK_RETRY); - error = VOP_GETATTR(tsc->tsc_snap_dev->pdev_vnode, &va, curlwp->l_cred); - VOP_UNLOCK(tsc->tsc_snap_dev->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) tsc->tsc_snap_dev->pdev_vnode->v_rdev); if (tsc->tsc_persistent_dev) { - - vn_lock(tsc->tsc_cow_dev->pdev_vnode, LK_SHARED | LK_RETRY); - error = VOP_GETATTR(tsc->tsc_cow_dev->pdev_vnode, &va, - curlwp->l_cred); - VOP_UNLOCK(tsc->tsc_cow_dev->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) tsc->tsc_cow_dev->pdev_vnode->v_rdev); } return 0; |
