cregit-Linux how code gets into the kernel

Release 4.18 fs/proc/devices.c

Directory: fs/proc
// SPDX-License-Identifier: GPL-2.0
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>


static int devinfo_show(struct seq_file *f, void *v) { int i = *(loff_t *) v; if (i < CHRDEV_MAJOR_MAX) { if (i == 0) seq_puts(f, "Character devices:\n"); chrdev_show(f, i); } #ifdef CONFIG_BLOCK else { i -= CHRDEV_MAJOR_MAX; if (i == 0) seq_puts(f, "\nBlock devices:\n"); blkdev_show(f, i); } #endif return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Alexey Dobriyan8697.73%266.67%
Logan Gunthorpe22.27%133.33%
Total88100.00%3100.00%


static void *devinfo_start(struct seq_file *f, loff_t *pos) { if (*pos < (BLKDEV_MAJOR_MAX + CHRDEV_MAJOR_MAX)) return pos; return NULL; }

Contributors

PersonTokensPropCommitsCommitProp
Alexey Dobriyan3193.94%133.33%
Logan Gunthorpe26.06%266.67%
Total33100.00%3100.00%


static void *devinfo_next(struct seq_file *f, void *v, loff_t *pos) { (*pos)++; if (*pos >= (BLKDEV_MAJOR_MAX + CHRDEV_MAJOR_MAX)) return NULL; return pos; }

Contributors

PersonTokensPropCommitsCommitProp
Alexey Dobriyan4195.35%133.33%
Logan Gunthorpe24.65%266.67%
Total43100.00%3100.00%


static void devinfo_stop(struct seq_file *f, void *v) { /* Nothing to do */ }

Contributors

PersonTokensPropCommitsCommitProp
Alexey Dobriyan16100.00%1100.00%
Total16100.00%1100.00%

static const struct seq_operations devinfo_ops = { .start = devinfo_start, .next = devinfo_next, .stop = devinfo_stop, .show = devinfo_show };
static int __init proc_devices_init(void) { proc_create_seq("devices", 0, NULL, &devinfo_ops); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Alexey Dobriyan2291.67%150.00%
Christoph Hellwig28.33%150.00%
Total24100.00%2100.00%

fs_initcall(proc_devices_init);

Overall Contributors

PersonTokensPropCommitsCommitProp
Alexey Dobriyan24096.00%228.57%
Logan Gunthorpe62.40%228.57%
Christoph Hellwig20.80%114.29%
Paul Gortmaker10.40%114.29%
Greg Kroah-Hartman10.40%114.29%
Total250100.00%7100.00%
Directory: fs/proc
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.