History log of /freebsd/sbin/newfs_msdos/mkfs_msdos.c (Results 1 – 25 of 39)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 17e85f59 06-Jun-2024 Stefan Eßer <se@FreeBSD.org>

newfs_msdos: align to multiple of cluster size by default

A previous commit aligned the start of the data area to a multiple of
the VM page size, in order to prevent extra buffers to be allocated
(w

newfs_msdos: align to multiple of cluster size by default

A previous commit aligned the start of the data area to a multiple of
the VM page size, in order to prevent extra buffers to be allocated
(which failed for 64 KB cluster size without this alignment).

Since a dependency on PAGE_SIZE caused compatibility issues, the
alignment was made conditional on this macro being defined, in the
previous commit. This lead to different behavior of this program
when built on FreeBSD vs. Linux (which does not define PAGE_SIZE).

This commit removes any use of PAGE_SIZE and instead always aligns
the start of the data area to a multiple of the cluster size.

The -A option is now implied, unless overridden by a specific number
of reserved sectors with the -r option.

Approved by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45436

show more ...


# 41ee91c6 04-Jun-2024 Stefan Eßer <se@FreeBSD.org>

newfs_msdos: fix build on non-FreeBSD systems

Disable data area alignment if the build environment does not define
PAGE_SIZE (e.g., when building on Linux or macOS).

Reported by: jrtc27
MFC after:

newfs_msdos: fix build on non-FreeBSD systems

Disable data area alignment if the build environment does not define
PAGE_SIZE (e.g., when building on Linux or macOS).

Reported by: jrtc27
MFC after: 1 week

show more ...


# 077f757d 02-Jun-2024 Stefan Eßer <se@FreeBSD.org>

newfs_msdos: align data area to VM page boundary by default

Without alignment, the data area will not be aligned with the buffer
cache, leading to overhead, higher write multiplication on SSD device

newfs_msdos: align data area to VM page boundary by default

Without alignment, the data area will not be aligned with the buffer
cache, leading to overhead, higher write multiplication on SSD devices
and issues with very large cluster sizes (see PR 277414).

The -A option used to align the start of the root directory to a
multiple of the cluster size, which happens to align the start of the
data area with a buffer page boundary in case of large clusters and
the default number of directory entries (512 entries requiring 16 KB
for FAT12 or FAT16, FAT32 puts the root directory into the data area).

This commit aligns the start of the data area with the page size, if
neither -A nor -r is used. It changes -A to align the start of the
data area (end of the root directory) to a multiple of the cluster
size, since this is the alignment that prevents write multiplication
due to clusters crossing erase block boundaries of a SSD device.
The -r option is unchanged and will prevent any automatic alignment
from occuring.

Approved by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45436

show more ...


Revision tags: release/14.1.0, release/13.3.0, release/14.0.0
# eba230af 25-Sep-2023 John Baldwin <jhb@FreeBSD.org>

Purge more stray embedded $FreeBSD$ strings

These do not use __FBSDID but instead use bare char arrays.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41957


Revision tags: release/13.2.0, release/12.4.0, release/13.1.0
# f775c417 29-Apr-2022 Mark Johnston <markj@FreeBSD.org>

newfs_msdos: Fix warnings that arise when compiled for makefs

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation


# 9990450e 31-Jan-2022 Eric van Gyzen <vangyzen@FreeBSD.org>

newfs_msdos: fix type of kern.maxphys

The type of the kern.maxphys sysctl OID is now ulong. Change the
local variable type to match.

Reviewed by: delphij, emaste
MFC after: 1 week
Sponsored by: De

newfs_msdos: fix type of kern.maxphys

The type of the kern.maxphys sysctl OID is now ulong. Change the
local variable type to match.

Reviewed by: delphij, emaste
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D34116

show more ...


Revision tags: release/12.3.0, release/13.0.0, release/12.2.0
# 1cbad9d7 05-Jul-2020 Xin LI <delphij@FreeBSD.org>

Use KERN_MAXPHYS.

Suggested by: imp
Reviewed by: imp, cem (earlier version), emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25563


# 33c2d974 04-Jul-2020 Xin LI <delphij@FreeBSD.org>

Gather writes to larger chunks (MAXPHYS) instead of issuing them in
sectors.

On my SanDisk Cruzer Blade 16GB USB stick this made formatting much faster:

x before
+ after
+--------------------------

Gather writes to larger chunks (MAXPHYS) instead of issuing them in
sectors.

On my SanDisk Cruzer Blade 16GB USB stick this made formatting much faster:

x before
+ after
+--------------------------------------------------------------------------+
|+ |
|+ x |
|+ x x|
|A MA||
+--------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 3 15.89 16.38 16 16.09 0.2570992
+ 3 0.32 0.37 0.35 0.34666667 0.025166115
Difference at 95.0% confidence
-15.7433 +/- 0.414029
-97.8455% +/- 0.25668%
(Student's t, pooled s = 0.182665)

Reviewed by: emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24508

show more ...


Revision tags: release/11.4.0
# 773bec08 27-Jan-2020 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r357119 through r357178.


# 162ae9c8 27-Jan-2020 Alex Richardson <arichardson@FreeBSD.org>

Allow bootstrapping makefs on older FreeBSD hosts and Linux/macOS

In order to do so we need to install the msdosfs headers to the bootstrap
sysroot and avoid includes of kernel headers that may not

Allow bootstrapping makefs on older FreeBSD hosts and Linux/macOS

In order to do so we need to install the msdosfs headers to the bootstrap
sysroot and avoid includes of kernel headers that may not exist on every
host (e.g. sys/lockmgr.h). This change should allow bootstrapping of makefs
on FreeBSD 11+ as well as Linux and macOS.

We also have to avoid using the IO_SYNC macro since that may not be
available. In makefs it is only used to switch between calling
bwrite() and bdwrite() which both call the same function. Therefore we
can simply always call bwrite().

For our CheriBSD builds we always bootstrap makefs by setting
LOCAL_XTOOL_DIRS='lib/libnetbsd usr.sbin/makefs' and use the makefs binary
from the build tree to create a bootable disk image.

Reviewed By: brooks
Differential Revision: https://reviews.freebsd.org/D23201

show more ...


# 2780a26b 08-Dec-2019 Xin LI <delphij@FreeBSD.org>

Fix a couple of minor issues with newfs_msdos:

- Do not unnecessarily strdup().
- Check return value of getdiskinfo(), if it failed, bail out.

Reviewed by: imp
MFC after: 2 weeks
Differential Rev

Fix a couple of minor issues with newfs_msdos:

- Do not unnecessarily strdup().
- Check return value of getdiskinfo(), if it failed, bail out.

Reviewed by: imp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D22729

show more ...


# d9aee13f 08-Nov-2019 Ed Maste <emaste@FreeBSD.org>

makefs: avoid warning when creating FAT filesystem on existing file

Previously the mkfs_msdos function (from newfs_msdos) emitted warnings
in the case that an image size is specified and the target

makefs: avoid warning when creating FAT filesystem on existing file

Previously the mkfs_msdos function (from newfs_msdos) emitted warnings
in the case that an image size is specified and the target is not a
file, or no size is specified and the target is not a character device.
The latter warning (not a character device) doesn't make sense when this
code is used in makefs, regardless of whether an image size is specified
or not.

Sponsored by: The FreeBSD Foundation

show more ...


Revision tags: release/12.1.0
# c5c3ba6b 03-Sep-2019 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r351317 through r351731.


# aa9cb40e 22-Aug-2019 Xin LI <delphij@FreeBSD.org>

When creating a new FAT32 filesystem, use "unknown" (0xFFFFFFFF) for
FSI_Nxt_Free instead of providing a wrong value.

With this change, fsck_msdosfs would no longer complain about invalid
FSInfo inf

When creating a new FAT32 filesystem, use "unknown" (0xFFFFFFFF) for
FSI_Nxt_Free instead of providing a wrong value.

With this change, fsck_msdosfs would no longer complain about invalid
FSInfo information.

MFC after: 2 weeks

show more ...


Revision tags: release/11.3.0, release/12.0.0, release/11.2.0
# 0531ab72 15-Jun-2018 Xin LI <delphij@FreeBSD.org>

Added option to cluster-align the start of the root directory.

Obtained from: Android
Obtained from: https://android.googlesource.com/platform/system/core/+/052f27562154d175267999106bd6bf18fc8c363e

Added option to cluster-align the start of the root directory.

Obtained from: Android
Obtained from: https://android.googlesource.com/platform/system/core/+/052f27562154d175267999106bd6bf18fc8c363e
Obtained from: https://android.googlesource.com/platform/system/core/+/8218b6aae9cd4a19fa074a8a8203fe9275b35447
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D15672

show more ...


# 4b49587c 06-Jan-2018 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r327341 through r327623.


# 783d8ed0 05-Jan-2018 Warner Losh <imp@FreeBSD.org>

Only call close if fd and fd1 are not -1.

CID: 1384018, 1384017


# 4fc74049 29-Dec-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r327169 through r327340.


# cd446151 28-Dec-2017 Warner Losh <imp@FreeBSD.org>

Close fd and fd1 before returning now that we're done with them.

CID: 978234, 978236


Revision tags: release/10.4.0, release/11.1.0
# 209be205 16-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r317971 through r318379.


# 28ef05f7 16-May-2017 Ed Maste <emaste@FreeBSD.org>

newfs_msdos: add -T (timestamp) option for reproducible builds

This includes some whitespace and minor bug fixes relative to NetBSD,
which will be submitted upstream at the conclusion of the makefs

newfs_msdos: add -T (timestamp) option for reproducible builds

This includes some whitespace and minor bug fixes relative to NetBSD,
which will be submitted upstream at the conclusion of the makefs
msdos update.

NetBSD revs:
mkfs_msdos.c 1.11
mkfs_msdos.h 1.4
newfs_msdos.8 1.22
newfs_msdos.c 1.44

Submitted by: Siva Mahadevan <smahadevan@freebsdfoundation.org>
Reviewed by: emaste
Obtained from: NetBSD
Sponsored by: The FreeBSD Foundation

show more ...


Revision tags: release/11.0.1, release/11.0.0
# f8fd1a95 01-Sep-2016 Enji Cooper <ngie@FreeBSD.org>

MFhead @ r305170


# aa0c5579 30-Aug-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r305029 through r305080.


# bf0d940a 30-Aug-2016 Warner Losh <imp@FreeBSD.org>

The code only converts from bpbHugeSectors to bpbSectors if the sum of
the hidden and huge sectors is less than or equal MAXU16. When
formatting in Windows bpbSectors is still used for 63488 sectors

The code only converts from bpbHugeSectors to bpbSectors if the sum of
the hidden and huge sectors is less than or equal MAXU16. When
formatting in Windows bpbSectors is still used for 63488 sectors and
2048 hidden (sum > MAXU16). The hidden sectors count is the number of
sectors before the FAT16 Boot Record so it shouldn't affect the sector
count. Attached patch (huge_sec_conversion.patch) to only check for
bpb.bpbHugeSectors <= MAXU16 when converting to bpbSectors.

Submitted by: Guy Yur
PR: 183234

show more ...


# 4a9fb9fb 30-Aug-2016 Warner Losh <imp@FreeBSD.org>

Remove CHS alignment. It's not needed and causes problems for the BBB
boot partition. NetBSD removed it in 1.10 in their repo some time ago.

Submitted by: Guy Yur
PR: 183234


12