public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: syscall in a module
       [not found] <000001c842e7$3f2cd340$bd8679c0$@savary@kerlink.fr>
@ 2007-12-20  9:16 ` Russell King - ARM Linux
       [not found]   ` <000401c842ea$5aef1ea0$10cd5be0$@savary@kerlink.fr>
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2007-12-20  9:16 UTC (permalink / raw)
  To: Pierre Savary; +Cc: linux-arm-kernel, linux-kernel

On Thu, Dec 20, 2007 at 10:03:53AM +0100, Pierre Savary wrote:
> I need some help about syscalls and modules. In fact I want to adapt the
> g_file_storage module to my own application.
> I need to use "sys_umount" and "sys_mount" but when I compile I obtain this
> message :
> [...]
>   Kernel: arch/arm/boot/zImage is ready
>   Building modules, stage 2.
>   MODPOST 4 modules
> ERROR: "sys_umount" [drivers/usb/gadget/g_file_storage.ko] undefined!
> make[1]: *** [__modpost] Error 1
> make: *** [modules] Error 2
> [...]
> 
> So, how can I use "sys_umount" and "sys_mount" in this module?

You don't.  Syscalls are NOT for modules because they modify the
filesystem, which depends on the user context.  For example, processes
running chroot have a different view of the filesystem from those which
aren't - and if you happen to be executing with the context of a
chrooted user process when you mount, and a non-chrooted process when
you umount.

I suggest you describe what you're trying to do in greater detail, and/or
ask on the main kernel list - but note that if you ask the same question
without explaining why you need it _and_ asking for alternative ideas,
you'll get the same kind of response there.

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

* Re: syscall in a module
       [not found]   ` <000401c842ea$5aef1ea0$10cd5be0$@savary@kerlink.fr>
@ 2007-12-20 10:15     ` Russell King - ARM Linux
       [not found]       ` <001101c842f6$3793a4b0$a6baee10$@savary@kerlink.fr>
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2007-12-20 10:15 UTC (permalink / raw)
  To: Pierre Savary; +Cc: linux-arm-kernel, linux-kernel

On Thu, Dec 20, 2007 at 10:26:08AM +0100, Pierre Savary wrote:
> In fact I have a part (/dev/mmcblk0p5) that I want share with USB gadget
> (g_file_storage). But if USB is not connect to a PC, I want that this part
> was mounted on my board. An I want unmount this part when the board is
> plugged on a PC.
> So I need to mount and unmount partition in this module.

Arrange for the USB subsystem to send a uevent, which can then be picked
up by userspace to issue the correct command to mount or unmount the
partition.

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

* Re: syscall in a module
       [not found]       ` <001101c842f6$3793a4b0$a6baee10$@savary@kerlink.fr>
@ 2007-12-27 16:13         ` Russell King - ARM Linux
  0 siblings, 0 replies; 3+ messages in thread
From: Russell King - ARM Linux @ 2007-12-27 16:13 UTC (permalink / raw)
  To: Pierre Savary; +Cc: linux-arm-kernel, linux-kernel

On Thu, Dec 20, 2007 at 11:50:59AM +0100, Pierre Savary wrote:
> Could you give me some sample, because I have no idea to how to send a
> uevent in userspace ...

TBH I don't know - only that my suggestion would be the most logical way
to go about it.  Maybe looking in MAINTAINERS and asking in a more
appropriate place would be more fruitful?

DRIVER CORE, KOBJECTS, AND SYSFS
P:      Greg Kroah-Hartman
M:      gregkh@suse.de
L:      linux-kernel@vger.kernel.org
T:      quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
S:      Supported

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

end of thread, other threads:[~2007-12-27 16:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <000001c842e7$3f2cd340$bd8679c0$@savary@kerlink.fr>
2007-12-20  9:16 ` syscall in a module Russell King - ARM Linux
     [not found]   ` <000401c842ea$5aef1ea0$10cd5be0$@savary@kerlink.fr>
2007-12-20 10:15     ` Russell King - ARM Linux
     [not found]       ` <001101c842f6$3793a4b0$a6baee10$@savary@kerlink.fr>
2007-12-27 16:13         ` Russell King - ARM Linux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox