Bug 268610 - mounting cdevs as regular vnodes
Summary: mounting cdevs as regular vnodes
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-28 06:33 UTC by Yakov Galka
Modified: 2022-12-28 06:42 UTC (History)
1 user (show)

See Also:


Attachments
prototype implementation (4.69 KB, application/gzip)
2022-12-28 06:33 UTC, Yakov Galka
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yakov Galka 2022-12-28 06:33:04 UTC
Created attachment 239079 [details]
prototype implementation

FreeBSD does not implement filesystem caching for i/o done on cdevs. This makes i/o slow when done on raw devices, and renders impossible to mmap a cdev (which is supported by some other OSes).

I'm attaching my implementation of a 'rawfs' filesystem:

    mount -t rawfs /dev/xxx /mnt

then i/o on /mnt will be fully buffered, while giving a read-only view of the raw data on the device.

This can be seen as an inverse of `mdconfig`.

If there's an interest in including this functionality in the base system, please review the attached code. As it's evident, I had no prior experience working with FreeBSD kernel code, so any comments are welcome.