Page MenuHomeFreeBSD

style changes to FIOBMAP2
ClosedPublic

Authored by asomers on Jun 27 2019, 8:40 PM.
Tags
None
Referenced Files
F175876588: D20783.id59115.diff
Wed, Oct 14, 3:04 AM
F175873747: D20783.id59137.diff
Wed, Oct 14, 2:26 AM
F175859337: D20783.id59133.diff
Tue, Oct 13, 11:12 PM
F175796663: D20783.diff
Tue, Oct 13, 10:36 AM
Unknown Object (File)
Mon, Sep 28, 7:57 PM
Unknown Object (File)
Fri, Sep 18, 10:39 PM
Unknown Object (File)
Wed, Sep 16, 8:47 PM
Unknown Object (File)
Wed, Sep 16, 7:05 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.