Kernel Mode File Operations Wrappers

From: Ramit Bhalla
Date: Mon Aug 18 2003 - 10:10:57 EST


Hi,

I've written a file that provides wrappers for kernel mode file operations (using existing filp_xx and supporting operations).
This provides support for opening/closing/reading/writing/seeking/formatting etc operations. This should help kernel mode developers with fs operations in their kernel drivers/modules.

It helps simplify kernel mode file operations and takes care of various issues (which one can forget at times) like handling the FS registers , uid and gid. It exposes kernel mode file operations in a way that are very similar to user mode operations like fopen, fclose, fseek etc.

I have tested it on a few systems and it appears to be working great.

Hope this finds it's way into the linux kernel :)

Ramit.

Attachment: kernel_fops.h
Description: kernel_fops.h

Attachment: kernel_fops.c
Description: kernel_fops.c