[Concept,05/11] ext4l: Extract freezer.h declarations into their own file

Message ID 20251216211817.4131167-6-sjg@u-boot.org
State New
Headers
Series ext4l: Add Linux compatibility headers |

Commit Message

Simon Glass Dec. 16, 2025, 9:18 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Create include/linux/freezer.h with stub definitions for process
freezer functions used during suspend/hibernate. U-Boot doesn't
support process freezing, so these are no-ops.

Update compat.h to include freezer.h and remove duplicate definitions.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 include/linux/compat.h  |  3 +--
 include/linux/freezer.h | 17 +++++++++++++++++
 2 files changed, 18 insertions(+), 2 deletions(-)
 create mode 100644 include/linux/freezer.h
  

Patch

diff --git a/include/linux/compat.h b/include/linux/compat.h
index d66ca200602..190c3820a14 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -12,6 +12,7 @@ 
 #include <linux/types.h>
 #include <linux/err.h>
 #include <linux/export.h>
+#include <linux/freezer.h>
 #include <linux/kernel.h>
 #include <linux/uaccess.h>
 
@@ -228,8 +229,6 @@  typedef unsigned long blkcnt_t;
 #define dump_stack(...)			do { } while (0)
 
 #define task_pid_nr(x)			0
-#define set_freezable(...)		do { } while (0)
-#define try_to_freeze(...)		0
 #define set_current_state(...)		do { } while (0)
 #define kthread_should_stop(...)	0
 
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
new file mode 100644
index 00000000000..be38266beeb
--- /dev/null
+++ b/include/linux/freezer.h
@@ -0,0 +1,17 @@ 
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Freezer declarations
+ *
+ * Stub definitions for Linux kernel freezer (suspend/hibernate).
+ * U-Boot doesn't support process freezing.
+ */
+#ifndef _LINUX_FREEZER_H
+#define _LINUX_FREEZER_H
+
+#define set_freezable()			do { } while (0)
+#define try_to_freeze()			0
+#define freezing(task)			0
+#define frozen(task)			0
+#define freezable_schedule()		do { } while (0)
+#define freezable_schedule_timeout(t)	0
+
+#endif /* _LINUX_FREEZER_H */