Module Name:    src
Committed By:   mlelstv
Date:           Wed Dec 31 20:13:41 UTC 2014

Modified Files:
        src/share/man/man9: disk.9
        src/sys/kern: subr_disk.c
        src/sys/sys: disk.h

Log Message:
Retire disk_blocksize().


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/share/man/man9/disk.9
cvs rdiff -u -r1.109 -r1.110 src/sys/kern/subr_disk.c
cvs rdiff -u -r1.62 -r1.63 src/sys/sys/disk.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man9/disk.9
diff -u src/share/man/man9/disk.9:1.39 src/share/man/man9/disk.9:1.40
--- src/share/man/man9/disk.9:1.39	Mon Dec 29 19:20:22 2014
+++ src/share/man/man9/disk.9	Wed Dec 31 20:13:41 2014
@@ -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 c
 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
 .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
 	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);

Index: src/sys/kern/subr_disk.c
diff -u src/sys/kern/subr_disk.c:1.109 src/sys/kern/subr_disk.c:1.110
--- src/sys/kern/subr_disk.c:1.109	Wed Dec 31 19:58:59 2014
+++ src/sys/kern/subr_disk.c	Wed Dec 31 20:13:41 2014
@@ -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 @@ disk_isbusy(struct disk *diskp)
 }
 
 /*
- * 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).

Index: src/sys/sys/disk.h
diff -u src/sys/sys/disk.h:1.62 src/sys/sys/disk.h:1.63
--- src/sys/sys/disk.h:1.62	Wed Dec 31 20:04:56 2014
+++ src/sys/sys/disk.h	Wed Dec 31 20:13:41 2014
@@ -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 *);

Reply via email to