Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102427
b: refs/heads/master
c: fb98ec7
h: refs/heads/master
i:
  102425: a902fd6
  102423: 8f5ae12
v: v3
  • Loading branch information
Allan Stephens authored and David S. Miller committed May 5, 2008
1 parent d315aac commit a6128bb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 025adbe8e58290798001b472aec3eb618d8fc930
refs/heads/master: fb98ec71c7f81b6db9b793aeb9d53823b6960d8b
13 changes: 10 additions & 3 deletions trunk/net/tipc/dbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* net/tipc/dbg.c: TIPC print buffer routines for debugging
*
* Copyright (c) 1996-2006, Ericsson AB
* Copyright (c) 2005-2006, Wind River Systems
* Copyright (c) 2005-2007, Wind River Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -354,8 +354,10 @@ void tipc_dump(struct print_buf *pb, const char *fmt, ...)
* @log_size: print buffer size to use
*/

void tipc_log_resize(int log_size)
int tipc_log_resize(int log_size)
{
int res = 0;

spin_lock_bh(&print_lock);
if (TIPC_LOG->buf) {
kfree(TIPC_LOG->buf);
Expand All @@ -366,8 +368,11 @@ void tipc_log_resize(int log_size)
log_size = TIPC_PB_MIN_SIZE;
tipc_printbuf_init(TIPC_LOG, kmalloc(log_size, GFP_ATOMIC),
log_size);
res = !TIPC_LOG->buf;
}
spin_unlock_bh(&print_lock);

return res;
}

/**
Expand All @@ -385,7 +390,9 @@ struct sk_buff *tipc_log_resize_cmd(const void *req_tlv_area, int req_tlv_space)
if (value != delimit(value, 0, 32768))
return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
" (log size must be 0-32768)");
tipc_log_resize(value);
if (tipc_log_resize(value))
return tipc_cfg_reply_error_string(
"unable to create specified log (log size is now 0)");
return tipc_cfg_reply_none();
}

Expand Down
4 changes: 2 additions & 2 deletions trunk/net/tipc/dbg.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* net/tipc/dbg.h: Include file for TIPC print buffer routines
*
* Copyright (c) 1997-2006, Ericsson AB
* Copyright (c) 2005-2006, Wind River Systems
* Copyright (c) 2005-2007, Wind River Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -61,7 +61,7 @@ int tipc_printbuf_empty(struct print_buf *pb);
int tipc_printbuf_validate(struct print_buf *pb);
void tipc_printbuf_move(struct print_buf *pb_to, struct print_buf *pb_from);

void tipc_log_resize(int log_size);
int tipc_log_resize(int log_size);

struct sk_buff *tipc_log_resize_cmd(const void *req_tlv_area,
int req_tlv_space);
Expand Down

0 comments on commit a6128bb

Please sign in to comment.