From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v5 1/2] splice02: Generate input in C
Date: Wed, 21 Apr 2021 11:40:04 +0200 [thread overview]
Message-ID: <YH/y9JMUfbpSX8ev@yuki> (raw)
In-Reply-To: <YH8H7gnu9FYziyGG@pevik>
Hi!
> Yep. In your code you expect that written letter change each time.
> But original code writes the same letter for whole buffer (using memset()).
Ah, right, the mapping in the original code maps the remaning size to be
written to a letter and uses it for whole block.
I guess that it may be easier to understand if the letter was defined as
an function of a position in the file like I have expected in my
snippet. That way we can also produce different patterns without
changing the test code (and we can later on introduce a library
functions to fill buffer and check buffer as well, these would generally
take a pointer to a buffer, size and an offset).
That would mean that we will have to fill the buffer in a for loop
instead of memset, but as long as the get_letter() function is inlined
it should be fast enough.
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2021-04-21 9:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-20 8:44 [LTP] [PATCH v5 1/2] splice02: Generate input in C Petr Vorel
2021-04-20 8:44 ` [LTP] [PATCH v5 2/2] commands: Add shell pipe test Petr Vorel
2021-04-20 9:21 ` [LTP] [PATCH v5 1/2] splice02: Generate input in C Cyril Hrubis
2021-04-20 16:57 ` Petr Vorel
2021-04-21 9:40 ` Cyril Hrubis [this message]
2021-04-21 10:04 ` Petr Vorel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YH/y9JMUfbpSX8ev@yuki \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox