summaryrefslogtreecommitdiffstats
path: root/arch/um/kernel
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2006-09-29 01:58:50 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-29 09:18:04 -0700
commit730760e90a173ef81f89beed2f1dad2fab310f68 (patch)
treee60039deb19683fac30e58277450c657ecd33e07 /arch/um/kernel
parentb10aeeef554eb1ff80e10111829f6e7484877811 (diff)
downloadkernel-crypto-730760e90a173ef81f89beed2f1dad2fab310f68.tar.gz
kernel-crypto-730760e90a173ef81f89beed2f1dad2fab310f68.tar.xz
kernel-crypto-730760e90a173ef81f89beed2f1dad2fab310f68.zip
[PATCH] uml: locking documentation
Some locking documentation and a cleanup. uml_exitcode is copied into a local before sprintf sees it, in case sprintf does anything non-atomic with it. The rest are comments about why certain globals don't need any kind of locking. Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/kernel')
-rw-r--r--arch/um/kernel/exitcode.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/um/kernel/exitcode.c b/arch/um/kernel/exitcode.c
index d21ebad666b..8b7f2cdedf9 100644
--- a/arch/um/kernel/exitcode.c
+++ b/arch/um/kernel/exitcode.c
@@ -16,9 +16,13 @@ int uml_exitcode = 0;
static int read_proc_exitcode(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
- int len;
+ int len, val;
- len = sprintf(page, "%d\n", uml_exitcode);
+ /* Save uml_exitcode in a local so that we don't need to guarantee
+ * that sprintf accesses it atomically.
+ */
+ val = uml_exitcode;
+ len = sprintf(page, "%d\n", val);
len -= off;
if(len <= off+count) *eof = 1;
*start = page + off;