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)
Tue, Oct 29, 4:09 AM
Unknown Object (File)
Oct 6 2024, 5:35 PM
Unknown Object (File)
Oct 2 2024, 4:11 PM
Unknown Object (File)
Oct 1 2024, 1:35 AM
Unknown Object (File)
Sep 30 2024, 11:23 PM
Unknown Object (File)
Sep 30 2024, 1:07 PM
Unknown Object (File)
Sep 26 2024, 4:05 AM
Unknown Object (File)
Sep 23 2024, 11:58 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

Lint
Lint Skipped
Unit
Tests Skipped

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
29

{{{
#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.