forked from Imagelibrary/rtems
Filesystem: Use transient event
This commit is contained in:
@@ -1462,8 +1462,9 @@ struct rtems_filesystem_mount_table_entry_tt {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The task that initiated the unmount process. After unmount process
|
* The task that initiated the unmount process. After unmount process
|
||||||
* completion this task will be notified via the
|
* completion this task will be notified via the transient event.
|
||||||
* @ref RTEMS_FILESYSTEM_UNMOUNT_EVENT.
|
*
|
||||||
|
* @see ClassicEventTransient.
|
||||||
*/
|
*/
|
||||||
rtems_id unmount_task;
|
rtems_id unmount_task;
|
||||||
};
|
};
|
||||||
@@ -1526,15 +1527,16 @@ int rtems_filesystem_unregister(
|
|||||||
* unmounted file system the function returns with an error status and errno is
|
* unmounted file system the function returns with an error status and errno is
|
||||||
* set to EBUSY.
|
* set to EBUSY.
|
||||||
*
|
*
|
||||||
* The unmount process completion notification uses the RTEMS classic API
|
* The unmount process completion notification uses the transient event. It is
|
||||||
* event @ref RTEMS_FILESYSTEM_UNMOUNT_EVENT. It is a fatal error to terminate
|
* a fatal error to terminate the calling thread while waiting for this event.
|
||||||
* the calling thread while waiting for this event.
|
|
||||||
*
|
*
|
||||||
* A concurrent unmount request for the same file system instance has
|
* A concurrent unmount request for the same file system instance has
|
||||||
* unpredictable effects.
|
* unpredictable effects.
|
||||||
*
|
*
|
||||||
* @retval 0 Successful operation.
|
* @retval 0 Successful operation.
|
||||||
* @retval -1 An error occured. The @c errno indicates the error.
|
* @retval -1 An error occured. The @c errno indicates the error.
|
||||||
|
*
|
||||||
|
* @see ClassicEventTransient.
|
||||||
*/
|
*/
|
||||||
int unmount(
|
int unmount(
|
||||||
const char *mount_path
|
const char *mount_path
|
||||||
|
|||||||
@@ -38,16 +38,6 @@ extern "C" {
|
|||||||
#define RTEMS_LIBIO_SEM rtems_build_name('L', 'B', 'I', 'O')
|
#define RTEMS_LIBIO_SEM rtems_build_name('L', 'B', 'I', 'O')
|
||||||
#define RTEMS_LIBIO_IOP_SEM(n) rtems_build_name('L', 'B', 'I', n)
|
#define RTEMS_LIBIO_IOP_SEM(n) rtems_build_name('L', 'B', 'I', n)
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Event to signal an unmount process completion.
|
|
||||||
*
|
|
||||||
* This event should equal the RTEMS_BDBUF_TRANSFER_SYNC event to avoid too
|
|
||||||
* many events reserved for the file system.
|
|
||||||
*
|
|
||||||
* @see rtems_filesystem_do_unmount() and unmount().
|
|
||||||
*/
|
|
||||||
#define RTEMS_FILESYSTEM_UNMOUNT_EVENT RTEMS_EVENT_1
|
|
||||||
|
|
||||||
extern rtems_id rtems_libio_semaphore;
|
extern rtems_id rtems_libio_semaphore;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ void rtems_filesystem_do_unmount(
|
|||||||
|
|
||||||
if (mt_entry->unmount_task != 0) {
|
if (mt_entry->unmount_task != 0) {
|
||||||
rtems_status_code sc =
|
rtems_status_code sc =
|
||||||
rtems_event_send(mt_entry->unmount_task, RTEMS_FILESYSTEM_UNMOUNT_EVENT);
|
rtems_event_transient_send(mt_entry->unmount_task);
|
||||||
if (sc != RTEMS_SUCCESSFUL) {
|
if (sc != RTEMS_SUCCESSFUL) {
|
||||||
rtems_fatal_error_occurred(0xdeadbeef);
|
rtems_fatal_error_occurred(0xdeadbeef);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,12 +70,9 @@ int unmount( const char *path )
|
|||||||
rtems_filesystem_eval_path_cleanup( &ctx );
|
rtems_filesystem_eval_path_cleanup( &ctx );
|
||||||
|
|
||||||
if ( rv == 0 ) {
|
if ( rv == 0 ) {
|
||||||
rtems_event_set out;
|
rtems_status_code sc = rtems_event_transient_receive(
|
||||||
rtems_status_code sc = rtems_event_receive(
|
RTEMS_WAIT,
|
||||||
RTEMS_FILESYSTEM_UNMOUNT_EVENT,
|
RTEMS_NO_TIMEOUT
|
||||||
RTEMS_EVENT_ALL | RTEMS_WAIT,
|
|
||||||
RTEMS_NO_TIMEOUT,
|
|
||||||
&out
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( sc != RTEMS_SUCCESSFUL ) {
|
if ( sc != RTEMS_SUCCESSFUL ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user