Page MenuHomeFreeBSD

tarfs: Implement VOP_BMAP
ClosedPublic

Authored by markj on Apr 3 2024, 9:37 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jun 30, 7:57 PM
Unknown Object (File)
Sun, Jun 29, 4:02 PM
Unknown Object (File)
Sun, Jun 22, 1:01 PM
Unknown Object (File)
Sat, Jun 14, 9:47 PM
Unknown Object (File)
Sun, Jun 8, 8:48 AM
Unknown Object (File)
Sat, Jun 7, 8:50 AM
Unknown Object (File)
May 15 2025, 7:59 PM
Unknown Object (File)
May 13 2025, 8:03 PM
Subscribers

Details

Summary

This lets tarfs provide readahead/behind hints to the VFS, which helps
memory-mapped I/O performance, important when running faulting in
executables out of a tarfs mount as one might if tarfs is used to back
the root filesystem, for instance. This is particularly noticeable when
the backing tarball is zstd-compressed.

The implementation simply returns the extent of the virtual block
containing the target offset, clamped by the maximum I/O size. This is
perhaps simplistic; it effectively just chooses values that would
correspond to a single VOP_READ call in tarfs_read_file().

Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 56914
Build 53802: arc lint + arc unit

Event Timeline

markj requested review of this revision.Apr 3 2024, 9:37 PM
sys/fs/tarfs/tarfs_vnops.c
147

Why not spell the type as u_unt?

172

Can we move the a_bnp calculation before the loop? Then I do not see the loop is needed if both a_runp and a_runb are NULL.

markj marked 2 inline comments as done.

Apply feedback from kib.

This revision is now accepted and ready to land.Apr 4 2024, 3:31 PM

BTW we never call bmap with runp NULL and runb non-NULL? Perhaps a debugpre hook for VOP_BMAP stating this would be due.

In D44626#1017623, @kib wrote:

BTW we never call bmap with runp NULL and runb non-NULL? Perhaps a debugpre hook for VOP_BMAP stating this would be due.

UFS makes this assumption too, and indeed I do not see any such callers.

This revision was automatically updated to reflect the committed changes.