[Concept,14/15] ext4l: Add resize.c to the build
Commit Message
From: Simon Glass <simon.glass@canonical.com>
Add filesystem-resize support.
Use ext4_uboot.h compatibility layer and add stubs for:
- test_and_set_bit_lock - forwards to test_and_set_bit
- div64_u64 - simple 64-bit division
- time_is_before_jiffies - always returns false
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---
fs/ext4l/Makefile | 2 +-
fs/ext4l/ext4_uboot.h | 19 +++++++++++++++++++
fs/ext4l/resize.c | 6 +-----
fs/ext4l/stub.c | 7 +++++--
4 files changed, 26 insertions(+), 8 deletions(-)
@@ -8,7 +8,7 @@ obj-y := interface.o stub.o
obj-y += balloc.o bitmap.o block_validity.o dir.o ext4_jbd2.o extents.o \
extents_status.o file.o fsync.o hash.o ialloc.o \
indirect.o inline.o inode.o mballoc.o migrate.o \
- mmp.o move_extent.o namei.o page-io.o readpage.o \
+ mmp.o move_extent.o namei.o page-io.o readpage.o resize.o \
super.o symlink.o xattr.o \
xattr_hurd.o xattr_trusted.o \
xattr_user.o fast_commit.o orphan.o
@@ -2969,4 +2969,23 @@ static inline struct new_utsname *init_utsname(void)
#define unlock_two_nondirectories(i1, i2) \
do { (void)(i1); (void)(i2); } while (0)
+/*
+ * Stubs for resize.c
+ */
+
+/* test_and_set_bit_lock - test and set a bit atomically */
+#define test_and_set_bit_lock(nr, addr) test_and_set_bit(nr, addr)
+
+/* div64_u64 - 64-bit by 64-bit division */
+static inline u64 div64_u64(u64 dividend, u64 divisor)
+{
+ return dividend / divisor;
+}
+
+/* time_is_before_jiffies - check if time is before current jiffies */
+#define time_is_before_jiffies(a) ({ (void)(a); 0; })
+
+/* ext4_update_overhead - declaration for stub.c */
+int ext4_update_overhead(struct super_block *sb, bool force);
+
#endif /* __EXT4_UBOOT_H__ */
@@ -9,11 +9,7 @@
* This could probably be made into a module, because it is not often in use.
*/
-
-#include <linux/errno.h>
-#include <linux/slab.h>
-#include <linux/jiffies.h>
-
+#include "ext4_uboot.h"
#include "ext4_jbd2.h"
struct ext4_rcu_ptr {
@@ -379,9 +379,12 @@ void *kvzalloc(size_t size, gfp_t flags)
return calloc(1, size);
}
-void ext4_kvfree_array_rcu(void *p)
+/* ext4_kvfree_array_rcu - now in resize.c */
+
+/* ext4_update_overhead - stub for resize.c */
+int ext4_update_overhead(struct super_block *sb, bool force)
{
- free(p);
+ return 0;
}
/* String stubs */