drivers/md/bcache/debug.c

Source file repositories/reference/linux-study-clean/drivers/md/bcache/debug.c

File Facts

System
Linux kernel
Corpus path
drivers/md/bcache/debug.c
Extension
.c
Size
5674 bytes
Lines
263
Domain
Driver Families
Bucket
drivers/md
Inferred role
Driver Families: operation-table or driver-model contract
Status
pattern implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

static const struct file_operations cache_set_debug_ops = {
	.owner		= THIS_MODULE,
	.open		= bch_dump_open,
	.read		= bch_dump_read,
	.release	= bch_dump_release
};

void bch_debug_init_cache_set(struct cache_set *c)
{
	if (!IS_ERR_OR_NULL(bcache_debug)) {
		char name[50];

		snprintf(name, 50, "bcache-%pU", c->set_uuid);
		c->debug = debugfs_create_file(name, 0400, bcache_debug, c,
					       &cache_set_debug_ops);
	}
}

#endif

void bch_debug_exit(void)
{
	debugfs_remove_recursive(bcache_debug);
}

void __init bch_debug_init(void)
{
	/*
	 * it is unnecessary to check return value of
	 * debugfs_create_file(), we should not care
	 * about this.
	 */
	bcache_debug = debugfs_create_dir("bcache", NULL);
}

Annotation

Implementation Notes