From 9b339ade74fe104463a617c0ee60733aa5d9d430 Mon Sep 17 00:00:00 2001 From: Pedro Martelletto Date: Tue, 11 Jul 2006 22:02:09 +0000 Subject: Don't hold up a vnode for the VAT when a unode is sufficient --- sys/isofs/udf/udf.h | 4 ++-- sys/isofs/udf/udf_subr.c | 13 +++++++------ sys/isofs/udf/udf_vfsops.c | 5 ++++- 3 files changed, 13 insertions(+), 9 deletions(-) (limited to 'sys/isofs') diff --git a/sys/isofs/udf/udf.h b/sys/isofs/udf/udf.h index 4ffdd003406..67691fc0c94 100644 --- a/sys/isofs/udf/udf.h +++ b/sys/isofs/udf/udf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: udf.h,v 1.9 2006/07/09 04:23:09 pedro Exp $ */ +/* $OpenBSD: udf.h,v 1.10 2006/07/11 22:02:08 pedro Exp $ */ /* * Copyright (c) 2001, 2002 Scott Long @@ -62,7 +62,7 @@ struct umount { int um_bmask; uint32_t um_start; uint32_t um_len; - struct vnode *um_vat; + struct unode *um_vat; struct long_ad um_root_icb; LIST_HEAD(udf_hash_lh, unode) *um_hashtbl; u_long um_hashsz; diff --git a/sys/isofs/udf/udf_subr.c b/sys/isofs/udf/udf_subr.c index d976a37fd8f..4943c8a0745 100644 --- a/sys/isofs/udf/udf_subr.c +++ b/sys/isofs/udf/udf_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udf_subr.c,v 1.10 2006/07/11 16:24:09 pedro Exp $ */ +/* $OpenBSD: udf_subr.c,v 1.11 2006/07/11 22:02:08 pedro Exp $ */ /* * Copyright (c) 2006, Miodrag Vallat @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -196,7 +197,9 @@ udf_vat_get(struct umount *ump, uint32_t lb) up = VTOU(vp); up->u_vatlen = (letoh64(up->u_fentry->inf_len) - 36) >> 2; - ump->um_vat = vp; + ump->um_vat = malloc(sizeof(struct unode), M_UDFMOUNT, M_WAITOK); + *ump->um_vat = *up; + ump->um_flags &= ~UDF_MNT_FIND_VAT; ump->um_flags |= UDF_MNT_USES_VAT; @@ -216,7 +219,7 @@ udf_vat_map(struct umount *ump, uint32_t *sector) } /* Sanity check the given sector */ - if (*sector >= VTOU(ump->um_vat)->u_vatlen) + if (*sector >= ump->um_vat->u_vatlen) return (EINVAL); return (udf_vat_read(ump, sector)); @@ -226,19 +229,17 @@ udf_vat_map(struct umount *ump, uint32_t *sector) int udf_vat_read(struct umount *ump, uint32_t *sector) { - struct unode *up; struct buf *bp; uint8_t *data; int error, size; - up = VTOU(ump->um_vat); size = 4; /* * Note that we rely on the buffer cache to keep frequently accessed * buffers around to avoid reading them from the disk all the time. */ - error = udf_readatoffset(up, &size, *sector << 2, &bp, &data); + error = udf_readatoffset(ump->um_vat, &size, *sector << 2, &bp, &data); if (error) { if (bp != NULL) brelse(bp); diff --git a/sys/isofs/udf/udf_vfsops.c b/sys/isofs/udf/udf_vfsops.c index efd87e012f5..d30612c67db 100644 --- a/sys/isofs/udf/udf_vfsops.c +++ b/sys/isofs/udf/udf_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udf_vfsops.c,v 1.20 2006/07/11 16:24:09 pedro Exp $ */ +/* $OpenBSD: udf_vfsops.c,v 1.21 2006/07/11 22:02:08 pedro Exp $ */ /* * Copyright (c) 2001, 2002 Scott Long @@ -432,6 +432,9 @@ udf_unmount(struct mount *mp, int mntflags, struct proc *p) devvp->v_specmountpoint = NULL; vrele(devvp); + if (ump->um_flags & UDF_MNT_USES_VAT) + free(ump->um_vat, M_UDFMOUNT); + if (ump->um_stbl != NULL) free(ump->um_stbl, M_UDFMOUNT); -- cgit v1.2.3