From 251adeb0757d8b57260674b2d72e5222d67f1abd Mon Sep 17 00:00:00 2001 From: Jim Huang Date: Mon, 9 Aug 2021 22:00:57 +0800 Subject: [PATCH] Change the header file which defines sys_delete_module --- lkmpg.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lkmpg.tex b/lkmpg.tex index 4bf6d69..a382cfa 100644 --- a/lkmpg.tex +++ b/lkmpg.tex @@ -888,8 +888,8 @@ With \cpp|cleanup_module| that's impossible because it is a void function. However, there is a counter which keeps track of how many processes are using your module. You can see what its value is by looking at the 3rd field of \verb|/proc/modules|. If this number isn't zero, \sh|rmmod| will fail. -Note that you do not have to check the counter from within \cpp|cleanup_module| because the check will be performed for you by the system call \cpp|sys_delete_module|, defined in \verb|linux/module.c|. -You should not use this counter directly, but there are functions defined in \verb|linux/module.h| which let you increase, decrease and display this counter: +Note that you do not have to check the counter from within \cpp|cleanup_module| because the check will be performed for you by the system call \cpp|sys_delete_module|, defined in \verb|include/linux/syscalls.h|. +You should not use this counter directly, but there are functions defined in \verb|include/linux/module.h| which let you increase, decrease and display this counter: \begin{itemize} \item \cpp|try_module_get(THIS_MODULE)|: Increment the use count.