Re: Getting the list of the file systems which are mounted.

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

 





On Sun, Aug 3, 2008 at 10:34 PM, Rene Herman <rene.herman@xxxxxxxxxxxx> wrote:
On 03-08-08 17:44, Prasad Joshi wrote:

I am calling a function get_filesystem_list() from a module which I am writing. During the compilation I am getting the error

WARNING: get_filesystem_list [module name] undefined!

And the insertion of the module also fails giving error unresolved symbol.

I need the list of file systems registered on the system, get_filesystem_list() does the same.

I have included the file <linux/fs.h> as well. Why is it not working and how to make it work?

get_filesystem_list() is not exported for use by modules. Probably just because noone needs it...

Thanks Rene,

Yes, get_filesystem_list() is not exported function. But then how the filesystems_read_proc() is using it.
Here is the part of the code from file "linuxsrc/fs/proc/proc_misc.c"

static const struct file_operations proc_interrupts_operations = {
    .open       = interrupts_open,
    .read       = seq_read,
    .llseek     = seq_lseek,
    .release    = seq_release,
};

static int filesystems_read_proc(char *page, char **start, off_t off,
                 int count, int *eof, void *data)
{
    int len = get_filesystem_list(page);      <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    return proc_calc_metrics(page, start, off, count, eof, len);
}

Thanks and Regards,
Prasad
 

For your own personal use, you can just export if from your kernel yourself. Add a

       EXPORT_SYMBOL(get_filesystem_list);

directly after the closing brace of get_filesystem_list() (that location is just convention, technically anywhere would be fine) and recmpile the kernel. After reboot, get_filesystem_list() is available to modules.

Rene.


[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