[Concept,17/19] linux: blkdev: Add blk_plug structure and operations

Message ID 20260117011448.3007171-18-sjg@u-boot.org
State New
Headers
Series ext4l: Reduce ext4_uboot.h size by moving code to include/linux |

Commit Message

Simon Glass Jan. 17, 2026, 1:14 a.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Move block I/O plugging stubs to linux/blkdev.h where they belong
in the Linux kernel organisation.

Add to blkdev.h:
- struct blk_plug - block I/O plug structure
- blk_start_plug() - start plugging (stub no-op)
- blk_finish_plug() - finish plugging (stub no-op)

These are stubs since U-Boot doesn't use block I/O plugging.

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

 fs/ext4l/ext4_uboot.h  |  7 +------
 include/linux/blkdev.h | 25 +++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 6 deletions(-)
  

Patch

diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h
index aa357599449..979af9ed22a 100644
--- a/fs/ext4l/ext4_uboot.h
+++ b/fs/ext4l/ext4_uboot.h
@@ -925,12 +925,7 @@  static inline xa_mark_t wbc_to_tag(struct writeback_control *wbc)
 	return PAGECACHE_TAG_DIRTY;
 }
 
-/* blk_plug - block I/O plugging stub */
-struct blk_plug {
-	int dummy;
-};
-#define blk_start_plug(p)		do { (void)(p); } while (0)
-#define blk_finish_plug(p)		do { (void)(p); } while (0)
+/* blk_plug is now in linux/blkdev.h */
 
 /* Writeback reasons */
 #define WB_REASON_FS_FREE_SPACE	0
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 92878b01c3e..8c848139a7e 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -18,4 +18,29 @@  struct gendisk;
 /* Block size helpers */
 #define bdev_logical_block_size(bdev)	512
 
+/**
+ * struct blk_plug - block I/O plug
+ *
+ * U-Boot stub - block I/O plugging is not used.
+ */
+struct blk_plug {
+	int dummy;
+};
+
+/**
+ * blk_start_plug() - start plugging block I/O
+ * @plug: plug structure
+ *
+ * U-Boot stub - no-op.
+ */
+#define blk_start_plug(plug)	do { (void)(plug); } while (0)
+
+/**
+ * blk_finish_plug() - finish plugging and submit I/O
+ * @plug: plug structure
+ *
+ * U-Boot stub - no-op.
+ */
+#define blk_finish_plug(plug)	do { (void)(plug); } while (0)
+
 #endif /* _LINUX_BLKDEV_H */