Page MenuHomeFreeBSD

D61990.1795617185.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D61990.1795617185.diff

diff --git a/sys/compat/linuxkpi/common/include/linux/mm_types.h b/sys/compat/linuxkpi/common/include/linux/mm_types.h
--- a/sys/compat/linuxkpi/common/include/linux/mm_types.h
+++ b/sys/compat/linuxkpi/common/include/linux/mm_types.h
@@ -57,6 +57,12 @@
linux_mm_dtor(mm);
}
+static inline void
+mmget(struct mm_struct *mm)
+{
+ atomic_inc(&mm->mm_users);
+}
+
static inline bool
mmget_not_zero(struct mm_struct *mm)
{
@@ -70,6 +76,17 @@
mmdrop(mm);
}
+/*
+ * Linux defers the final teardown of the address space to a workqueue
+ * because it may sleep. Dropping the last mm_users reference here only
+ * frees the mm_struct and never sleeps, so this is mmput().
+ */
+static inline void
+mmput_async(struct mm_struct *mm)
+{
+ mmput(mm);
+}
+
static inline void
mmgrab(struct mm_struct *mm)
{
diff --git a/sys/compat/linuxkpi/common/include/linux/mmap_lock.h b/sys/compat/linuxkpi/common/include/linux/mmap_lock.h
--- a/sys/compat/linuxkpi/common/include/linux/mmap_lock.h
+++ b/sys/compat/linuxkpi/common/include/linux/mmap_lock.h
@@ -44,6 +44,13 @@
up_read(&mm->mmap_sem);
}
+static inline void
+mmap_write_lock(struct mm_struct *mm)
+{
+
+ down_write(&mm->mmap_sem);
+}
+
static inline void
mmap_write_lock_killable(struct mm_struct *mm)
{
@@ -51,4 +58,18 @@
down_write_killable(&mm->mmap_sem);
}
+static inline void
+mmap_write_unlock(struct mm_struct *mm)
+{
+
+ up_write(&mm->mmap_sem);
+}
+
+static inline void
+mmap_write_downgrade(struct mm_struct *mm)
+{
+
+ downgrade_write(&mm->mmap_sem);
+}
+
#endif /* _LINUXKPI_LINUX_MMAP_LOCK_H_ */

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 25, 2:33 PM (21 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41992517
Default Alt Text
D61990.1795617185.diff (1 KB)

Event Timeline