diff options
| author | Jean-Sébastien Pédron <dumbbell@FreeBSD.org> | 2025-06-20 19:50:13 +0000 |
|---|---|---|
| committer | Jean-Sébastien Pédron <dumbbell@FreeBSD.org> | 2025-08-09 12:26:24 +0000 |
| commit | cdfdafdc34244aced687516a7a0cb04e7b4d267c (patch) | |
| tree | aa1914d65a9262de8228f9ea584eb0d806a90fb9 /sys/compat/linuxkpi/common | |
| parent | 621f43ffe2eb4e2565663f14f8027467b1a8146e (diff) | |
Diffstat (limited to 'sys/compat/linuxkpi/common')
| -rw-r--r-- | sys/compat/linuxkpi/common/include/linux/seq_file.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/seq_file.h b/sys/compat/linuxkpi/common/include/linux/seq_file.h index 876ef9e8dfe5..47da16ab8688 100644 --- a/sys/compat/linuxkpi/common/include/linux/seq_file.h +++ b/sys/compat/linuxkpi/common/include/linux/seq_file.h @@ -55,6 +55,21 @@ static const struct file_operations __name ## _fops = { \ .release = single_release, \ } +#define DEFINE_SHOW_STORE_ATTRIBUTE(__name) \ +static int __name ## _open(struct inode *inode, struct linux_file *file) \ +{ \ + return single_open(file, __name ## _show, inode->i_private); \ +} \ + \ +static const struct file_operations __name ## _fops = { \ + .owner = THIS_MODULE, \ + .open = __name ## _open, \ + .read = seq_read, \ + .write = __name ## _write, \ + .llseek = seq_lseek, \ + .release = single_release, \ +} + struct seq_file { struct sbuf *buf; size_t size; |
