autofs4: make autofs log prints consistent
Use the pr_*() print in AUTOFS_*() macros instead of printks and include the module name in log message macros. Also use the AUTOFS_*() macros everywhere instead of raw printks. Signed-off-by: Ian Kent <raven@themaw.net> Cc: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
0266725ad4
commit
cab49f9ed8
|
@ -36,15 +36,15 @@
|
||||||
/* #define DEBUG */
|
/* #define DEBUG */
|
||||||
|
|
||||||
#define DPRINTK(fmt, ...) \
|
#define DPRINTK(fmt, ...) \
|
||||||
pr_debug("pid %d: %s: " fmt "\n", \
|
pr_debug(KBUILD_MODNAME ":pid:%d:%s: " fmt "\n",\
|
||||||
current->pid, __func__, ##__VA_ARGS__)
|
current->pid, __func__, ##__VA_ARGS__)
|
||||||
|
|
||||||
#define AUTOFS_WARN(fmt, ...) \
|
#define AUTOFS_WARN(fmt, ...) \
|
||||||
printk(KERN_WARNING "pid %d: %s: " fmt "\n", \
|
pr_warn(KBUILD_MODNAME ":pid:%d:%s: " fmt "\n", \
|
||||||
current->pid, __func__, ##__VA_ARGS__)
|
current->pid, __func__, ##__VA_ARGS__)
|
||||||
|
|
||||||
#define AUTOFS_ERROR(fmt, ...) \
|
#define AUTOFS_ERROR(fmt, ...) \
|
||||||
printk(KERN_ERR "pid %d: %s: " fmt "\n", \
|
pr_err(KBUILD_MODNAME ":pid:%d:%s: " fmt "\n", \
|
||||||
current->pid, __func__, ##__VA_ARGS__)
|
current->pid, __func__, ##__VA_ARGS__)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -373,7 +373,7 @@ static int autofs_dev_ioctl_setpipefd(struct file *fp,
|
||||||
new_pid = get_task_pid(current, PIDTYPE_PGID);
|
new_pid = get_task_pid(current, PIDTYPE_PGID);
|
||||||
|
|
||||||
if (ns_of_pid(new_pid) != ns_of_pid(sbi->oz_pgrp)) {
|
if (ns_of_pid(new_pid) != ns_of_pid(sbi->oz_pgrp)) {
|
||||||
AUTOFS_WARN("Not allowed to change PID namespace");
|
AUTOFS_WARN("not allowed to change PID namespace");
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
|
@ -270,14 +270,14 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
|
||||||
if (parse_options(data, &pipefd, &root_inode->i_uid, &root_inode->i_gid,
|
if (parse_options(data, &pipefd, &root_inode->i_uid, &root_inode->i_gid,
|
||||||
&pgrp, &pgrp_set, &sbi->type, &sbi->min_proto,
|
&pgrp, &pgrp_set, &sbi->type, &sbi->min_proto,
|
||||||
&sbi->max_proto)) {
|
&sbi->max_proto)) {
|
||||||
printk("autofs: called with bogus options\n");
|
AUTOFS_ERROR("called with bogus options");
|
||||||
goto fail_dput;
|
goto fail_dput;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pgrp_set) {
|
if (pgrp_set) {
|
||||||
sbi->oz_pgrp = find_get_pid(pgrp);
|
sbi->oz_pgrp = find_get_pid(pgrp);
|
||||||
if (!sbi->oz_pgrp) {
|
if (!sbi->oz_pgrp) {
|
||||||
pr_warn("autofs: could not find process group %d\n",
|
AUTOFS_ERROR("could not find process group %d",
|
||||||
pgrp);
|
pgrp);
|
||||||
goto fail_dput;
|
goto fail_dput;
|
||||||
}
|
}
|
||||||
|
@ -294,8 +294,8 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
|
||||||
/* Couldn't this be tested earlier? */
|
/* Couldn't this be tested earlier? */
|
||||||
if (sbi->max_proto < AUTOFS_MIN_PROTO_VERSION ||
|
if (sbi->max_proto < AUTOFS_MIN_PROTO_VERSION ||
|
||||||
sbi->min_proto > AUTOFS_MAX_PROTO_VERSION) {
|
sbi->min_proto > AUTOFS_MAX_PROTO_VERSION) {
|
||||||
printk("autofs: kernel does not match daemon version "
|
AUTOFS_ERROR("kernel does not match daemon version "
|
||||||
"daemon (%d, %d) kernel (%d, %d)\n",
|
"daemon (%d, %d) kernel (%d, %d)",
|
||||||
sbi->min_proto, sbi->max_proto,
|
sbi->min_proto, sbi->max_proto,
|
||||||
AUTOFS_MIN_PROTO_VERSION, AUTOFS_MAX_PROTO_VERSION);
|
AUTOFS_MIN_PROTO_VERSION, AUTOFS_MAX_PROTO_VERSION);
|
||||||
goto fail_dput;
|
goto fail_dput;
|
||||||
|
@ -312,7 +312,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
|
||||||
pipe = fget(pipefd);
|
pipe = fget(pipefd);
|
||||||
|
|
||||||
if (!pipe) {
|
if (!pipe) {
|
||||||
printk("autofs: could not open pipe file descriptor\n");
|
AUTOFS_ERROR("could not open pipe file descriptor");
|
||||||
goto fail_dput;
|
goto fail_dput;
|
||||||
}
|
}
|
||||||
ret = autofs_prepare_pipe(pipe);
|
ret = autofs_prepare_pipe(pipe);
|
||||||
|
@ -332,7 +332,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
|
||||||
* Failure ... clean up.
|
* Failure ... clean up.
|
||||||
*/
|
*/
|
||||||
fail_fput:
|
fail_fput:
|
||||||
printk("autofs: pipe file descriptor does not contain proper ops\n");
|
AUTOFS_ERROR("pipe file descriptor does not contain proper ops");
|
||||||
fput(pipe);
|
fput(pipe);
|
||||||
/* fall through */
|
/* fall through */
|
||||||
fail_dput:
|
fail_dput:
|
||||||
|
|
|
@ -164,7 +164,7 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
printk("autofs4_notify_daemon: bad type %d!\n", type);
|
AUTOFS_WARN("bad type %d!", type);
|
||||||
mutex_unlock(&sbi->wq_mutex);
|
mutex_unlock(&sbi->wq_mutex);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -453,7 +453,7 @@ int autofs4_wait(struct autofs_sb_info *sbi,
|
||||||
autofs_ptype_expire_indirect;
|
autofs_ptype_expire_indirect;
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINTK("new wait id = 0x%08lx, name = %.*s, nfy=%d\n",
|
DPRINTK("new wait id = 0x%08lx, name = %.*s, nfy=%d",
|
||||||
(unsigned long) wq->wait_queue_token, wq->name.len,
|
(unsigned long) wq->wait_queue_token, wq->name.len,
|
||||||
wq->name.name, notify);
|
wq->name.name, notify);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue