Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion kernel/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@
# kernel patch module
*.kpm

kpimg
kpimg

*.img
kernel
kernel-b
*.bat
18 changes: 18 additions & 0 deletions kernel/linux/include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,24 @@ static inline loff_t vfs_llseek(struct file *file, loff_t offset, int whence)
kfunc_direct_call(vfs_llseek, file, offset, whence);
}

/* Directory iteration context (kernel 3.11+).
* Actor signature: int return (4.x) or bool return (5.0+) — both are ABI-compatible
* on arm64 for 0/1 values, so we use the 5.0+ bool form to satisfy the compiler.
*/
struct dir_context {
bool (*actor)(struct dir_context *, const char *, int, loff_t, u64, unsigned int);
loff_t pos;
};

extern int kfunc_def(iterate_dir)(struct file *, struct dir_context *);

static inline int iterate_dir(struct file *file, struct dir_context *ctx)
{
kfunc_call(iterate_dir, file, ctx);
kfunc_not_found();
return 0; /* symbol not resolved; caller checks result via its context */
}

static inline void putname(struct filename *name)
{
kfunc_direct_call_void(putname, name);
Expand Down
Loading