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

_set_sqe_cmd_op: Simplify the code - direct variable access #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 2 additions & 4 deletions include/ublksrv_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,8 @@ static inline void *ublksrv_get_sqe_cmd(struct io_uring_sqe *sqe)

static inline void ublksrv_set_sqe_cmd_op(struct io_uring_sqe *sqe, __u32 cmd_op)
{
__u32 *addr = (__u32 *)&sqe->off;

addr[0] = cmd_op;
addr[1] = 0;
sqe->cmd_op = cmd_op;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I write ublksrv, the header isn't updated yet, even though SQE128 is supported. It is just fine to use the current way, at least it still can build successfully against old header.

But your patch is fine, and I will apply it after automake patches are merged,
and liburing2.2 is required explicitly by that patchset.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! I didn't know about the history and didn't check liburing versions. I'm just going through the code to understand how it works and how I can use it for fuse.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, just curious how you use it for fuse? I understand fuse is userspace FS, and look it needn't one block device.

sqe->__pad1 = 0;
}

#ifdef DEBUG
Expand Down