From: Alexander Aring <aahringo@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH RESEND v5.15-rc7 15/18] fs: dlm: allow create lkb with specific id range
Date: Tue, 2 Nov 2021 15:17:21 -0400 [thread overview]
Message-ID: <20211102191724.210095-16-aahringo@redhat.com> (raw)
In-Reply-To: <20211102191724.210095-1-aahringo@redhat.com>
This patch adds functionality to add a lkb with a specific id range.
Signed-off-by: Alexander Aring <aahringo@redhat.com>
---
fs/dlm/lock.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index feb2e94f5879..8b30c9d9e545 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -1180,7 +1180,8 @@ static void detach_lkb(struct dlm_lkb *lkb)
}
}
-static int create_lkb(struct dlm_ls *ls, struct dlm_lkb **lkb_ret)
+static int _create_lkb(struct dlm_ls *ls, struct dlm_lkb **lkb_ret,
+ int start, int end)
{
struct dlm_lkb *lkb;
int rv;
@@ -1201,7 +1202,7 @@ static int create_lkb(struct dlm_ls *ls, struct dlm_lkb **lkb_ret)
idr_preload(GFP_NOFS);
spin_lock(&ls->ls_lkbidr_spin);
- rv = idr_alloc(&ls->ls_lkbidr, lkb, 1, 0, GFP_NOWAIT);
+ rv = idr_alloc(&ls->ls_lkbidr, lkb, start, end, GFP_NOWAIT);
if (rv >= 0)
lkb->lkb_id = rv;
spin_unlock(&ls->ls_lkbidr_spin);
@@ -1217,6 +1218,11 @@ static int create_lkb(struct dlm_ls *ls, struct dlm_lkb **lkb_ret)
return 0;
}
+static int create_lkb(struct dlm_ls *ls, struct dlm_lkb **lkb_ret)
+{
+ return _create_lkb(ls, lkb_ret, 1, 0);
+}
+
static int find_lkb(struct dlm_ls *ls, uint32_t lkid, struct dlm_lkb **lkb_ret)
{
struct dlm_lkb *lkb;
--
2.27.0
next prev parent reply other threads:[~2021-11-02 19:17 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-02 19:17 [Cluster-devel] [PATCH RESEND v5.15-rc7 00/18] fs: dlm: cleanups, trace and debugfs Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 01/18] fs: dlm: remove obsolete INBUF define Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 02/18] fs: dlm: fix small lockspace typo Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 03/18] fs: dlm: debug improvements print nodeid Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 04/18] fs: dlm: remove check SCTP is loaded message Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 05/18] fs: dlm: move version conversion to compile time Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 06/18] fs: dlm: use dlm_recovery_stopped instead of test_bit Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 07/18] fs: dlm: use dlm_recovery_stopped in condition Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 08/18] fs: dlm: make dlm_callback_resume quite Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 09/18] fs: dlm: initial support for tracepoints Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 10/18] fs: dlm: trace socket handling Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 11/18] fs: dlm: requestqueue busy wait to event based wait Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 12/18] fs: dlm: ls_count " Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 13/18] fs: dlm: let handle callback data as void Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 14/18] fs: dlm: add debugfs rawmsg send functionality Alexander Aring
2021-11-02 19:17 ` Alexander Aring [this message]
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 16/18] fs: dlm: add lkb debugfs functionality Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 17/18] fs: dlm: add lkb waiters " Alexander Aring
2021-11-02 19:17 ` [Cluster-devel] [PATCH RESEND v5.15-rc7 18/18] fs: dlm: filter user dlm messages for kernel locks Alexander Aring
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=20211102191724.210095-16-aahringo@redhat.com \
--to=aahringo@redhat.com \
/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).