Page MenuHomeFreeBSD

tarfs: Implement VOP_BMAP
ClosedPublic

Authored by markj on Apr 3 2024, 9:37 PM.
Tags
None
Referenced Files
F102682626: D44626.diff
Fri, Nov 15, 7:40 PM
Unknown Object (File)
Tue, Nov 12, 12:49 AM
Unknown Object (File)
Mon, Nov 11, 11:59 PM
Unknown Object (File)
Mon, Nov 11, 5:52 PM
Unknown Object (File)
Sep 27 2024, 8:24 PM
Unknown Object (File)
Sep 24 2024, 4:47 PM
Unknown Object (File)
Sep 23 2024, 8:47 PM
Unknown Object (File)
Sep 22 2024, 2:27 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 Not Applicable
Unit
Tests Not Applicable

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.