From: Giacomo <delleceste@gmail.com>
To: netfilter-devel@lists.netfilter.org
Subject: help tasklist_lock
Date: Mon, 25 Sep 2006 10:10:38 +0200 [thread overview]
Message-ID: <200609251010.38830.delleceste@gmail.com> (raw)
Good morning to all!
I've written a module which needs to lock the tasklist_lock to read
the processes and get their pid.
Before kernel source 2.6.18 the symbol tasklist_lock was exported inside the
file fork.c.
With kernel 2.6.18, such symbol is no more exported, albeit a large number of
other source files use it.
My code does not compile any more and it says unexported symbol during
the compilation.
How can i do it?
Is there a way to make my module see the tasklist_lock?
The documentation of the kernel says:
What: remove EXPORT_SYMBOL(tasklist_lock)
When: August 2006
Files: kernel/fork.c
Why: tasklist_lock protects the kernel internal task list. Modules have
no business looking at it, and all instances in drivers have been due
to use of too-lowlevel APIs. Having this symbol exported prevents
moving to more scalable locking schemes for the task list.
while my code does simply the following:
struct task_struct *get_uid_from_pid(const pid_t uspace_pid)
{
struct task_struct *task;
/* task list must not change while we are reading!
* We are not in atomic */
read_lock(&tasklist_lock);
for_each_process(task)
{
if (task->pid == uspace_pid)
{
read_unlock(&tasklist_lock);
return task;
}
}
read_unlock(&tasklist_lock);
return NULL;
}
Thanks a lot for any suggestion.
Giacomo S.
--
Giacomo S.
http://www.giacomos.it
- - - - - - - - - - - - - - - - - - - - - -
Proteggi il tuo PC provando il mio semplice FIREWALL:
http://www.giacomos.it/ipfire
mailto:
delleceste@gmail.com
giacomo.strangolino@elettra.trieste.it
jacum@libero.it
- - - - - - - - - - - - - - - - - - - - - -
. '' `.
: :' :
`. ` '
`- Debian GNU/Linux -- The power of freedom
http://www.debian.org
next reply other threads:[~2006-09-25 8:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-25 8:10 Giacomo [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-09-25 10:13 help tasklist_lock Giacomo
2006-09-25 10:16 ` Patrick McHardy
2006-09-25 8:05 Giacomo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200609251010.38830.delleceste@gmail.com \
--to=delleceste@gmail.com \
--cc=netfilter-devel@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.