[Concept,10/17] ext4l: Move get_block_t typedef to linux/fs.h

Message ID 20260120234344.495605-11-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 the get_block_t callback typedef to linux/fs.h where it belongs
in the Linux kernel header hierarchy. This type is used for filesystem
block mapping callbacks.

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

 fs/ext4l/ext4_uboot.h |  8 +-------
 include/linux/fs.h    | 12 ++++++++++++
 2 files changed, 13 insertions(+), 7 deletions(-)
  

Patch

diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h
index b44126a733a..8a2d18ccaf5 100644
--- a/fs/ext4l/ext4_uboot.h
+++ b/fs/ext4l/ext4_uboot.h
@@ -327,13 +327,7 @@  BUFFER_FNS(OwnsData, ownsdata)
 #define BH_Cached		(BH_JBDPrivateStart + 2)
 BUFFER_FNS(Cached, cached)
 
-/* Forward declare for get_block_t */
-struct inode;
-struct buffer_head;
-
-/* get_block_t - block mapping callback */
-typedef int (get_block_t)(struct inode *inode, sector_t iblock,
-			  struct buffer_head *bh_result, int create);
+/* get_block_t is in linux/fs.h */
 
 /* crc32c - from linux/crc32c.h */
 #include <linux/crc32c.h>
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 5f1d702bab4..a6ad309e5c8 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -321,6 +321,18 @@  enum {
 /* Maximum file size for large files */
 #define MAX_LFS_FILESIZE	((loff_t)LLONG_MAX)
 
+/**
+ * get_block_t - block mapping callback type
+ * @inode: inode to map blocks for
+ * @iblock: logical block number
+ * @bh_result: buffer head to fill with mapping
+ * @create: whether to create new blocks
+ *
+ * Callback function type for filesystem block mapping.
+ */
+typedef int (get_block_t)(struct inode *inode, sector_t iblock,
+			  struct buffer_head *bh_result, int create);
+
 /**
  * struct fstrim_range - fstrim ioctl argument
  * @start: first byte to trim