]> git.openfabrics.org - ~emulex/infiniband.git/commit
tipc: simplify print buffer handling in tipc_printf
authorErik Hugne <erik.hugne@ericsson.com>
Fri, 29 Jun 2012 04:50:22 +0000 (00:50 -0400)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Fri, 13 Jul 2012 23:28:28 +0000 (19:28 -0400)
commite2dbd601346aeb64b1b387168b217fd5c301644e
tree5386cec14012dc35b146b10a8309203f16f1474e
parent5deedde9fa65c494c9747dd66b1721be90991b64
tipc: simplify print buffer handling in tipc_printf

tipc_printf was previously used both to construct debug traces
and to append data to buffers that should be sent over netlink
to the tipc-config application.  A global print_buffer was
used to format the string before it was copied to the actual
output buffer.  This could lead to concurrent access of the
global print_buffer, which then had to be lock protected.
This is simplified by changing tipc_printf to append data
directly to the output buffer using vscnprintf.

With the new implementation of tipc_printf, there is no longer
any risk of concurrent access to the internal log buffer, so
the lock (and the comments describing it) are no longer
strictly necessary.  However, there are still a few functions
that do grab this lock before resizing/dumping the log
buffer.  We leave the lock, and these functions untouched since
they will be removed with a subsequent commit that drops the
deprecated log buffer handling code

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
net/tipc/log.c