Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libublksrv: Build fixes for 32-bit systems and external integration #76

Merged
merged 2 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions lib/ublksrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ int ublksrv_queue_handled_event(const struct ublksrv_queue *tq)
struct _ublksrv_queue *q = tq_to_local(tq);

if (q->efd >= 0) {
unsigned long long data;
uint64_t data;
const int cnt = sizeof(uint64_t);

/* read has to be done, otherwise poll event won't be stopped */
Expand Down Expand Up @@ -267,7 +267,7 @@ int ublksrv_queue_send_event(const struct ublksrv_queue *tq)
struct _ublksrv_queue *q = tq_to_local(tq);

if (q->efd >= 0) {
unsigned long long data = 1;
uint64_t data = 1;
const int cnt = sizeof(uint64_t);

if (write(q->efd, &data, cnt) != cnt) {
Expand Down Expand Up @@ -412,13 +412,13 @@ static void ublksrv_set_sched_affinity(struct _ublksrv_dev *dev,
static void ublksrv_kill_eventfd(struct _ublksrv_queue *q)
{
if ((q->state & UBLKSRV_QUEUE_STOPPING) && q->efd >= 0) {
unsigned long long data = 1;
uint64_t data = 1;
int ret;

ret = write(q->efd, &data, 8);
if (ret != 8)
ublk_err("%s:%d write fail %d/%d\n",
__func__, __LINE__, ret, 8);
ret = write(q->efd, &data, sizeof(uint64_t));
if (ret != sizeof(uint64_t))
ublk_err("%s:%d write fail %d/%zu\n",
__func__, __LINE__, ret, sizeof(uint64_t));
}
}

Expand Down Expand Up @@ -899,13 +899,13 @@ static void ublksrv_submit_aio_batch(struct _ublksrv_queue *q)

for (i = 0; i < q->nr_ctxs; i++) {
struct ublksrv_aio_ctx *ctx = q->ctxs[i];
unsigned long data = 1;
uint64_t data = 1;
int ret;

ret = write(ctx->efd, &data, 8);
if (ret != 8)
ublk_err("%s:%d write fail %d/%d\n",
__func__, __LINE__, ret, 8);
ret = write(ctx->efd, &data, sizeof(uint64_t));
if (ret != sizeof(uint64_t))
ublk_err("%s:%d write fail ctx[%d]: %d/%zu\n",
__func__, __LINE__, i, ret, sizeof(uint64_t));
}
}

Expand Down
3 changes: 3 additions & 0 deletions lib/ublksrv_aio.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// SPDX-License-Identifier: MIT or LGPL-2.1-only

#ifndef _GNU_SOURCE
#define _GNU_SOURCE
dhavale marked this conversation as resolved.
Show resolved Hide resolved
#endif

#include "ublksrv_priv.h"

#define aio_log ublk_log
Expand Down
Loading