aio: avoid cluttering the log messages

This commit is contained in:
Thomas Schoebel-Theuer 2013-05-10 08:50:48 +02:00 committed by Thomas Schoebel-Theuer
parent 77fdc4cc1a
commit a1caef264c
1 changed files with 19 additions and 18 deletions

View File

@ -1,7 +1,7 @@
// (c) 2010 Thomas Schoebel-Theuer / 1&1 Internet AG // (c) 2010 Thomas Schoebel-Theuer / 1&1 Internet AG
//#define BRICK_DEBUGGING //#define BRICK_DEBUGGING
//#define MARS_DEBUGGING #define MARS_DEBUGGING
//#define IO_DEBUGGING //#define IO_DEBUGGING
#include <linux/kernel.h> #include <linux/kernel.h>
@ -409,12 +409,12 @@ void aio_stop_thread(struct aio_output *output, int i, bool do_submit_dummy)
struct aio_threadinfo *tinfo = &output->tinfo[i]; struct aio_threadinfo *tinfo = &output->tinfo[i];
if (tinfo->thread) { if (tinfo->thread) {
MARS_INF("stopping thread %d ...\n", i); MARS_DBG("stopping thread %d ...\n", i);
brick_thread_stop_nowait(tinfo->thread); brick_thread_stop_nowait(tinfo->thread);
// workaround for waking up the receiver thread. TODO: check whether signal handlong could do better. // workaround for waking up the receiver thread. TODO: check whether signal handlong could do better.
if (do_submit_dummy) { if (do_submit_dummy) {
MARS_INF("submitting dummy for wakeup %d...\n", i); MARS_DBG("submitting dummy for wakeup %d...\n", i);
use_fake_mm(); use_fake_mm();
aio_submit_dummy(output); aio_submit_dummy(output);
if (likely(current->mm)) { if (likely(current->mm)) {
@ -423,7 +423,7 @@ void aio_stop_thread(struct aio_output *output, int i, bool do_submit_dummy)
} }
// wait for termination // wait for termination
MARS_INF("waiting for thread %d ...\n", i); MARS_DBG("waiting for thread %d ...\n", i);
wait_event_interruptible_timeout( wait_event_interruptible_timeout(
tinfo->terminate_event, tinfo->terminate_event,
tinfo->terminated, tinfo->terminated,
@ -531,7 +531,7 @@ int aio_sync_thread(void *data)
struct q_sync q_sync = {}; struct q_sync q_sync = {};
#endif #endif
MARS_INF("sync thread has started on '%s'.\n", output->brick->brick_path); MARS_DBG("sync thread has started on '%s'.\n", output->brick->brick_path);
//set_user_nice(current, -20); //set_user_nice(current, -20);
while (!brick_thread_should_stop() || atomic_read(&tinfo->queued_sum) > 0) { while (!brick_thread_should_stop() || atomic_read(&tinfo->queued_sum) > 0) {
@ -572,7 +572,7 @@ int aio_sync_thread(void *data)
#endif #endif
} }
MARS_INF("sync thread has stopped.\n"); MARS_DBG("sync thread has stopped.\n");
tinfo->terminated = true; tinfo->terminated = true;
wake_up_interruptible_all(&tinfo->terminate_event); wake_up_interruptible_all(&tinfo->terminate_event);
return 0; return 0;
@ -585,7 +585,7 @@ static int aio_event_thread(void *data)
struct aio_threadinfo *other = &output->tinfo[2]; struct aio_threadinfo *other = &output->tinfo[2];
int err = -ENOMEM; int err = -ENOMEM;
MARS_INF("event thread has started.\n"); MARS_DBG("event thread has started.\n");
//set_user_nice(current, -20); //set_user_nice(current, -20);
use_fake_mm(); use_fake_mm();
@ -617,7 +617,6 @@ static int aio_event_thread(void *data)
atomic_sub(count, &output->submit_count); atomic_sub(count, &output->submit_count);
} }
//MARS_INF("count = %d\n", count);
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
struct aio_mref_aspect *mref_a = (void*)events[i].data; struct aio_mref_aspect *mref_a = (void*)events[i].data;
struct mref_object *mref; struct mref_object *mref;
@ -658,7 +657,7 @@ static int aio_event_thread(void *data)
err = 0; err = 0;
err: err:
MARS_INF("event thread has stopped, err = %d\n", err); MARS_DBG("event thread has stopped, err = %d\n", err);
aio_stop_thread(output, 2, false); aio_stop_thread(output, 2, false);
@ -677,7 +676,7 @@ void fd_uninstall(unsigned int fd)
{ {
struct files_struct *files = current->files; struct files_struct *files = current->files;
struct fdtable *fdt; struct fdtable *fdt;
MARS_INF("fd = %d\n", fd); MARS_DBG("fd = %d\n", fd);
spin_lock(&files->file_lock); spin_lock(&files->file_lock);
fdt = files_fdtable(files); fdt = files_fdtable(files);
rcu_assign_pointer(fdt->fd[fd], NULL); rcu_assign_pointer(fdt->fd[fd], NULL);
@ -738,7 +737,7 @@ int _create_ioctx(struct aio_output *output)
* do_submit() which currently does not exist :( * do_submit() which currently does not exist :(
*/ */
err = get_unused_fd(); err = get_unused_fd();
MARS_INF("fd = %d\n", err); MARS_DBG("fd = %d\n", err);
if (unlikely(err < 0)) { if (unlikely(err < 0)) {
MARS_ERR("cannot get fd, err=%d\n", err); MARS_ERR("cannot get fd, err=%d\n", err);
goto done; goto done;
@ -746,7 +745,7 @@ int _create_ioctx(struct aio_output *output)
output->fd = err; output->fd = err;
fd_install(err, file); fd_install(err, file);
MARS_INF("submit thread has started.\n"); MARS_DBG("file handle = %d\n", err);
use_fake_mm(); use_fake_mm();
@ -785,6 +784,8 @@ static int aio_submit_thread(void *data)
struct file *file; struct file *file;
int err = -EINVAL; int err = -EINVAL;
MARS_DBG("submit thread has started.\n");
file = output->mf->mf_filp; file = output->mf->mf_filp;
use_fake_mm(); use_fake_mm();
@ -1032,11 +1033,11 @@ static int aio_switch(struct aio_brick *brick)
if (brick->o_creat) { if (brick->o_creat) {
flags |= O_CREAT; flags |= O_CREAT;
MARS_INF("using O_CREAT on %s\n", path); MARS_DBG("using O_CREAT on %s\n", path);
} }
if (brick->o_direct) { if (brick->o_direct) {
flags |= O_DIRECT; flags |= O_DIRECT;
MARS_INF("using O_DIRECT on %s\n", path); MARS_DBG("using O_DIRECT on %s\n", path);
} }
output->mf = mapfree_get(path, flags); output->mf = mapfree_get(path, flags);
@ -1060,9 +1061,9 @@ static int aio_switch(struct aio_brick *brick)
goto err; goto err;
} }
MARS_INF("opened file '%s'\n", path); MARS_DBG("opened file '%s'\n", path);
mars_power_led_on((void*)brick, true); mars_power_led_on((void*)brick, true);
MARS_DBG("successfully switched on.\n");
done: done:
return 0; return 0;
@ -1158,14 +1159,14 @@ EXPORT_SYMBOL_GPL(aio_brick_type);
int __init init_mars_aio(void) int __init init_mars_aio(void)
{ {
MARS_INF("init_aio()\n"); MARS_DBG("init_aio()\n");
_aio_brick_type = (void*)&aio_brick_type; _aio_brick_type = (void*)&aio_brick_type;
return aio_register_brick_type(); return aio_register_brick_type();
} }
void __exit exit_mars_aio(void) void __exit exit_mars_aio(void)
{ {
MARS_INF("exit_aio()\n"); MARS_DBG("exit_aio()\n");
aio_unregister_brick_type(); aio_unregister_brick_type();
} }