From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A49BC4338F for ; Thu, 5 Aug 2021 15:42:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 420F161151 for ; Thu, 5 Aug 2021 15:42:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242447AbhHEPmn (ORCPT ); Thu, 5 Aug 2021 11:42:43 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:43740 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242323AbhHEPll (ORCPT ); Thu, 5 Aug 2021 11:41:41 -0400 Message-ID: <20210805153953.683678014@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1628178086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=UrNR0djrmauHt61tRaE2+iZTNd/mMoVONuviNIKMRKA=; b=3U4EtvjMdwev/4ojs4Ip41eDwvV7gp371A/WBo4L8aY0sxkX8KTln2j6dGpoqiNXduSui4 3BnFWy21hw136UTZOjGyTuJOqaA9xFD3Si1Hqd4Ia9AdAU3lFWD8WHXWAwbbQk80CcYgr2 WbA+pDRHtEeC9kcL9AUl44SOUYZJGPVZa8azHzbVren3UfzjcWgfFTTb7eITPDS8SVCSAq AoKHi7w5vUFJRdJNjP4Od63D3t/ctec3+tmbvQcqX4YKbx1v1oyi3vKGKF6FCcJfbkl5cH 518rf4vIu5l1bwCt38zDTGMoXM1qzYjuXdJe59imlT730C2WqA5vzg2cGhRPAw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1628178086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=UrNR0djrmauHt61tRaE2+iZTNd/mMoVONuviNIKMRKA=; b=6PTXzdrVru9A2ky5+x8uicTOXcmAcSviGo6i9BJnr81eKLLb7GFcYBfmKNgBi/hwkbhSvs aoipyLCkgl7E1UBQ== Date: Thu, 05 Aug 2021 17:13:15 +0200 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Ingo Molnar , Juri Lelli , Steven Rostedt , Daniel Bristot de Oliveira , Will Deacon , Waiman Long , Boqun Feng , Sebastian Andrzej Siewior , Davidlohr Bueso , Mike Galbraith Subject: [patch V3 15/64] rtmutex: Provide rt_mutex_base_is_locked() References: <20210805151300.330412127@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Provide rt_mutex_base_is_locked() which will be used for various wrapped locking primitives for RT. Signed-off-by: Thomas Gleixner --- include/linux/rtmutex.h | 11 +++++++++++ 1 file changed, 11 insertions(+) --- a/include/linux/rtmutex.h +++ b/include/linux/rtmutex.h @@ -32,6 +32,17 @@ struct rt_mutex_base { .owner = NULL \ } +/** + * rt_mutex_base_is_locked - is the rtmutex locked + * @lock: the mutex to be queried + * + * Returns true if the mutex is locked, false if unlocked. + */ +static inline bool rt_mutex_base_is_locked(struct rt_mutex_base *lock) +{ + return lock->owner != NULL; +} + extern void rt_mutex_base_init(struct rt_mutex_base *rtb); /**