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

WIP: open_at #21

Closed
wants to merge 1 commit into from
Closed

WIP: open_at #21

wants to merge 1 commit into from

Conversation

problame
Copy link
Collaborator

Can't merge this as because it copies the OpenOptions code from tokio-uring.

Maybe just fork tokio-uring and make pub the APIs we need?

@arpad-m
Copy link
Member

arpad-m commented Nov 10, 2023

Maybe just fork tokio-uring and make pub the APIs we need?

What about doing a pull request to tokio-uring, explaining our use case?

problame added a commit that referenced this pull request Nov 20, 2023
…okio-uring`

For [`open_at`
support](#21) we
need an `OpenOptions` struct. Sadly we can't re-use the one from
`tokio-uring` because it doesn't have a public API for the conversion of
OpenOptions into the relevant libc flags.

We created [a PR asking for such an
API](neondatabase/tokio-uring#1), but, in the
meantime, let's unblock ourselves by vendoring the pieces of
`tokio-uring` that we need, and cusotmize them as needed.

The files that reproduce the `tokio-uring` LICENSE text at the top
are copied from `tokio-uring.git:d5e90539bd6d1c518e848298564a098c300866bc`.

Files without it were written by myself.
problame added a commit that referenced this pull request Nov 20, 2023
For [`open_at`
support](#21) we
need an `OpenOptions` struct. Sadly we can't re-use the one from
`tokio-uring` because it doesn't have a public API for the conversion of
OpenOptions into the relevant libc flags.

We created [a PR asking for such an
API](neondatabase/tokio-uring#1), but, in the
meantime, let's unblock ourselves by vendoring the pieces of
`tokio-uring` that we need, and cusotmize them as needed.

This PR starts that effort by vendoring the `IoBuf`/`IoBufMut` traits.
`OpenOptions` will follow in a later PR.

The files that reproduce the `tokio-uring` LICENSE text at the top
are copied from `tokio-uring.git:d5e90539bd6d1c518e848298564a098c300866bc`.

Files without it were written by myself.
problame added a commit that referenced this pull request Nov 20, 2023
For [`open_at`
support](#21) we
need an `OpenOptions` struct. Sadly we can't re-use the one from
`tokio-uring` because it doesn't have a public API for the conversion of
OpenOptions into the relevant libc flags.

We created [a PR asking for such an
API](neondatabase/tokio-uring#1), but, in the
meantime, let's unblock ourselves by vendoring the pieces of
`tokio-uring` that we need, and cusotmize them as needed.

This PR starts that effort by vendoring the `IoBuf`/`IoBufMut` traits.
`OpenOptions` will follow in a later PR.

The files that reproduce the `tokio-uring` LICENSE text at the top
are copied from `tokio-uring.git:d5e90539bd6d1c518e848298564a098c300866bc`.

Files without it were written by myself.
This was referenced Nov 20, 2023
@problame
Copy link
Collaborator Author

I prototyped the idea to PR against tokio-uring in neondatabase/tokio-uring#1

However I think it would still be awkward to use their OpenOptions in the tokio_epoll_uring API because, e.g., it wold still contain their OpenOptions::open() function, which obviously doesn't work in tokio_epoll_uring.

Hence I took the approach of vendoring in all tokio-uring code: #25

problame added a commit that referenced this pull request Nov 20, 2023
For [`open_at`
support](#21) we
need an `OpenOptions` struct. Sadly we can't re-use the one from
`tokio-uring` because it doesn't have a public API for the conversion of
OpenOptions into the relevant libc flags.

We created [a PR asking for such an
API](neondatabase/tokio-uring#1), but, in the
meantime, let's unblock ourselves by vendoring the pieces of
`tokio-uring` that we need, and cusotmize them as needed.

This PR starts that effort by vendoring the `IoBuf`/`IoBufMut` traits.
`OpenOptions` will follow in a later PR.

The files that reproduce the `tokio-uring` LICENSE text at the top
are copied from `tokio-uring.git:d5e90539bd6d1c518e848298564a098c300866bc`.

Files without it were written by myself.
problame added a commit that referenced this pull request Nov 20, 2023
For [`open_at`
support](#21) we
need an `OpenOptions` struct. Sadly we can't re-use the one from
`tokio-uring` because it doesn't have a public API for the conversion of
OpenOptions into the relevant libc flags.

We created [a PR asking for such an
API](neondatabase/tokio-uring#1), but, in the
meantime, let's unblock ourselves by vendoring the pieces of
`tokio-uring` that we need, and cusotmize them as needed.

This PR starts that effort by vendoring the `IoBuf`/`IoBufMut` traits.
`OpenOptions` will follow in a later PR.

The files that reproduce the `tokio-uring` LICENSE text at the top
are copied from `tokio-uring.git:d5e90539bd6d1c518e848298564a098c300866bc`.

Files without it were written by myself.
problame added a commit that referenced this pull request Nov 22, 2023
In the draft PR for [`open_at`
support](#21) we
need an `OpenOptions` struct. Sadly we can't re-use the one from
`tokio-uring` because it doesn't have a public API for the conversion of
OpenOptions into the relevant libc flags.

We created [a PR asking for such an
API](neondatabase/tokio-uring#1), but, in the
meantime, let's unblock ourselves by vendoring the pieces of
`tokio-uring` that we need, and cusotmize them as needed.

This PR starts that effort by vendoring the `IoBuf`/`IoBufMut` traits as
well as `tokio-uring`'s approach to support slice-like operations.
Support for `OpenOptions` will follow as part of [the PR that adds
`open_at` support on top of this
PR](#25).

The files that reproduce the `tokio-uring` LICENSE text at the top are
copied from `tokio-uring.git:d5e90539bd6d1c518e848298564a098c300866bc`.
Files without it were written by myself.

To make `cargo test` pass, I had to remove the examples in the doc
comments.
problame added a commit that referenced this pull request Nov 22, 2023
(Stacked atop #24)

* Vendor in `OpenOptions` from
`tokio-uring.git:d5e90539bd6d1c518e848298564a098c300866bc`
* Remove the `OpenOptions::open()` function which is
  `tokio-uring`-specific
* Remove examples because they mention `tokio_uring` and hence fail
`cargo test`
* Add the extension trait that allows for conversion of OpenOptions into
  an `io_uring::squeue::Entry`
* Use it throughout the code base.

This PR obsoletes
#21
@problame
Copy link
Collaborator Author

Obsoleted by #25

@problame problame closed this Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants