Retire disk_blocksize().

This commit is contained in:
mlelstv 2014-12-31 20:13:41 +00:00
parent bac2fca3cf
commit 2fbc202964
3 changed files with 8 additions and 39 deletions

View File

@ -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 @@ and
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 @@ Return a pointer to the disk structure corresponding to the name provided,
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 @@ The functions typically called by device drivers are
.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 @@ fooattach(device_t parent, device_t self, void *aux)
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);

View File

@ -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>
@ -304,19 +304,6 @@ disk_isbusy(struct disk *diskp)
return iostat_isbusy(diskp->dk_stats);
}
/*
* 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.

View File

@ -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_destroy(struct disk *);
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 *);