Page MenuHomeFreeBSD

style changes to FIOBMAP2
ClosedPublic

Authored by asomers on Jun 27 2019, 8:40 PM.
Tags
None
Referenced Files
F171719246: D20783.id59133.diff
Sun, Sep 13, 12:19 AM
Unknown Object (File)
Sat, Sep 12, 3:58 PM
Unknown Object (File)
Tue, Sep 8, 3:22 AM
Unknown Object (File)
Fri, Sep 4, 8:21 PM
Unknown Object (File)
Sat, Aug 22, 7:33 AM
Unknown Object (File)
Tue, Aug 18, 2:48 PM
Unknown Object (File)
Sun, Aug 16, 8:24 PM
Unknown Object (File)
Aug 12 2026, 12:08 PM
Subscribers

Details

Summary

style changes to FIOBMAP2

Reported-by: kib
MFC-With: 349231

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/kern/vfs_vnops.c
1465 ↗(On Diff #59115)

return (VOP_BMAP(...

1466 ↗(On Diff #59115)

Do you need such trivial helper at all ? IMO you can directly call VOP_BMAP() in vn_ioctl().

1500 ↗(On Diff #59115)

We typically indent as if MAC == 1 always (look at other similar places).

sys/kern/vfs_vnops.c
1466 ↗(On Diff #59115)

I did it to avoid bloating vn_ioctl, and to separate the concerns of parsing com from implementing an ioctl. Would you be happier with the original approach if I used some other naming convention for vn_ioc_bmap2? I see that there are other functions in this file that take a struct file* argument too, like vn_read and vn_write.

sys/kern/vfs_vnops.c
1466 ↗(On Diff #59115)

FIONREAD case looks fine and not bloated. In the vn_ioc_bmap2() interface, I do not like that the file * is passed where function really operates on vnode, and that the ABI structure is passed as an argument to kernel helper. This does not depend on name.

FWIW, vn_read, or better, vn_write, operate on a lot of state in file instead of only vnode.

This revision is now accepted and ready to land.Jun 27 2019, 11:31 PM
This revision was automatically updated to reflect the committed changes.