summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs/src/jffs2/include/rtems/jffs2.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/libfs/src/jffs2/include/rtems/jffs2.h')
-rw-r--r--cpukit/libfs/src/jffs2/include/rtems/jffs2.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/cpukit/libfs/src/jffs2/include/rtems/jffs2.h b/cpukit/libfs/src/jffs2/include/rtems/jffs2.h
index 11735cbb09..b786415b68 100644
--- a/cpukit/libfs/src/jffs2/include/rtems/jffs2.h
+++ b/cpukit/libfs/src/jffs2/include/rtems/jffs2.h
@@ -230,6 +230,20 @@ typedef void (*rtems_jffs2_flash_destroy)(
);
/**
+ * @brief Trigger garbage collection operation.
+ *
+ * An optional garbage collection thread may perform now a garbage collection
+ * using the RTEMS_JFFS2_ON_DEMAND_GARBAGE_COLLECTION IO control.
+ *
+ * The garbage collection must not run in the executing context.
+ *
+ * @param[in] self The flash control.
+ */
+typedef void (*rtems_jffs2_trigger_garbage_collection)(
+ rtems_jffs2_flash_control *self
+);
+
+/**
* @brief JFFS2 flash device control.
*/
struct rtems_jffs2_flash_control {
@@ -275,6 +289,15 @@ struct rtems_jffs2_flash_control {
* file system node in the system.
*/
dev_t device_identifier;
+
+ /**
+ * @brief Trigger garbage collection operation.
+ *
+ * This operation is optional and may be NULL. This operation should wake up
+ * a garbage collection thread. The garbage collection thread should use the
+ * RTEMS_JFFS2_ON_DEMAND_GARBAGE_COLLECTION IO control to carry out the work.
+ */
+ rtems_jffs2_trigger_garbage_collection trigger_garbage_collection;
};
typedef struct rtems_jffs2_compressor_control rtems_jffs2_compressor_control;
@@ -556,6 +579,15 @@ typedef struct {
#define RTEMS_JFFS2_GET_INFO _IOR('F', 1, rtems_jffs2_info)
/**
+ * @brief IO control to perform an on demand garbage collection in a JFFS2
+ * filesystem instance.
+ *
+ * This operation is intended to be used by an optional garbage collection
+ * thread. See rtems_jffs2_flash_control::trigger_garbage_collection.
+ */
+#define RTEMS_JFFS2_ON_DEMAND_GARBAGE_COLLECTION _IO('F', 2)
+
+/**
* @brief IO control to force a garbage collection in a JFFS2 filesystem
* instance.
*