Page MenuHomeFreeBSD

newfs_msdos: rework option parsing to match NetBSD's
ClosedPublic

Authored by emaste on Oct 15 2015, 2:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 10, 3:15 AM
Unknown Object (File)
Fri, Dec 6, 1:55 AM
Unknown Object (File)
Fri, Dec 6, 1:55 AM
Unknown Object (File)
Mon, Dec 2, 12:04 AM
Unknown Object (File)
Sun, Dec 1, 11:43 PM
Unknown Object (File)
Nov 14 2024, 10:04 PM
Unknown Object (File)
Oct 30 2024, 11:00 AM
Unknown Object (File)
Oct 2 2024, 3:06 AM
Subscribers

Details

Summary

NetBSD split newfs_msdos in two so that they can reuse the file system creation part in makefs. I want to do the same thing with our makefs. This revision is a mechanical change that refactors the option handling as NetBSD has done so that it can be reviewed in isolation, and so that subsequent functional changes can be reviewed without extra noise.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emaste retitled this revision from to newfs_msdos: rework option parsing to match NetBSD's.
emaste updated this object.
emaste edited the test plan for this revision. (Show Details)
emaste added reviewers: kib, trasz.
sbin/newfs_msdos/newfs_msdos.c
104–117 ↗(On Diff #9418)

NetBSD renamed these as

struct bsbpb {
    u_int8_t bps[2];            /* bytes per sector */
    u_int8_t spc;               /* sectors per cluster */
    u_int8_t res[2];            /* reserved sectors */
    u_int8_t nft;               /* number of FATs */
    u_int8_t rde[2];            /* root directory entries */
    u_int8_t sec[2];            /* total sectors */
    u_int8_t mid;               /* media descriptor */
    u_int8_t spf[2];            /* sectors per FAT */
    u_int8_t spt[2];            /* sectors per track */
    u_int8_t hds[2];            /* drive heads */
    u_int8_t hid[4];            /* hidden sectors */
    u_int8_t bsec[4];           /* big total sectors */
};

and similar for the other structs. I plan to apply the same change to our tree to continue reducing diffs.

The change looks good. I don't know if we want further changes though.

sbin/newfs_msdos/newfs_msdos.c
104–117 ↗(On Diff #9418)

Hmm ... actually they didn't change: we did.

There was an effort to unify the headers as we carry three different headers for FAT in:

  1. the fs driver
  2. newfs
  3. fsck

There are also yet another version (EFI I think). We never finished unifying them but at least we were using similar names.

sbin/newfs_msdos/newfs_msdos.c
104–117 ↗(On Diff #9418)

Aha, you submitted the rename and @kib committed in rS203869. Perhaps we can get NetBSD to take the rename as well, or we'll just have to ignore that diff noise when comparing.

kib edited edge metadata.
This revision is now accepted and ready to land.Oct 15 2015, 3:54 PM
This revision was automatically updated to reflect the committed changes.