On Fri, Nov 22, 2002 at 11:46:32PM -0500, Raghu R. Arur wrote: > But I am asked to do it in a modular way i.e when I insert my module > then it shud schedule in RR fashion and when I remove my module then it > has to revert back to the elevator algorithm.... So I think this is the > only way I can do this.. Function pointers! ;) Everyone loves function pointers; modify elevator.c to call out through function pointers for the various functions you need to perform. Set them to the default functions statically, and have your module save and restore them on load/unload. Please take care when doing this -- if not handled correctly, you could unload the functions as they are being used... (I'm not sure I can think of a great way around this -- IBM's RCU idea (see 2001 OLS presentations) could work around this problem, but .. it isn't exactly _easy_ to use.) Nah, there is no need to over-ride system calls. :) -- http://sardonix.org/
Attachment:
pgp00223.pgp
Description: PGP signature