Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/newfs_msdos There are two problems with insisting the F...



details:   https://anonhg.NetBSD.org/src/rev/1d064ac7e3e3
branches:  trunk
changeset: 783335:1d064ac7e3e3
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Sat Dec 15 04:34:36 2012 +0000

description:
There are two problems with insisting the FAT file system size be a multiple
of track-size units:  2) the FAT metadata areas may not be a multiple of a
"track", 1) the partition may not be track-aligned to begin with, 0) what's
a "track"? is it something a robot rover leaves on Mars?

diffstat:

 sbin/newfs_msdos/newfs_msdos.c |  11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diffs (34 lines):

diff -r f523b21f8878 -r 1d064ac7e3e3 sbin/newfs_msdos/newfs_msdos.c
--- a/sbin/newfs_msdos/newfs_msdos.c    Sat Dec 15 04:29:53 2012 +0000
+++ b/sbin/newfs_msdos/newfs_msdos.c    Sat Dec 15 04:34:36 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: newfs_msdos.c,v 1.39 2012/11/04 14:27:15 jakllsch Exp $        */
+/*     $NetBSD: newfs_msdos.c,v 1.40 2012/12/15 04:34:36 jakllsch Exp $        */
 
 /*
  * Copyright (c) 1998 Robert Nordier
@@ -33,7 +33,7 @@
 static const char rcsid[] =
   "$FreeBSD: src/sbin/newfs_msdos/newfs_msdos.c,v 1.15 2000/10/10 01:49:37 wollman Exp $";
 #else
-__RCSID("$NetBSD: newfs_msdos.c,v 1.39 2012/11/04 14:27:15 jakllsch Exp $");
+__RCSID("$NetBSD: newfs_msdos.c,v 1.40 2012/12/15 04:34:36 jakllsch Exp $");
 #endif
 #endif /* not lint */
 
@@ -409,15 +409,8 @@
     if (oflag)
        bpb.hid = opt_o;
     if (!(opt_f || (opt_h && opt_u && opt_S && opt_s && oflag))) {
-       off_t delta;
        getbpbinfo(fd, fname, dtype, oflag, &bpb, opt_create != 0);
        bpb.bsec -= (opt_ofs / bpb.bps);
-       delta = bpb.bsec % bpb.spt;
-       if (delta != 0) {
-           warnx("trim %d sectors to adjust to a multiple of %d",
-               (int)delta, bpb.spt);
-           bpb.bsec -= delta;
-       }
        if (bpb.spc == 0) {     /* set defaults */
            if (bpb.bsec <= 6000)       /* about 3MB -> 512 bytes */
                bpb.spc = 1;



Home | Main Index | Thread Index | Old Index