mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [S390] monwriter buffer limit.
@ 2006-10-06 14:54 Martin Schwidefsky
  0 siblings, 0 replies; only message in thread
From: Martin Schwidefsky @ 2006-10-06 14:54 UTC (permalink / raw)
  To: linux-kernel, melissah

From: Melissa Howland <melissah@us.ibm.com>

[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>
---

 drivers/s390/char/monwriter.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff -urpN linux-2.6/drivers/s390/char/monwriter.c linux-2.6-patched/drivers/s390/char/monwriter.c
--- linux-2.6/drivers/s390/char/monwriter.c	2006-10-06 16:29:35.000000000 +0200
+++ linux-2.6-patched/drivers/s390/char/monwriter.c	2006-10-06 16:29:55.000000000 +0200
@@ -26,6 +26,7 @@
 #define MONWRITE_MAX_DATALEN	4024
 
 static int mon_max_bufs = 255;
+static int mon_buf_count;
 
 struct mon_buf {
 	struct list_head list;
@@ -40,7 +41,6 @@ struct mon_private {
 	size_t hdr_to_read;
 	size_t data_to_read;
 	struct mon_buf *current_buf;
-	int mon_buf_count;
 };
 
 /*
@@ -99,13 +99,13 @@ static int monwrite_new_hdr(struct mon_p
 			rc = monwrite_diag(monhdr, monbuf->data,
 					   APPLDATA_STOP_REC);
 			list_del(&monbuf->list);
-			monpriv->mon_buf_count--;
+			mon_buf_count--;
 			kfree(monbuf->data);
 			kfree(monbuf);
 			monbuf = NULL;
 		}
 	} else {
-		if (monpriv->mon_buf_count >= mon_max_bufs)
+		if (mon_buf_count >= mon_max_bufs)
 			return -ENOSPC;
 		monbuf = kzalloc(sizeof(struct mon_buf), GFP_KERNEL);
 		if (!monbuf)
@@ -118,7 +118,7 @@ static int monwrite_new_hdr(struct mon_p
 		}
 		monbuf->hdr = *monhdr;
 		list_add_tail(&monbuf->list, &monpriv->list);
-		monpriv->mon_buf_count++;
+		mon_buf_count++;
 	}
 	monpriv->current_buf = monbuf;
 	return 0;
@@ -186,7 +186,7 @@ static int monwrite_close(struct inode *
 		if (entry->hdr.mon_function != MONWRITE_GEN_EVENT)
 			monwrite_diag(&entry->hdr, entry->data,
 				      APPLDATA_STOP_REC);
-		monpriv->mon_buf_count--;
+		mon_buf_count--;
 		list_del(&entry->list);
 		kfree(entry->data);
 		kfree(entry);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-10-06 14:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-06 14:54 [S390] monwriter buffer limit Martin Schwidefsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®