Demo entry 6678392

struct definition

   

Submitted by anonymous on Dec 06, 2017 at 06:17
Language: C. Code size: 687 Bytes.

struct proc_dir_entry{
	unsigned int low_ino;
	//proc文件系统内的索引节点的标号
	unsigned short namelen;
	const char *name;
	mode_t mode; nlink_t nlink;
	uid_t uid;g id_t gid; loff_t size;
	struct inode_operations *proc_iops;
	const struct file_operatiions *proc_fops;
	//file_operations 结构,存放了proc目录读写操作函数
	get_info_t *get_info;
	struct module *owner;
	struct proc_dir_entry *next, *parent, *subdir;
	//实现树型目录结构的指针
	void *data;
	read_proc_t *read_proc;
	write_proc_t *write_proc;
	/*read_proc 和write_proc两个函数提供了对proc 文件进行读写的
	简单接口,实际上系统会在注册proc文件时,自动将proc_fops设置为
	一个缺省的file_operations结构,当没有设置此结构时,inode_operation
	结构会自动调用这两个函数*/
	atomic_t count;
	int deleted;
	void *set;
};

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).