calling sys_swapon/swapoff from within the kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I want to be able to turn the swap on and off from within 
a kernel module I've written.

I can't call the functions sys_swapon/sys_swapoff directly
because they both take a char* arg which is the swapfile
name (i.e. "/dev/hda5"), and since they do a
user_path_walk()
on that string to get the inode info, the char* pointer
must
be in userspace not kernel space.

so 

(1) is there any way for me to do the equivalent of
kmalloc() in my kernel module, but have it return a
user-space pointer? so i could then fill that in with the
filename and call the functions directly? or,

(2) another way to do what i'm trying to do?

thanks
anthony

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux