[Concept,10/17] ext4l: Move get_block_t typedef to linux/fs.h
Commit Message
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(-)
@@ -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>
@@ -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