Dear all:
When I trace kernel code, I found something interested.
In /usr/src/linux/fs/proc/root.c , define many proc_dir_entry structures.
Question 1: why they use the same
inode_operations(proc_array_inode_operations)??
They don't define any get_info function. If they use the
same inode_operations, they must use the same
file_operations. If they use the same file_operations, when we use cat
command to view these proc file,
their content must be the same, but they don't.
Question 2: What's the different between get_info function and read
function(in file_operations structure).
If we implement them both. When we execute cat command to
view the proc file, which one will be called??
thanks!!
Ariel Chen in Taiwan
=========== kernel code =================
static struct proc_dir_entry proc_root_stat = {
PROC_STAT, 4, "stat",
S_IFREG | S_IRUGO, 1, 0, 0,
0, &proc_array_inode_operations
};
static struct proc_dir_entry proc_root_devices = {
PROC_DEVICES, 7, "devices",
S_IFREG | S_IRUGO, 1, 0, 0,
0, &proc_array_inode_operations
};
static struct proc_dir_entry proc_root_partitions = {
PROC_PARTITIONS, 10, "partitions",
S_IFREG | S_IRUGO, 1, 0, 0,
0, &proc_array_inode_operations
};
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:22 EST