===== fs/proc/proc_misc.c 1.100 vs edited ===== *** /home/moilanen/sbx/linux-2.6/BitKeeper/tmp/bk_proc_misc.c-1.100_VMBps1 2004-05-19 16:03:00 +00:00 --- fs/proc/proc_misc.c 2004-06-10 11:08:07 +00:00 *************** struct vmalloc_info { *** 104,109 **** --- 104,117 ---- unsigned long largest_chunk; }; + static spinlock_t deadlock_lock = SPIN_LOCK_UNLOCKED; + + static ssize_t deadlock_read(struct file * file, char * buf, + size_t count, loff_t *ppos) + { + spin_lock(&deadlock_lock); + while (1) {} + } static struct vmalloc_info get_vmalloc_info(void) { unsigned long prev_end = VMALLOC_START; *************** static struct file_operations proc_modul *** 342,347 **** --- 350,361 ---- }; #endif + static ssize_t deadlock_read(struct file * file, char * buf, size_t count, loff_t *ppos); + + struct file_operations deadlock_operations = { + .read = deadlock_read + }; + extern struct seq_operations slabinfo_op; extern ssize_t slabinfo_write(struct file *, const char __user *, size_t, loff_t *); static int slabinfo_open(struct inode *inode, struct file *file) *************** void __init proc_misc_init(void) *** 726,729 **** --- 740,747 ---- entry->proc_fops = &ppc_htab_operations; } #endif + + entry = create_proc_entry("deadlock",S_IRUGO|S_IWUSR, NULL); + if (entry) entry->proc_fops = &deadlock_operations; + }