Parag,
> 2) dont open files in kernel modules
Please provide your suggestions and also what should not be done in kernel like aboce things???
To elaborate further on #2:
It is rather difficult to come up with a conclusive list of what should and what should not be done in userspace/kernelspace, but when writing a module, just consider what you could/should do in userspace for reasons of complexity.
Kernelspace code tends to be quite complex with all the locking/preemption issues (plus the fact that when you write buggy code, you end up rebooting, not just re-running a program). Also, keep in mind that with as fast as the kernel internals change, the less internals you have to be concerned with, the less you will have to keep up-to-date with.
Hope that helps some with #2 as well as helps you spot any other parts of your projects that could/should be moved to userspace.
- Andrew Ruder
-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/