I found real nice guide that helps you hacking the linux kernel. It teaches you everything you should know. You'll get all of your source codes at this site. The only cons were it is a bit long and it isnt at all step by step, but overall its good. It will give you everything you need from start to finish. Written by Paul Russell.
You go to the website by clicking here
The filesystem code uses ERR_PTR() include/linux/fs.h; to encode a negative error number into a pointer, and IS_ERR() and PTR_ERR() to get it back out again: avoids a separate pointer parameter for the error number. Icky, but in a good way.