Re: how to export function from fs/dropcache.c

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

 



Hi Krishna,



On Mon, Jul 20, 2009 at 8:10 PM, er krishna <erkrishna@xxxxxxxxx> wrote:



Dear All,



 I have one  simple problem in exporting the function. Everything is fine, but its not working as per the expectation.  Actually I have to export some function from fs/dropcache.c, but it is not working as per the expectataion, [ I am able to export any function from other files like fs/buffer.c and block/genhd.c but dropcache.c creates a problem] .I am attaching the file. Just once check & please tell if something is missing, what I have done is as follows:



I have exported three functions from fs/dropcaches.c by making their function declaration in linux/mm.h, compiled the  corresponding 2.6.26 kernel & got their entries in System.map file as follows:


c0174d98 T drop_slab
c0174db2 T drop_pagecache
c0174ea7 T drop_caches_sysctl_handler

These entries are quite different from the actual exported functions from other files, it has only T option. Can antbody elaborate what is the meaning of these options  like T, t, r , u and so on?

I have booted with same 2.6.26 kernel.  I included linux/mm.h  and all the above three function in my module done make & found following warnings in compilation & following error message in insmod due to some linking error:


[root@CENTOS2 kernel]# make
make -C /lib/modules/2.6.26/build M=/root/kernel modules
make[1]: Entering directory `/root/Desktop/linux-2.6.26'
  Building modules, stage 2.
  MODPOST 2 modules
WARNING: "drop_slab" [/root/kernel/dropcache.ko] undefined!
WARNING: "drop_pagecache" [/root/kernel/dropcache.ko] undefined!
WARNING: "drop_caches_sysctl_handler" [/root/kernel/dropcache.ko] undefined!
make[1]: Leaving directory `/root/Desktop/linux-2.6.26'
[root@CENTOS2 kernel]#
[root@CENTOS2 kernel]#
[root@CENTOS2 kernel]# insmod dropcache.ko
insmod: error inserting 'dropcache.ko': -1 Unknown symbol in module

Do a dmesg and provide the results?

You will see that which symbol still remains unresolved. May be you need to export some more of them.

 
[root@CENTOS2 kernel]#
[root@CENTOS2 kernel]#


Any idea how to trace it & what is missing, as I got all the exported entries in System.map file & I have included the function declaration file linux/mm.h on the same compiled kernel, it should do the things in right manner.

Please suggest, If I am missing something or you want any more information. I am attaching my kernel module and these are some more snippet :
[root@CENTOS2 kernel]# uname -a
Linux CENTOS2 2.6.26 #1 SMP Sun Jul 19 10:54:05 IST 2009 i686 i686 i386 GNU/Linux
[root@CENTOS2 kernel]#
[root@CENTOS2 kernel]# tail -1 /root/Desktop/linux-2.6.26/fs/drop_caches.c
EXPORT_SYMBOL(drop_caches_sysctl_handler);
[root@CENTOS2 kernel]#
[root@CENTOS2 kernel]#




Regards,
Sandeep.






“To learn is to change. Education is a process that changes the learner.”




 





Thanks and Best Regards,
------------------------
Krishna Kumar





[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