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)
Feb 24 2025, 10:04 PM
Unknown Object (File)
Feb 11 2025, 1:10 AM
Unknown Object (File)
Feb 8 2025, 9:41 PM
Unknown Object (File)
Feb 8 2025, 3:10 AM
Unknown Object (File)
Jan 28 2025, 4:03 PM
Unknown Object (File)
Jan 18 2025, 9:24 PM
Unknown Object (File)
Jan 15 2025, 1:03 PM
Unknown Object (File)
Jan 15 2025, 12:43 PM
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.