Allow for the exclusive selection of `direct' for rdonly mounts; its disabled

for now since its a lot slower than `rmw' access.

For archs that have trouble with `rmw' for whatever reason can so use it as a
scapegoat to allways mount savely rdonly though slower.
This commit is contained in:
reinoud 2008-11-28 15:29:47 +00:00
parent 6c9852e4a8
commit df11d3f1f5
2 changed files with 12 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: udf_strat_direct.c,v 1.5 2008/08/29 15:04:18 reinoud Exp $ */
/* $NetBSD: udf_strat_direct.c,v 1.6 2008/11/28 15:29:47 reinoud 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.5 2008/08/29 15:04:18 reinoud Exp $");
__KERNEL_RCSID(0, "$NetBSD: udf_strat_direct.c,v 1.6 2008/11/28 15:29:47 reinoud Exp $");
#endif /* not lint */
@ -278,7 +278,8 @@ udf_queue_buf_direct(struct udf_strat_args *args)
/* use disc sheduler */
class = ump->discinfo.mmc_class;
KASSERT((class == MMC_CLASS_UNKN) || (class == MMC_CLASS_DISC) ||
(ump->discinfo.mmc_cur & MMC_CAP_HW_DEFECTFREE));
(ump->discinfo.mmc_cur & MMC_CAP_HW_DEFECTFREE) ||
(ump->vfs_mountp->mnt_flag & MNT_RDONLY));
if (queue == UDF_SHED_READING) {
DPRINTF(SHEDULE, ("\nudf_issue_buf READ %p : sector %d type %d,"

View File

@ -1,4 +1,4 @@
/* $NetBSD: udf_subr.c,v 1.74 2008/11/28 14:33:36 reinoud Exp $ */
/* $NetBSD: udf_subr.c,v 1.75 2008/11/28 15:29:47 reinoud Exp $ */
/*
* Copyright (c) 2006, 2008 Reinoud Zandijk
@ -29,7 +29,7 @@
#include <sys/cdefs.h>
#ifndef lint
__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.74 2008/11/28 14:33:36 reinoud Exp $");
__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.75 2008/11/28 15:29:47 reinoud Exp $");
#endif /* not lint */
@ -1991,6 +1991,12 @@ udf_process_vds(struct udf_mount *ump) {
if (n_spar)
ump->strategy = &udf_strat_rmw;
#if 0
/* read-only access won't benefit from the other shedulers */
if (ump->vfs_mountp->mnt_flag & MNT_RDONLY)
ump->strategy = &udf_strat_direct;
#endif
/* print results */
DPRINTF(VOLUMES, ("\tdata partition %d\n", ump->data_part));
DPRINTF(VOLUMES, ("\t\talloc scheme %d\n", ump->vtop_alloc[ump->data_part]));