cregit-Linux how code gets into the kernel

Release 4.7 drivers/net/bonding/bond_debugfs.c

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/netdevice.h>

#include <net/bonding.h>
#include <net/bond_alb.h>

#if defined(CONFIG_DEBUG_FS) && !defined(CONFIG_NET_NS)

#include <linux/debugfs.h>
#include <linux/seq_file.h>


static struct dentry *bonding_debug_root;

/* Show RLB hash table */

static int bond_debug_rlb_hash_show(struct seq_file *m, void *v) { struct bonding *bond = m->private; struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); struct rlb_client_info *client_info; u32 hash_index; if (BOND_MODE(bond) != BOND_MODE_ALB) return 0; seq_printf(m, "SourceIP DestinationIP " "Destination MAC DEV\n"); spin_lock_bh(&bond->mode_lock); hash_index = bond_info->rx_hashtbl_used_head; for (; hash_index != RLB_NULL_INDEX; hash_index = client_info->used_next) { client_info = &(bond_info->rx_hashtbl[hash_index]); seq_printf(m, "%-15pI4 %-15pI4 %-17pM %s\n", &client_info->ip_src, &client_info->ip_dst, &client_info->mac_dst, client_info->slave->dev->name); } spin_unlock_bh(&bond->mode_lock); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
taku izumitaku izumi13893.88%125.00%
nikolay aleksandrovnikolay aleksandrov42.72%125.00%
veaceslav falicoveaceslav falico32.04%125.00%
jiri bohacjiri bohac21.36%125.00%
Total147100.00%4100.00%


static int bond_debug_rlb_hash_open(struct inode *inode, struct file *file) { return single_open(file, bond_debug_rlb_hash_show, inode->i_private); }

Contributors

PersonTokensPropCommitsCommitProp
taku izumitaku izumi28100.00%1100.00%
Total28100.00%1100.00%

static const struct file_operations bond_debug_rlb_hash_fops = { .owner = THIS_MODULE, .open = bond_debug_rlb_hash_open, .read = seq_read, .llseek = seq_lseek, .release = single_release, };
void bond_debug_register(struct bonding *bond) { if (!bonding_debug_root) return; bond->debug_dir = debugfs_create_dir(bond->dev->name, bonding_debug_root); if (!bond->debug_dir) { netdev_warn(bond->dev, "failed to register to debugfs\n"); return; } debugfs_create_file("rlb_hash_table", 0400, bond->debug_dir, bond, &bond_debug_rlb_hash_fops); }

Contributors

PersonTokensPropCommitsCommitProp
taku izumitaku izumi6395.45%266.67%
veaceslav falicoveaceslav falico34.55%133.33%
Total66100.00%3100.00%


void bond_debug_unregister(struct bonding *bond) { if (!bonding_debug_root) return; debugfs_remove_recursive(bond->debug_dir); }

Contributors

PersonTokensPropCommitsCommitProp
taku izumitaku izumi23100.00%1100.00%
Total23100.00%1100.00%


void bond_debug_reregister(struct bonding *bond) { struct dentry *d; if (!bonding_debug_root) return; d = debugfs_rename(bonding_debug_root, bond->debug_dir, bonding_debug_root, bond->dev->name); if (d) { bond->debug_dir = d; } else { netdev_warn(bond->dev, "failed to reregister, so just unregister old one\n"); bond_debug_unregister(bond); } }

Contributors

PersonTokensPropCommitsCommitProp
taku izumitaku izumi6695.65%150.00%
veaceslav falicoveaceslav falico34.35%150.00%
Total69100.00%2100.00%


void bond_create_debugfs(void) { bonding_debug_root = debugfs_create_dir("bonding", NULL); if (!bonding_debug_root) { pr_warn("Warning: Cannot create bonding directory in debugfs\n"); } }

Contributors

PersonTokensPropCommitsCommitProp
taku izumitaku izumi2692.86%150.00%
joe perchesjoe perches27.14%150.00%
Total28100.00%2100.00%


void bond_destroy_debugfs(void) { debugfs_remove_recursive(bonding_debug_root); bonding_debug_root = NULL; }

Contributors

PersonTokensPropCommitsCommitProp
taku izumitaku izumi16100.00%1100.00%
Total16100.00%1100.00%

#else /* !CONFIG_DEBUG_FS */
void bond_debug_register(struct bonding *bond) { }

Contributors

PersonTokensPropCommitsCommitProp
taku izumitaku izumi9100.00%1100.00%
Total9100.00%1100.00%


void bond_debug_unregister(struct bonding *bond) { }

Contributors

PersonTokensPropCommitsCommitProp
taku izumitaku izumi9100.00%1100.00%
Total9100.00%1100.00%


void bond_debug_reregister(struct bonding *bond) { }

Contributors

PersonTokensPropCommitsCommitProp
taku izumitaku izumi9100.00%1100.00%
Total9100.00%1100.00%


void bond_create_debugfs(void) { }

Contributors

PersonTokensPropCommitsCommitProp
taku izumitaku izumi6100.00%1100.00%
Total6100.00%1100.00%


void bond_destroy_debugfs(void) { }

Contributors

PersonTokensPropCommitsCommitProp
taku izumitaku izumi6100.00%1100.00%
Total6100.00%1100.00%

#endif /* CONFIG_DEBUG_FS */

Overall Contributors

PersonTokensPropCommitsCommitProp
taku izumitaku izumi46793.78%220.00%
eric w. biedermaneric w. biederman112.21%110.00%
veaceslav falicoveaceslav falico91.81%220.00%
nikolay aleksandrovnikolay aleksandrov51.00%220.00%
david s. millerdavid s. miller20.40%110.00%
joe perchesjoe perches20.40%110.00%
jiri bohacjiri bohac20.40%110.00%
Total498100.00%10100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
{% endraw %}