diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/kernfs.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h index b923052c29d0..97c6c0f91325 100644 --- a/include/linux/kernfs.h +++ b/include/linux/kernfs.h | |||
| @@ -33,6 +33,32 @@ struct sysfs_open_file { | |||
| 33 | const struct vm_operations_struct *vm_ops; | 33 | const struct vm_operations_struct *vm_ops; |
| 34 | }; | 34 | }; |
| 35 | 35 | ||
| 36 | struct kernfs_ops { | ||
| 37 | /* | ||
| 38 | * Read is handled by either seq_file or raw_read(). | ||
| 39 | * | ||
| 40 | * If seq_show() is present, seq_file path is active. The behavior | ||
| 41 | * is equivalent to single_open(). @sf->private points to the | ||
| 42 | * associated sysfs_open_file. | ||
| 43 | * | ||
| 44 | * read() is bounced through kernel buffer and a read larger than | ||
| 45 | * PAGE_SIZE results in partial operation of PAGE_SIZE. | ||
| 46 | */ | ||
| 47 | int (*seq_show)(struct seq_file *sf, void *v); | ||
| 48 | |||
| 49 | ssize_t (*read)(struct sysfs_open_file *of, char *buf, size_t bytes, | ||
| 50 | loff_t off); | ||
| 51 | |||
| 52 | /* | ||
| 53 | * write() is bounced through kernel buffer and a write larger than | ||
| 54 | * PAGE_SIZE results in partial operation of PAGE_SIZE. | ||
| 55 | */ | ||
| 56 | ssize_t (*write)(struct sysfs_open_file *of, char *buf, size_t bytes, | ||
| 57 | loff_t off); | ||
| 58 | |||
| 59 | int (*mmap)(struct sysfs_open_file *of, struct vm_area_struct *vma); | ||
| 60 | }; | ||
| 61 | |||
| 36 | #ifdef CONFIG_SYSFS | 62 | #ifdef CONFIG_SYSFS |
| 37 | 63 | ||
| 38 | struct sysfs_dirent *kernfs_create_dir_ns(struct sysfs_dirent *parent, | 64 | struct sysfs_dirent *kernfs_create_dir_ns(struct sysfs_dirent *parent, |
