mirror of
https://github.com/torvalds/linux.git
synced 2024-11-13 23:51:39 +00:00
61bed0baa4
This patch will introducde a queue implementation for callbacks by using the Linux lists. The current callback queue handling is implemented by a static limit of 6 entries, see DLM_CALLBACKS_SIZE. The sequence number inside the callback structure was used to see if the entries inside the static entry is valid or not. We don't need any sequence numbers anymore with a dynamic datastructure with grows and shrinks during runtime to offer such functionality. We assume that every callback will be delivered to the DLM user if once queued. Therefore the callback flag DLM_CB_SKIP was dropped and the check for skipping bast was moved before worker handling and not skip while the callback worker executes. This will reduce unnecessary queues of the callback worker. All last callback saves are pointers now and don't need to copied over. There is a reference counter for callback structures which will care about to free the callback structures at the right time if they are not referenced anymore. Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
39 lines
1.4 KiB
C
39 lines
1.4 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/******************************************************************************
|
|
*******************************************************************************
|
|
**
|
|
** Copyright (C) 2005-2010 Red Hat, Inc. All rights reserved.
|
|
**
|
|
**
|
|
*******************************************************************************
|
|
******************************************************************************/
|
|
|
|
#ifndef __ASTD_DOT_H__
|
|
#define __ASTD_DOT_H__
|
|
|
|
#define DLM_ENQUEUE_CALLBACK_NEED_SCHED 1
|
|
#define DLM_ENQUEUE_CALLBACK_SUCCESS 0
|
|
#define DLM_ENQUEUE_CALLBACK_FAILURE -1
|
|
int dlm_enqueue_lkb_callback(struct dlm_lkb *lkb, uint32_t flags, int mode,
|
|
int status, uint32_t sbflags);
|
|
#define DLM_DEQUEUE_CALLBACK_EMPTY 2
|
|
#define DLM_DEQUEUE_CALLBACK_LAST 1
|
|
#define DLM_DEQUEUE_CALLBACK_SUCCESS 0
|
|
int dlm_dequeue_lkb_callback(struct dlm_lkb *lkb, struct dlm_callback **cb);
|
|
void dlm_add_cb(struct dlm_lkb *lkb, uint32_t flags, int mode, int status,
|
|
uint32_t sbflags);
|
|
void dlm_callback_set_last_ptr(struct dlm_callback **from,
|
|
struct dlm_callback *to);
|
|
|
|
void dlm_release_callback(struct kref *ref);
|
|
void dlm_purge_lkb_callbacks(struct dlm_lkb *lkb);
|
|
void dlm_callback_work(struct work_struct *work);
|
|
int dlm_callback_start(struct dlm_ls *ls);
|
|
void dlm_callback_stop(struct dlm_ls *ls);
|
|
void dlm_callback_suspend(struct dlm_ls *ls);
|
|
void dlm_callback_resume(struct dlm_ls *ls);
|
|
|
|
#endif
|
|
|
|
|