rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: mlevitsk@redhat.com
To: Paolo Bonzini <pbonzini@redhat.com>,
	linux-kernel@vger.kernel.org,  kvm@vger.kernel.org
Cc: rust-for-linux@vger.kernel.org, ojeda@kernel.org,
	Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: [PATCH] rust: add helper for mutex_trylock
Date: Wed, 28 May 2025 12:08:23 -0400	[thread overview]
Message-ID: <fadc8e044c3b18984b0ca4a88ef214feb779034d.camel@redhat.com> (raw)
In-Reply-To: <20250528083431.1875345-1-pbonzini@redhat.com>

On Wed, 2025-05-28 at 10:34 +0200, Paolo Bonzini wrote:
> After commit c5b6ababd21a ("locking/mutex: implement mutex_trylock_nested",
> currently in the KVM tree) mutex_trylock() will be a macro when lockdep is
> enabled.  Rust therefore needs the corresponding helper.  Just add it and
> the rust/bindings/bindings_helpers_generated.rs Makefile rules will do
> their thing.
> 
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


Hi,
Sorry for that. 

Next time I'll check rust bindings as well, I never had to deal with them before.

Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>

Best regards,
	Maxim Levitsky


> ---
>         Ok to apply to the KVM tree?
> 
>  rust/helpers/mutex.c                               |   5 +++++
>  1 files changed, 5 insertions(+)
> 
> diff a/rust/helpers/mutex.c b/rust/helpers/mutex.c
> index 06575553eda5,06575553eda5..9ab29104bee1
> --- a/rust/helpers/mutex.c
> +++ b/rust/helpers/mutex.c
> @@ -7,6 +7,11 @@ void rust_helper_mutex_lock(struct mute
>  	mutex_lock(lock);
>  }
>  
> +int rust_helper_mutex_trylock(struct mutex *lock)
> +{
> +	return mutex_trylock(lock);
> +}
> +
>  void rust_helper___mutex_init(struct mutex *mutex, const char *name,
>  			      struct lock_class_key *key)
>  {
> 
> 


      parent reply	other threads:[~2025-05-28 16:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-28  8:34 [PATCH] rust: add helper for mutex_trylock Paolo Bonzini
2025-05-28  9:39 ` Miguel Ojeda
2025-05-28 14:51   ` Boqun Feng
2025-05-28 10:23 ` Alice Ryhl
2025-05-28 16:08 ` mlevitsk [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fadc8e044c3b18984b0ca4a88ef214feb779034d.camel@redhat.com \
    --to=mlevitsk@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).