aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char
diff options
context:
space:
mode:
authorMelissa Howland <melissah@us.ibm.com>2006-10-06 10:38:26 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2006-10-06 10:38:26 -0400
commit2d103d5a80846e96e1cb1ba5e635e8c37d30ada8 (patch)
tree30d3b14de570a33c251d56642df3969beb3994ea /drivers/s390/char
parentd83682b3971d6707d6d668b3b62d416ab7dd1ab3 (diff)
[S390] monwriter buffer limit.
Make max_bufs a global (per linux guest) limit. Signed-off-by: Melissa Howland <melissah@us.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/char')
-rw-r--r--drivers/s390/char/monwriter.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/s390/char/monwriter.c b/drivers/s390/char/monwriter.c
index 1e3939aeb8ab..4362ff260244 100644
--- a/drivers/s390/char/monwriter.c
+++ b/drivers/s390/char/monwriter.c
@@ -26,6 +26,7 @@
26#define MONWRITE_MAX_DATALEN 4024 26#define MONWRITE_MAX_DATALEN 4024
27 27
28static int mon_max_bufs = 255; 28static int mon_max_bufs = 255;
29static int mon_buf_count;
29 30
30struct mon_buf { 31struct mon_buf {
31 struct list_head list; 32 struct list_head list;
@@ -40,7 +41,6 @@ struct mon_private {
40 size_t hdr_to_read; 41 size_t hdr_to_read;
41 size_t data_to_read; 42 size_t data_to_read;
42 struct mon_buf *current_buf; 43 struct mon_buf *current_buf;
43 int mon_buf_count;
44}; 44};
45 45
46/* 46/*
@@ -99,13 +99,13 @@ static int monwrite_new_hdr(struct mon_private *monpriv)
99 rc = monwrite_diag(monhdr, monbuf->data, 99 rc = monwrite_diag(monhdr, monbuf->data,
100 APPLDATA_STOP_REC); 100 APPLDATA_STOP_REC);
101 list_del(&monbuf->list); 101 list_del(&monbuf->list);
102 monpriv->mon_buf_count--; 102 mon_buf_count--;
103 kfree(monbuf->data); 103 kfree(monbuf->data);
104 kfree(monbuf); 104 kfree(monbuf);
105 monbuf = NULL; 105 monbuf = NULL;
106 } 106 }
107 } else { 107 } else {
108 if (monpriv->mon_buf_count >= mon_max_bufs) 108 if (mon_buf_count >= mon_max_bufs)
109 return -ENOSPC; 109 return -ENOSPC;
110 monbuf = kzalloc(sizeof(struct mon_buf), GFP_KERNEL); 110 monbuf = kzalloc(sizeof(struct mon_buf), GFP_KERNEL);
111 if (!monbuf) 111 if (!monbuf)
@@ -118,7 +118,7 @@ static int monwrite_new_hdr(struct mon_private *monpriv)
118 } 118 }
119 monbuf->hdr = *monhdr; 119 monbuf->hdr = *monhdr;
120 list_add_tail(&monbuf->list, &monpriv->list); 120 list_add_tail(&monbuf->list, &monpriv->list);
121 monpriv->mon_buf_count++; 121 mon_buf_count++;
122 } 122 }
123 monpriv->current_buf = monbuf; 123 monpriv->current_buf = monbuf;
124 return 0; 124 return 0;
@@ -186,7 +186,7 @@ static int monwrite_close(struct inode *inode, struct file *filp)
186 if (entry->hdr.mon_function != MONWRITE_GEN_EVENT) 186 if (entry->hdr.mon_function != MONWRITE_GEN_EVENT)
187 monwrite_diag(&entry->hdr, entry->data, 187 monwrite_diag(&entry->hdr, entry->data,
188 APPLDATA_STOP_REC); 188 APPLDATA_STOP_REC);
189 monpriv->mon_buf_count--; 189 mon_buf_count--;
190 list_del(&entry->list); 190 list_del(&entry->list);
191 kfree(entry->data); 191 kfree(entry->data);
192 kfree(entry); 192 kfree(entry);