2
* Copyright (C) 2008 Junjiro Okajima
4
* This program, aufs is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
* $Id: sysrq.c,v 1.4 2008/05/04 23:53:27 sfjro Exp $
26
#include <linux/module.h>
27
#include <linux/moduleparam.h>
28
#include <linux/sysrq.h>
31
static void sysrq_sb(struct super_block *sb)
37
au_plevel = KERN_WARNING;
40
pr_warning(AUFS_NAME ": superblock\n");
42
pr_warning(AUFS_NAME ": root dentry\n");
43
au_dpri_dentry(sb->s_root);
45
pr_warning(AUFS_NAME ": root inode\n");
46
au_dpri_inode(sb->s_root->d_inode);
49
pr_warning(AUFS_NAME ": isolated inode\n");
50
list_for_each_entry(i, &sb->s_inodes, i_sb_list)
51
if (list_empty(&i->i_dentry))
59
/* ---------------------------------------------------------------------- */
61
/* module parameter */
62
static char *aufs_sysrq_key = "a";
63
module_param_named(sysrq, aufs_sysrq_key, charp, S_IRUGO);
64
MODULE_PARM_DESC(sysrq, "MagicSysRq key for " AUFS_NAME);
66
static void au_sysrq(int key, struct tty_struct *tty)
68
struct au_sbinfo *sbinfo;
77
//mutex_lock(&au_sbilist_mtx);
78
list_for_each_entry(sbinfo, &au_sbilist, si_list)
79
sysrq_sb(sbinfo->si_sb);
80
//mutex_unlock(&au_sbilist_mtx);
83
static struct sysrq_key_op au_sysrq_op = {
87
.enable_mask = SYSRQ_ENABLE_DUMP //??
90
/* ---------------------------------------------------------------------- */
92
int __init au_sysrq_init(void)
98
key = *aufs_sysrq_key;
99
if ('a' <= key && key <= 'z')
100
err = register_sysrq_key(key, &au_sysrq_op);
102
AuErr("err %d, sysrq=%c\n", err, key);
106
void au_sysrq_fin(void)
109
err = unregister_sysrq_key(*aufs_sysrq_key, &au_sysrq_op);
111
AuErr("err %d (ignored)\n", err);