diff options
author | pjd <pjd@FreeBSD.org> | 2011-09-27 08:50:37 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2011-09-27 08:50:37 +0000 |
commit | 2c59e5d5437fcd48c72ceeb06f5aacd65ad2e2be (patch) | |
tree | 584bd5892a4f1ff05f7f1a3612c8134b8a2506e2 /sbin/hastd/metadata.c | |
parent | 1f93bdc27f698c83f830a67a9da0f5991ea476fb (diff) | |
download | FreeBSD-src-2c59e5d5437fcd48c72ceeb06f5aacd65ad2e2be.zip FreeBSD-src-2c59e5d5437fcd48c72ceeb06f5aacd65ad2e2be.tar.gz |
Use PJDLOG_ASSERT() and PJDLOG_ABORT() everywhere instead of assert().
MFC after: 3 days
Diffstat (limited to 'sbin/hastd/metadata.c')
-rw-r--r-- | sbin/hastd/metadata.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sbin/hastd/metadata.c b/sbin/hastd/metadata.c index de21b53..ad6c75b 100644 --- a/sbin/hastd/metadata.c +++ b/sbin/hastd/metadata.c @@ -30,7 +30,6 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include <assert.h> #include <errno.h> #include <fcntl.h> #include <string.h> @@ -100,7 +99,7 @@ metadata_read(struct hast_resource *res, bool openrw) goto fail; } buf = ebuf_data(eb, NULL); - assert(buf != NULL); + PJDLOG_ASSERT(buf != NULL); done = pread(res->hr_localfd, buf, METADATA_SIZE, 0); if (done < 0 || done != METADATA_SIZE) { rerrno = errno; @@ -197,7 +196,7 @@ metadata_write(struct hast_resource *res) nv_add_uint64(nv, res->hr_primary_localcnt, "localcnt"); nv_add_uint64(nv, res->hr_primary_remotecnt, "remotecnt"); } else /* if (res->hr_role == HAST_ROLE_SECONDARY) */ { - assert(res->hr_role == HAST_ROLE_SECONDARY); + PJDLOG_ASSERT(res->hr_role == HAST_ROLE_SECONDARY); nv_add_uint64(nv, res->hr_secondary_localcnt, "localcnt"); nv_add_uint64(nv, res->hr_secondary_remotecnt, "remotecnt"); } @@ -208,10 +207,10 @@ metadata_write(struct hast_resource *res) } res->hr_previous_role = res->hr_role; eb = nv_hton(nv); - assert(eb != NULL); + PJDLOG_ASSERT(eb != NULL); ptr = ebuf_data(eb, &size); - assert(ptr != NULL); - assert(size < METADATA_SIZE); + PJDLOG_ASSERT(ptr != NULL); + PJDLOG_ASSERT(size < METADATA_SIZE); bcopy(ptr, buf, size); done = pwrite(res->hr_localfd, buf, METADATA_SIZE, 0); if (done < 0 || done != METADATA_SIZE) { |