Page MenuHomeFreeBSD

linuxkpi: Add mmap_lock.h
ClosedPublic

Authored by manu on Feb 16 2022, 10:29 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 28 2022, 8:24 PM
Unknown Object (File)
Dec 26 2022, 7:49 AM
Subscribers

Details

Summary

This contain mmap_read_lock, mmap_read_unlock and mmap_write_lock_killable
which are abstraction around down_read, up_read and down_write_killable.
Note that in Linux 5.8 mmap_sem was renamed to mmap_lock.
We might want to do the same at some point but some drivers still uses
the old mmap locking API.

MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

manu requested review of this revision.Feb 16 2022, 10:29 AM
wulf added inline comments.
sys/compat/linuxkpi/common/include/linux/mm_types.h
48

Can anonymous union be used to handle both names?

sys/compat/linuxkpi/common/include/linux/mm_types.h
48

Probably yes but using the new API I think that you're not supposed to use or know the underlying name.

Otherwise looks okay to me.

sys/compat/linuxkpi/common/include/linux/mmap_lock.h
30

{{{
#include <linux/mm_types.h>
#include <linux/rwsem.h>
}}}

manu marked an inline comment as done.
This revision is now accepted and ready to land.Feb 16 2022, 1:45 PM
This revision was automatically updated to reflect the committed changes.