Page MenuHomeFreeBSD

style changes to FIOBMAP2
ClosedPublic

Authored by asomers on Jun 27 2019, 8:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 14, 8:08 AM
Unknown Object (File)
Mon, Apr 14, 4:44 AM
Unknown Object (File)
Sun, Apr 13, 8:50 PM
Unknown Object (File)
Sun, Apr 13, 8:35 PM
Unknown Object (File)
Sun, Apr 13, 8:29 PM
Unknown Object (File)
Sun, Apr 6, 9:16 AM
Unknown Object (File)
Sat, Apr 5, 1:42 AM
Unknown Object (File)
Mar 13 2025, 2:26 AM
Subscribers

Details

Summary

style changes to FIOBMAP2

Reported-by: kib
MFC-With: 349231

Diff Detail

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

Event Timeline

sys/kern/vfs_vnops.c
1459–1460

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

1460

return (VOP_BMAP(...

1492

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

sys/kern/vfs_vnops.c
1459–1460

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
1459–1460

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.