Page MenuHomeFreeBSD

vfs: Add ioflag to VOP_DEALLOCATE(9)
ClosedPublic

Authored by khng on Aug 11 2021, 7:19 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 9 2024, 11:20 AM
Unknown Object (File)
Feb 13 2024, 8:46 PM
Unknown Object (File)
Feb 11 2024, 3:28 AM
Unknown Object (File)
Jan 26 2024, 12:34 PM
Unknown Object (File)
Jan 18 2024, 7:59 PM
Unknown Object (File)
Dec 22 2023, 8:45 PM
Unknown Object (File)
Dec 12 2023, 7:40 AM
Unknown Object (File)
Nov 8 2023, 4:08 PM
Subscribers

Details

Summary

The addition of ioflag allows callers passing
IO_SYNC/IO_DATASYNC/IO_DIRECT down to the file system implementation.
The vop_stddeallocate fallback implementation is updated to pass the
ioflag to the file system implementation.
vn_deallocate(9) internally is also changed to pass ioflag to the
VOP_DEALLOCATE call.

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 40993
Build 37882: arc lint + arc unit

Event Timeline

khng requested review of this revision.Aug 11 2021, 7:19 AM
sys/kern/vfs_vnops.c
3461

I suggest you to commit rename ioflg->ioflag as a preliminary change.

3477

Fix style: there should be spaces around '|'.

3558

!= 0

3559

!= 0

3567

() != 0

khng marked 5 inline comments as done.

Styles.

sys/kern/vfs_vnops.c
3568

This ioflag calculation block was copied/pasted from vn_write(). Put it into a helper used in both places.

khng marked an inline comment as done.
  • IO_SYNC and/or IO_DATASYNC ends up in a helper.
  • Move IO_NODELOCKED | IO_RANGELOCKED style fix to D31505
sys/kern/vfs_vnops.c
1148

Didn't previous version also handled O_DIRECT?

1150

I do not see why making the invocation of the helper more complicated. Move calculation of mp into it, as you see mp is cleared on the next line.

khng marked 2 inline comments as done.
  • Let vn_fspacectl check O_DIRECT as well
  • style

Move mp = into the helper.

get_sync_ioflag -> get_write_ioflag: Move IO_DIRECT checking into the helper.

share/man/man9/vn_deallocate.9
70

Just copy the definition from VOP_DEALLOCATE?

79–80
sys/kern/vfs_vnops.c
1147–1152

Why not handle FNONBLOCK in the helper too?

It is useful to extract get_write_ioflags() into separate commit. For instance, it can be merged to stable branches independently of other fspacectl changes.

sys/kern/vfs_vnops.c
930

() != 0

933

Same.

942

Same

khng marked 5 inline comments as done.

Dedicated commit for:

  • vfs: Add get_write_ioflag handler to calculate ioflag
  • Styles
khng marked an inline comment as done.Aug 11 2021, 3:03 PM

I asked for a commit that _only_ introduces get_write_ioflag() and replaces existing place(s) with it. Addition of flags anywhere is clearly a different change.

  • Separate get_write_ioflag commit (This currently calculates IO_DIRECT/IO_SYNC/IO_DATASYNC). I do not introduce IO_NDELAY calculation because it is clearly not going to be used by vn_fspacectl yet even it is harmless to just let it passthrough for now.
This revision is now accepted and ready to land.Aug 12 2021, 12:44 PM
This revision was automatically updated to reflect the committed changes.