mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[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>
This commit is contained in:
parent
b10aeeef55
commit
730760e90a
5 changed files with 14 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue