thread: Add spdk_thread_get_interrupt_fd_group that returns spdk_fd_group

Return the real spdk_fd_group object so it can later be nested.

Change-Id: I84c8a174c7d177799fa484b350269082c61b18a5
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15474
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: John Levon <levon@movementarian.org>
This commit is contained in:
Ben Walker 2022-11-16 12:37:53 -07:00 committed by Tomasz Zawadzki
parent 059073c4d9
commit 07ca24ec59
3 changed files with 19 additions and 0 deletions

View File

@ -15,6 +15,7 @@
#include <sys/epoll.h>
#endif
#include "spdk/fd_group.h"
#include "spdk/stdinc.h"
#include "spdk/assert.h"
#include "spdk/cpuset.h"
@ -874,6 +875,17 @@ int spdk_interrupt_set_event_types(struct spdk_interrupt *intr,
*/
int spdk_thread_get_interrupt_fd(struct spdk_thread *thread);
/**
* Return an fd_group that becomes ready whenever any of the registered
* interrupt file descriptors are ready
*
*
* \param thread The thread to get.
*
* \return The spdk_fd_group of the thread itself.
*/
struct spdk_fd_group *spdk_thread_get_interrupt_fd_group(struct spdk_thread *thread);
/**
* Set SPDK run as event driven mode
*

View File

@ -55,6 +55,7 @@
spdk_interrupt_unregister;
spdk_interrupt_set_event_types;
spdk_thread_get_interrupt_fd;
spdk_thread_get_interrupt_fd_group;
spdk_interrupt_mode_enable;
spdk_interrupt_mode_is_enabled;
spdk_spin_init;

View File

@ -2877,6 +2877,12 @@ spdk_thread_get_interrupt_fd(struct spdk_thread *thread)
return spdk_fd_group_get_fd(thread->fgrp);
}
struct spdk_fd_group *
spdk_thread_get_interrupt_fd_group(struct spdk_thread *thread)
{
return thread->fgrp;
}
static bool g_interrupt_mode = false;
int