I've been reading up on how to write linux device drivers. All the material I have refers to struct file_operations as defined in /usr/include/linux/fs.h. I do not rummage through system includes very often, but occasionally I do, and when someone says "struct file_operations is defined in linux.fs.h" I presume they mean therein I will find something like
as in the past, that has always been true. But my ls.h does not even contain the word file_operations. In fact, my entire /usr/include only contains five references to "file_operations" and none of those is a definition, eg.Code:struct file_operations { blah blah blah
The kernel source, not surprisingly, refers to it hundreds of times.Code:const struct file_operations *someptr;
So I've reached the conclusion that I am misunderstanding something elementary, because I do not get how this struct cannot be defined somewhere in /usr/include, and yet is in use all over the place.
Can anyone explain? I don't really need to look at the original definition as I have lots of example code using it, but I do really need to know "what is the nature of my misapprehension" in believing that "struct file_operations in defined in linux/fs.h" means there should be at least some kind of reference to "struct file_operations" in linux/fs.h.