mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
proc: introduce proc_create_seq_private
Variant of proc_create_data that directly take a struct seq_operations argument + a private state size and drastically reduces the boilerplate code in the callers. All trivial callers converted over. Signed-off-by: Christoph Hellwig <[email protected]>
This commit is contained in:
parent
fddda2b7b5
commit
44414d82cf
12 changed files with 37 additions and 113 deletions
16
fs/locks.c
16
fs/locks.c
|
|
@ -2788,22 +2788,10 @@ static const struct seq_operations locks_seq_operations = {
|
|||
.show = locks_show,
|
||||
};
|
||||
|
||||
static int locks_open(struct inode *inode, struct file *filp)
|
||||
{
|
||||
return seq_open_private(filp, &locks_seq_operations,
|
||||
sizeof(struct locks_iterator));
|
||||
}
|
||||
|
||||
static const struct file_operations proc_locks_operations = {
|
||||
.open = locks_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.release = seq_release_private,
|
||||
};
|
||||
|
||||
static int __init proc_locks_init(void)
|
||||
{
|
||||
proc_create("locks", 0, NULL, &proc_locks_operations);
|
||||
proc_create_seq_private("locks", 0, NULL, &locks_seq_operations,
|
||||
sizeof(struct locks_iterator), NULL);
|
||||
return 0;
|
||||
}
|
||||
fs_initcall(proc_locks_init);
|
||||
|
|
|
|||
Loading…
Reference in a new issue