[Concept,09/17] ext4l: Move block device atomic write stubs to linux/blkdev.h

Message ID 20260120234344.495605-10-sjg@u-boot.org
State New
Headers
Series ext4l: Move compatibility stubs to standard Linux headers |

Commit Message

Simon Glass Jan. 20, 2026, 11:43 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Move bdev_can_atomic_write(), bdev_atomic_write_unit_max_bytes(), and
bdev_atomic_write_unit_min_bytes() stubs to linux/blkdev.h where they
belong in the Linux kernel header hierarchy.

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

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

Patch

diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h
index b44939bfe5a..b44126a733a 100644
--- a/fs/ext4l/ext4_uboot.h
+++ b/fs/ext4l/ext4_uboot.h
@@ -1181,10 +1181,7 @@  void free_page(unsigned long addr);
 void *fs_dax_get_by_bdev(struct block_device *bdev, u64 *start, u64 *len,
 			 void *holder);
 
-/* Block device atomic write stubs */
-#define bdev_can_atomic_write(bdev)		({ (void)(bdev); 0; })
-#define bdev_atomic_write_unit_max_bytes(bdev)	({ (void)(bdev); (unsigned int)0; })
-#define bdev_atomic_write_unit_min_bytes(bdev)	({ (void)(bdev); 0UL; })
+/* Block device atomic write stubs are in linux/blkdev.h */
 
 /* Superblock blocksize - declaration for stub.c */
 int sb_set_blocksize(struct super_block *sb, int size);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index f1a4cc12d3c..eaf2984c08f 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -50,4 +50,9 @@  struct blk_plug {
  */
 #define blk_finish_plug(plug)	do { (void)(plug); } while (0)
 
+/* Block device atomic write support - not supported in U-Boot */
+#define bdev_can_atomic_write(bdev)		({ (void)(bdev); 0; })
+#define bdev_atomic_write_unit_max_bytes(bdev)	({ (void)(bdev); (unsigned int)0; })
+#define bdev_atomic_write_unit_min_bytes(bdev)	({ (void)(bdev); 0UL; })
+
 #endif /* _LINUX_BLKDEV_H */