LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Is it possible to directly call do_path_lookup() in kernel?
@ 2007-01-23 18:32 Xin Zhao
  2007-01-24  7:33 ` Xin Zhao
  0 siblings, 1 reply; 4+ messages in thread
From: Xin Zhao @ 2007-01-23 18:32 UTC (permalink / raw)
  To: linux-kernel

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is it possible to directly call do_path_lookup() in kernel?
  2007-01-23 18:32 Is it possible to directly call do_path_lookup() in kernel? Xin Zhao
@ 2007-01-24  7:33 ` Xin Zhao
  2007-01-24  7:43   ` [newbie] " Oleg Verych
  0 siblings, 1 reply; 4+ messages in thread
From: Xin Zhao @ 2007-01-24  7:33 UTC (permalink / raw)
  To: linux-kernel

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
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [newbie] Re: Is it possible to directly call do_path_lookup() in kernel?
  2007-01-24  7:33 ` Xin Zhao
@ 2007-01-24  7:43   ` Oleg Verych
  2007-01-24  7:59     ` Xin Zhao
  0 siblings, 1 reply; 4+ messages in thread
From: Oleg Verych @ 2007-01-24  7:43 UTC (permalink / raw)
  To: linux-kernel

On 2007-01-24, Xin Zhao wrote:
> Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/485775>

Hallo.

> 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.

In linkage.h header near you.

> Can someone explain it?

Please use appropriate mailing list:

Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/

> Thanks,
> -x
>
____


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [newbie] Re: Is it possible to directly call do_path_lookup() in kernel?
  2007-01-24  7:43   ` [newbie] " Oleg Verych
@ 2007-01-24  7:59     ` Xin Zhao
  0 siblings, 0 replies; 4+ messages in thread
From: Xin Zhao @ 2007-01-24  7:59 UTC (permalink / raw)
  To: Oleg Verych, linux-kernel

Thanks for your reply.

But more details are appreciated. Actually I checked linkage.h before
I sent last email. Looks like "fastcall" is used to direct the
compiler to put the first 3 parameters into registers instead of
stack. But I just don't understand why that causes "general protection
fault".

I am writing a new file system on Linux platform. So I thought this is
the right email list where I can discuss Linux kernel developing
questions. Is this email list only used to post patches and report
bugs? If so, I will stay away.

-x

On 1/24/07, Oleg Verych <olecom@flower.upol.cz> wrote:
>
> On 2007-01-24, Xin Zhao wrote:
> > Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/485775>
>
> Hallo.
>
> > 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.
>
> In linkage.h header near you.
>
> > Can someone explain it?
>
> Please use appropriate mailing list:
>
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/
>
> > Thanks,
> > -x
> >
> ____
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-01-24  7:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-23 18:32 Is it possible to directly call do_path_lookup() in kernel? Xin Zhao
2007-01-24  7:33 ` Xin Zhao
2007-01-24  7:43   ` [newbie] " Oleg Verych
2007-01-24  7:59     ` Xin Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).