mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Xin Zhao" <uszhaoxin@gmail.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Is it possible to directly call do_path_lookup() in kernel?
Date: Wed, 24 Jan 2007 02:33:03 -0500	[thread overview]
Message-ID: <4ae3c140701232333j4772794j6e49da2d32c0b26d@mail.gmail.com> (raw)
In-Reply-To: <4ae3c140701231032xd6eca27td46cc1c25e150e25@mail.gmail.com>

I just successfully called do_path_lookup() in my kernel module. I
just removed the "fastcall" from the declaration of do_path_lookup(),
then the problem disappeared. I don't quite understand "fastcall"
though.

Can someone explain it?

Thanks,
-x

On 1/23/07, Xin Zhao <uszhaoxin@gmail.com> wrote:
> Hi,
>
> I tried to call the following code in a kernel module:
>
>         error = do_path_lookup(AT_FDCWD, "/etc/profile.d/glib2.csh",
> LOOKUP_PARENT, &nd);
>
> I exported the function do_path_lookup() using
> "EXPORT_SYMBOL_GPL(do_path_lookup);"
>
> But do_path_lookup() caused the "general protection fault: 0000 [#1]"
> kernel error.
>
> I thought it could be the problem of protection error, so I used the
> following codes to enclose the code that calls do_path_lookup(), but
> still got the same error.
>
>         fs = get_fs ();                                                   /* save previous value */
>         set_fs (KERNEL_DS);                                               /* use kernel limit */
>         ......
>         set_fs(fs);
>
> Any idea on this?
>
> Thanks a lot!
>
> -x
>

  reply	other threads:[~2007-01-24  7:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-23 18:32 Xin Zhao
2007-01-24  7:33 ` Xin Zhao [this message]
2007-01-24  7:43   ` [newbie] " Oleg Verych
2007-01-24  7:59     ` Xin Zhao

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=4ae3c140701232333j4772794j6e49da2d32c0b26d@mail.gmail.com \
    --to=uszhaoxin@gmail.com \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®