All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/4] mmapstress04: use SAFE_WRITE_RETRY from LTP library
@ 2022-10-05 14:25 Jan Stancek
  2022-10-05 14:25 ` [LTP] [PATCH 2/4] syscalls/preadv203: don't treat short write() as failure Jan Stancek
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Jan Stancek @ 2022-10-05 14:25 UTC (permalink / raw)
  To: ltp

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 testcases/kernel/mem/mmapstress/mmapstress04.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/testcases/kernel/mem/mmapstress/mmapstress04.c b/testcases/kernel/mem/mmapstress/mmapstress04.c
index ceede7eaa860..d71c469bc6c8 100644
--- a/testcases/kernel/mem/mmapstress/mmapstress04.c
+++ b/testcases/kernel/mem/mmapstress/mmapstress04.c
@@ -32,17 +32,6 @@ static void setup(void)
 		MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
 }
 
-static void write_fully(int fd, void *buf, int len)
-{
-	int ret;
-
-	do {
-		ret = SAFE_WRITE(0, fd, buf, len);
-		buf += ret;
-		len -= ret;
-	} while (len > 0);
-}
-
 static void mmapstress04(void)
 {
 	int i, j, rofd, rwfd;
@@ -85,7 +74,7 @@ static void mmapstress04(void)
 	buf = SAFE_MALLOC(page_size);
 	memset(buf, 'a', page_size);
 	for (i = 0; i < 6 * 64; i++)
-		write_fully(rwfd, buf, page_size);
+		SAFE_WRITE(SAFE_WRITE_RETRY, rwfd, buf, page_size);
 	free(buf);
 	SAFE_CLOSE(rwfd);
 
-- 
2.27.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-10-07  7:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-05 14:25 [LTP] [PATCH 1/4] mmapstress04: use SAFE_WRITE_RETRY from LTP library Jan Stancek
2022-10-05 14:25 ` [LTP] [PATCH 2/4] syscalls/preadv203: don't treat short write() as failure Jan Stancek
2022-10-05 15:51   ` Cyril Hrubis
2022-10-05 14:25 ` [LTP] [PATCH 3/4] correct order of parameters in SAFE_WRITE() Jan Stancek
2022-10-05 15:53   ` Cyril Hrubis
2022-10-05 14:25 ` [LTP] [PATCH 4/4] update all call sites of SAFE_WRITE() Jan Stancek
2022-10-05 16:01   ` Cyril Hrubis
2022-10-07  7:12     ` Jan Stancek
2022-10-05 15:50 ` [LTP] [PATCH 1/4] mmapstress04: use SAFE_WRITE_RETRY from LTP library Cyril Hrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.