Page MenuHomeFreeBSD

vfs: Add ioflag to VOP_DEALLOCATE(9)
ClosedPublic

Authored by khng on Aug 11 2021, 7:19 AM.
Tags
None
Referenced Files
F81659064: D31500.id93543.diff
Fri, Apr 19, 2:20 PM
F81659062: D31500.id93537.diff
Fri, Apr 19, 2:20 PM
F81659059: D31500.id93586.diff
Fri, Apr 19, 2:20 PM
F81659056: D31500.id93534.diff
Fri, Apr 19, 2:20 PM
F81659051: D31500.id93544.diff
Fri, Apr 19, 2:20 PM
F81659047: D31500.id93532.diff
Fri, Apr 19, 2:20 PM
F81659045: D31500.id93542.diff
Fri, Apr 19, 2:20 PM
Unknown Object (File)
Mar 9 2024, 11:20 AM
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 40991
Build 37880: arc lint + arc unit

Event Timeline

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

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

3473

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

3554

!= 0

3555

!= 0

3563

() != 0

khng marked 5 inline comments as done.

Styles.

sys/kern/vfs_vnops.c
3564

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
1143

Didn't previous version also handled O_DIRECT?

1145

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
1142–1146

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.