falloc()

Robert Watson rwatson at FreeBSD.org
Sun Feb 6 04:51:23 PST 2005


On Sat, 5 Feb 2005, Yan Yu wrote:

>   I am wondering if there is a way to use kernel loadable module to
> replace the original falloc() (kern/kern_descrip.c) in the system.  I
> know how to do this if the funciton to be replaced is some system call
> function or ufs* operatio ( i could just change the symbol table which
> holds these function pointers),.  but i could not find the symbol table
> which holds the falloc() function pointer... 

falloc() isn't considered a "pluggable" kernel API, that is to say, we've
not engineered FreeBSD with the intent that it be replaced at run-time. 
As such, to get falloc() replaced on your out-of-the-box FreeBSD install,
you'll need to modify the kernel linking.  falloc is non-static, so it
should be an exported symbol from kern_descrip.o and in theory exposed to
modules -- however, replugging the current reference in kern_descript.o
might be the hard one to modify.

If you don't mind my asking, what motivates you to replace falloc()?

Robert N M Watson



More information about the freebsd-hackers mailing list