export the do_ftruncate function so kernel code can use it directly with file handles without having to pass the file descriptor number.
https://virtuozzo.atlassian.net/browse/VSTOR-123292 Signed-off-by: Vasileios Almpanis <[email protected]> Feature: fix ms/fs --- fs/open.c | 1 + include/linux/fs.h | 1 + kernel/trace/bpf_trace.c | 1 + 3 files changed, 3 insertions(+) diff --git a/fs/open.c b/fs/open.c index b82f5fc333d7..b166d00e2366 100644 --- a/fs/open.c +++ b/fs/open.c @@ -184,6 +184,7 @@ long do_ftruncate(struct file *file, loff_t length, int small) return error; } +EXPORT_SYMBOL_GPL(do_ftruncate); long do_sys_ftruncate(unsigned int fd, loff_t length, int small) { diff --git a/include/linux/fs.h b/include/linux/fs.h index d57aed2954f7..9d28258331b4 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2769,6 +2769,7 @@ static inline long vfs_truncate(const struct path *path, loff_t off) } int do_truncate(struct user_namespace *, struct dentry *, loff_t start, unsigned int time_attrs, struct file *filp); +extern long do_ftruncate(struct file *file, loff_t length, int small); extern int vfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len); extern long do_sys_open(int dfd, const char __user *filename, int flags, diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c index edd750e62901..9a312fb71685 100644 --- a/kernel/trace/bpf_trace.c +++ b/kernel/trace/bpf_trace.c @@ -939,6 +939,7 @@ BTF_ID(func, security_file_open) BTF_ID(func, security_path_truncate) #endif BTF_ID(func, vfs_truncate2) +BTF_ID(func, do_ftruncate) BTF_ID(func, vfs_fallocate) BTF_ID(func, dentry_open) BTF_ID(func, vfs_getattr) -- 2.43.0 _______________________________________________ Devel mailing list [email protected] https://lists.openvz.org/mailman/listinfo/devel
