Rust-for-Linux / linux

Adding support for the Rust language to the Linux kernel.
https://rust-for-linux.com
Other
3.83k stars 399 forks source link

Add `ARef::into_raw` #1056

Open Kartik1397 opened 5 months ago

Kartik1397 commented 5 months ago

Closes: #1044

Kartik1397 commented 5 months ago

Opened this PR for the initial review.

y86-dev commented 5 months ago

Thanks for the patch!

I think it would be a good idea to mention that this function does not decrement the reference count.

For the example it would be very nice to not have to create an Empty type that implements AlwaysRefCounted. In the rust-dev branch you could use File .

Kartik1397 commented 5 months ago

Thanks for checking the patch @y86-dev!

I think it would be a good idea to mention that this function does not decrement the reference count.

I've added this as a note in doc comment.

For the example it would be very nice to not have to create an Empty type that implements AlwaysRefCounted. In the rust-dev branch you could use File.

In rust-next only struct Task implements AlwaysRefCounted trait. Should I try to write an example using Task? Also, do changes to rust-dev branch also go through the mailing list or github PR?

ojeda commented 5 months ago

Everything for upstream goes through the mailing list -- please see https://rust-for-linux.com/contributing#the-kernel-development-process.

While File is not yet in rust-next, it may land relatively soon. So if you wish to use File, you could send the patch on top of the File patch series.

Kartik1397 commented 5 months ago

While File is not yet in rust-next, it may land relatively soon. So if you wish to use File, you could send the patch on top of the File patch series.

To send a patch on top of another patch series, do I need to do anything apart from mentioning dependent patch in commit message as described in this doc?

ojeda commented 5 months ago

That would be enough, yeah (below the --- marker, i.e. outside the commit message itself). Ideally, you can put the URL to the patch series you used, to be unambiguous. For instance: https://lore.kernel.org/rust-for-linux/20240118-alice-file-v3-0-9694b6f9580c@google.com/

Thanks!

vincenzopalazzo commented 3 months ago

@ojeda this patch when upstream? or I can take to push it to the finish line?

ojeda commented 3 months ago

I don't think it was sent to the mailing list.

ojeda commented 3 months ago

@Kartik1397 Do you plan to send this to the mailing list, or would you prefer that @vincenzopalazzo sends it on your behalf? (you would still be mentioned as author or co-author)

Thanks!

Kartik1397 commented 3 months ago

@ojeda I wouldn't be able to work on this for at least two more weeks as I'm currently engaged in another project. @vincenzopalazzo Feel free to take this patch and push it to the finish line. This would be great!

Thanks!