On 2/27/20 6:46 AM, Vladimir Sementsov-Ogievskiy wrote:
26.02.2020 18:06, Eric Blake wrote:
On 2/5/20 5:20 AM, Vladimir Sementsov-Ogievskiy wrote:
Introduce NBDExtentArray class, to handle extents list creation in more
controlled way and with fewer OUT parameters in functions.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
nbd/server.c | 210 +++++++++++++++++++++++++++++----------------------
1 file changed, 118 insertions(+), 92 deletions(-)
+
+/* Further modifications of the array after conversion are abandoned */
+static void nbd_extent_array_convert_to_be(NBDExtentArray *ea)
+{
+ int i;
+
+ assert(!ea->converted_to_be);
Comment is stale - further modifications after conversion are a bug that aborts
the program, not abandoned.
I always thought that "abandoned" is something that must not be done, so the
word works here. But I don't know English well).
Rephrasing my comment, further modifications are "a bug that aborts the program", rather
than "an ignored action that gets abandoned".
May be:
"No further modifications of the array allowed after converting to BE."?
Yes, that wording is better.
Is it better?
Or just drop the comment.
That's also viable; the code reads fairly well even without the comment.