Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Retire disk_blocksize().
details: https://anonhg.NetBSD.org/src/rev/a58cfebde7e8
branches: trunk
changeset: 335259:a58cfebde7e8
user: mlelstv <mlelstv%NetBSD.org@localhost>
date: Wed Dec 31 20:13:41 2014 +0000
description:
Retire disk_blocksize().
diffstat:
share/man/man9/disk.9 | 27 +++++----------------------
sys/kern/subr_disk.c | 17 ++---------------
sys/sys/disk.h | 3 +--
3 files changed, 8 insertions(+), 39 deletions(-)
diffs (132 lines):
diff -r 43e4985e6818 -r a58cfebde7e8 share/man/man9/disk.9
--- a/share/man/man9/disk.9 Wed Dec 31 20:04:56 2014 +0000
+++ b/share/man/man9/disk.9 Wed Dec 31 20:13:41 2014 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: disk.9,v 1.39 2014/12/29 19:20:22 wiz Exp $
+.\" $NetBSD: disk.9,v 1.40 2014/12/31 20:13:41 mlelstv Exp $
.\"
.\" Copyright (c) 1995, 1996 Jason R. Thorpe.
.\" All rights reserved.
@@ -44,7 +44,6 @@
.Nm disk_unbusy ,
.Nm disk_isbusy ,
.Nm disk_find ,
-.Nm disk_blocksize ,
.Nm disk_set_info
.Nd generic disk framework
.Sh SYNOPSIS
@@ -70,8 +69,6 @@
.Ft struct disk *
.Fn disk_find "const char *"
.Ft void
-.Fn disk_blocksize "struct disk *" "int blocksize"
-.Ft void
.Fn disk_set_info "device_t" "struct disk *" "const char *type"
.Sh DESCRIPTION
The
@@ -139,7 +136,7 @@
pseudo-device drivers.
.Pp
The following is a brief description of each function in the framework:
-.Bl -tag -width ".Fn disk_blocksize"
+.Bl -tag -width ".Fn disk_set_info"
.It Fn disk_init
Initialize the disk structure.
.It Fn disk_attach
@@ -197,20 +194,9 @@
or
.Dv NULL
if the disk does not exist.
-.It Fn disk_blocksize
-Initialize
-.Fa dk_blkshift
-and
-.Fa dk_byteshift
-members of
-.Fa struct disk
-with suitable values derived from the supplied physical blocksize.
-It is only necessary to call this function if the device's physical blocksize
-is not
-.Dv DEV_BSIZE .
.It Fn disk_set_info
-Setup disk-info dictionary, the driver must have initialized the
-dk_geom member of
+Setup disk-info dictionary and other dependent values of the disk structure,
+the driver must have initialized the dk_geom member of
.Fa struct disk
with suitable values.
If
@@ -229,7 +215,7 @@
.Fn disk_busy ,
.Fn disk_unbusy ,
and
-.Fn disk_blocksize .
+.Fn disk_set_info .
The function
.Fn disk_find
is provided as a utility function.
@@ -371,9 +357,6 @@
disk_attach(\*[Am]sc-\*[Gt]sc_dk);
/* Read geometry and fill in pertinent parts of disklabel. */
- [ . . . ]
- disk_blocksize(\*[Am]sc-\*[Gt]sc_dk, bytes_per_sector);
-
/* Initialize geometry values of the disk structure */
[ . . . ]
disk_set_info(\*[Am]self\*[Gt], \*[Am]sc-\*[Gt]sc_dk, type);
diff -r 43e4985e6818 -r a58cfebde7e8 sys/kern/subr_disk.c
--- a/sys/kern/subr_disk.c Wed Dec 31 20:04:56 2014 +0000
+++ b/sys/kern/subr_disk.c Wed Dec 31 20:13:41 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_disk.c,v 1.109 2014/12/31 19:58:59 christos Exp $ */
+/* $NetBSD: subr_disk.c,v 1.110 2014/12/31 20:13:41 mlelstv Exp $ */
/*-
* Copyright (c) 1996, 1997, 1999, 2000, 2009 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.109 2014/12/31 19:58:59 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.110 2014/12/31 20:13:41 mlelstv Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -305,19 +305,6 @@
}
/*
- * Set the physical blocksize of a disk, in bytes.
- * Only necessary if blocksize != DEV_BSIZE.
- */
-void
-disk_blocksize(struct disk *diskp, int blocksize)
-{
-
- diskp->dk_blkshift = DK_BSIZE2BLKSHIFT(blocksize);
- diskp->dk_byteshift = DK_BSIZE2BYTESHIFT(blocksize);
- diskp->dk_geom.dg_secsize = DEV_BSIZE << diskp->dk_blkshift;
-}
-
-/*
* Bounds checking against the media size, used for the raw partition.
* secsize, mediasize and b_blkno must all be the same units.
* Possibly this has to be DEV_BSIZE (512).
diff -r 43e4985e6818 -r a58cfebde7e8 sys/sys/disk.h
--- a/sys/sys/disk.h Wed Dec 31 20:04:56 2014 +0000
+++ b/sys/sys/disk.h Wed Dec 31 20:13:41 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: disk.h,v 1.62 2014/12/31 20:04:56 christos Exp $ */
+/* $NetBSD: disk.h,v 1.63 2014/12/31 20:13:41 mlelstv Exp $ */
/*-
* Copyright (c) 1996, 1997, 2004 The NetBSD Foundation, Inc.
@@ -532,7 +532,6 @@
void disk_busy(struct disk *);
void disk_unbusy(struct disk *, long, int);
bool disk_isbusy(struct disk *);
-void disk_blocksize(struct disk *, int);
struct disk *disk_find(const char *);
int disk_ioctl(struct disk *, dev_t, u_long, void *, int, struct lwp *);
void disk_set_info(device_t, struct disk *, const char *);
Home |
Main Index |
Thread Index |
Old Index