summaryrefslogtreecommitdiffstats
path: root/release/libdisk/create_chunk.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1995-05-24 08:59:40 +0000
committerjkh <jkh@FreeBSD.org>1995-05-24 08:59:40 +0000
commit33ee1a22eddb8029d1051a4c04f35b72dcc1e6da (patch)
tree540c17fff92c76ed5ebab2195bb3b459f0f7950f /release/libdisk/create_chunk.c
parent206d10d33f0d45afde92ec0556a726d8e36b10c7 (diff)
downloadFreeBSD-src-33ee1a22eddb8029d1051a4c04f35b72dcc1e6da.zip
FreeBSD-src-33ee1a22eddb8029d1051a4c04f35b72dcc1e6da.tar.gz
Align slices to cylinder boundries.
Submitted By: phk
Diffstat (limited to 'release/libdisk/create_chunk.c')
-rw-r--r--release/libdisk/create_chunk.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/release/libdisk/create_chunk.c b/release/libdisk/create_chunk.c
index ab1f082..f7bca32 100644
--- a/release/libdisk/create_chunk.c
+++ b/release/libdisk/create_chunk.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: create_chunk.c,v 1.17 1995/05/15 19:03:08 phk Exp $
+ * $Id: create_chunk.c,v 1.18 1995/05/20 19:11:44 phk Exp $
*
*/
@@ -155,11 +155,18 @@ int
Create_Chunk(struct disk *d, u_long offset, u_long size, chunk_e type, int subtype, u_long flags)
{
int i;
+ u_long l;
+ /* Never use the first track */
if (!offset) {
offset += d->bios_sect;
size -= d->bios_sect;
}
+
+ /* Always end on cylinder boundary */
+ l = (offset+size) % (d->bios_sect * d->bios_hd);
+ size -= l;
+
i = Add_Chunk(d,offset,size,"X",type,subtype,flags);
Fixup_Names(d);
return i;
OpenPOWER on IntegriCloud