From: Bart Van Assche <bvanassche@acm.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: fio@vger.kernel.org, Damien Le Moal <damien.lemoal@wdc.com>,
Bart Van Assche <bvanassche@acm.org>
Subject: [PATCH 2/5] Verify the size of struct jobs_eta at compile time
Date: Mon, 12 Aug 2019 19:01:33 -0700 [thread overview]
Message-ID: <20190813020136.15798-3-bvanassche@acm.org> (raw)
In-Reply-To: <20190813020136.15798-1-bvanassche@acm.org>
This helps to verify the correctness of a later patch that will modify
this structure.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
eta.c | 2 ++
fio.h | 2 ++
2 files changed, 4 insertions(+)
diff --git a/eta.c b/eta.c
index 647a1bdd8eed..99c537d189a3 100644
--- a/eta.c
+++ b/eta.c
@@ -736,6 +736,8 @@ void print_thread_status(void)
void print_status_init(int thr_number)
{
+ BUILD_BUG_ON(sizeof(struct jobs_eta) != 160);
+
DRD_IGNORE_VAR(__run_str);
__run_str[thr_number] = 'P';
update_condensed_str(__run_str, run_str);
diff --git a/fio.h b/fio.h
index 2094d30b863e..4bf96fc1cd62 100644
--- a/fio.h
+++ b/fio.h
@@ -66,6 +66,8 @@
#include <cuda.h>
#endif
+#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
+
struct fio_sem;
/*
--
2.22.0
next prev parent reply other threads:[~2019-08-13 2:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-13 2:01 [PATCH 0/5] Five fio patches Bart Van Assche
2019-08-13 2:01 ` [PATCH 1/5] Optimize the code that copies strings Bart Van Assche
2019-08-13 2:01 ` Bart Van Assche [this message]
2019-08-13 2:01 ` [PATCH 3/5] Refine packed annotations in stat.h Bart Van Assche
2019-08-13 2:53 ` Jens Axboe
2019-08-13 15:12 ` Bart Van Assche
2019-08-13 20:25 ` Jens Axboe
2019-08-13 20:51 ` Bart Van Assche
2019-08-13 21:04 ` Jens Axboe
2019-08-13 21:46 ` Bart Van Assche
2019-08-13 2:01 ` [PATCH 4/5] Revert "eta: Fix compiler warning" Bart Van Assche
2019-08-13 2:01 ` [PATCH 5/5] make test: Also run zbd tests Bart Van Assche
2019-08-13 4:39 ` Sitsofe Wheeler
2019-08-13 15:06 ` Bart Van Assche
2019-08-13 20:10 ` Sitsofe Wheeler
2019-08-13 20:22 ` Jens Axboe
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=20190813020136.15798-3-bvanassche@acm.org \
--to=bvanassche@acm.org \
--cc=axboe@kernel.dk \
--cc=damien.lemoal@wdc.com \
--cc=fio@vger.kernel.org \
/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 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.