2020-01-30 12:43:22 +00:00
|
|
|
From 1be1b148afba0f905afcb13e0ee18e1333eac9d1 Mon Sep 17 00:00:00 2001
|
2019-04-17 09:18:37 +00:00
|
|
|
From: Thomas Schoebel-Theuer <tst@1und1.de>
|
2020-01-30 12:43:22 +00:00
|
|
|
Date: Thu, 30 Jan 2020 13:41:29 +0100
|
2019-04-17 09:18:37 +00:00
|
|
|
Subject: [PATCH] mars: minimum pre-patch for mars
|
|
|
|
|
|
|
|
Mostly introduces some EXPORT_SYMBOL().
|
|
|
|
Should have almost no impact onto the kernel.
|
|
|
|
---
|
2020-01-30 12:43:22 +00:00
|
|
|
fs/aio.c | 6 ++++++
|
2019-04-17 09:18:37 +00:00
|
|
|
fs/namei.c | 5 +++++
|
|
|
|
fs/open.c | 2 ++
|
|
|
|
fs/utimes.c | 2 ++
|
2020-01-30 12:43:22 +00:00
|
|
|
include/linux/aio.h | 1 +
|
2019-04-17 09:18:37 +00:00
|
|
|
include/uapi/linux/major.h | 1 +
|
|
|
|
mm/page_alloc.c | 2 ++
|
2020-01-30 12:43:22 +00:00
|
|
|
7 files changed, 19 insertions(+)
|
2019-04-17 09:18:37 +00:00
|
|
|
|
|
|
|
diff --git a/fs/aio.c b/fs/aio.c
|
2020-01-30 12:43:22 +00:00
|
|
|
index a2de58f77338..c9beeabfceef 100644
|
2019-04-17 09:18:37 +00:00
|
|
|
--- a/fs/aio.c
|
|
|
|
+++ b/fs/aio.c
|
2020-01-30 12:43:22 +00:00
|
|
|
@@ -194,6 +194,7 @@ struct aio_kiocb {
|
|
|
|
static DEFINE_SPINLOCK(aio_nr_lock);
|
|
|
|
unsigned long aio_nr; /* current system wide number of aio requests */
|
|
|
|
unsigned long aio_max_nr = 0x10000; /* system wide maximum number of aio requests */
|
|
|
|
+EXPORT_SYMBOL_GPL(aio_max_nr);
|
|
|
|
/*----end sysctl variables---*/
|
|
|
|
|
|
|
|
static struct kmem_cache *kiocb_cachep;
|
|
|
|
@@ -1397,6 +1398,7 @@ SYSCALL_DEFINE2(io_setup, unsigned, nr_events, aio_context_t __user *, ctxp)
|
2019-04-17 09:18:37 +00:00
|
|
|
out:
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
+EXPORT_SYMBOL(sys_io_setup);
|
|
|
|
|
|
|
|
#ifdef CONFIG_COMPAT
|
|
|
|
COMPAT_SYSCALL_DEFINE2(io_setup, unsigned, nr_events, u32 __user *, ctx32p)
|
2020-01-30 12:43:22 +00:00
|
|
|
@@ -1466,6 +1468,7 @@ SYSCALL_DEFINE1(io_destroy, aio_context_t, ctx)
|
2019-04-17 09:18:37 +00:00
|
|
|
pr_debug("EINVAL: invalid context id\n");
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
+EXPORT_SYMBOL(sys_io_destroy);
|
|
|
|
|
|
|
|
static int aio_setup_rw(int rw, struct iocb *iocb, struct iovec **iovec,
|
|
|
|
bool vectored, bool compat, struct iov_iter *iter)
|
2020-01-30 12:43:22 +00:00
|
|
|
@@ -1715,6 +1718,7 @@ static long do_io_submit(aio_context_t ctx_id, long nr,
|
2019-04-17 09:18:37 +00:00
|
|
|
percpu_ref_put(&ctx->users);
|
|
|
|
return i ? i : ret;
|
|
|
|
}
|
|
|
|
+EXPORT_SYMBOL(sys_io_submit);
|
|
|
|
|
|
|
|
/* sys_io_submit:
|
|
|
|
* Queue the nr iocbs pointed to by iocbpp for processing. Returns
|
2020-01-30 12:43:22 +00:00
|
|
|
@@ -1842,6 +1846,7 @@ SYSCALL_DEFINE3(io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb,
|
2019-04-17 09:18:37 +00:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
+EXPORT_SYMBOL(sys_io_cancel);
|
|
|
|
|
|
|
|
/* io_getevents:
|
|
|
|
* Attempts to read at least min_nr events and up to nr events from
|
2020-01-30 12:43:22 +00:00
|
|
|
@@ -1871,6 +1876,7 @@ SYSCALL_DEFINE5(io_getevents, aio_context_t, ctx_id,
|
2019-04-17 09:18:37 +00:00
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
+EXPORT_SYMBOL(sys_io_getevents);
|
|
|
|
|
|
|
|
#ifdef CONFIG_COMPAT
|
|
|
|
COMPAT_SYSCALL_DEFINE5(io_getevents, compat_aio_context_t, ctx_id,
|
|
|
|
diff --git a/fs/namei.c b/fs/namei.c
|
2020-01-30 12:43:22 +00:00
|
|
|
index d648d6d2b635..7cf8cfcaca53 100644
|
2019-04-17 09:18:37 +00:00
|
|
|
--- a/fs/namei.c
|
|
|
|
+++ b/fs/namei.c
|
2020-01-30 12:43:22 +00:00
|
|
|
@@ -3882,6 +3882,7 @@ SYSCALL_DEFINE2(mkdir, const char __user *, pathname, umode_t, mode)
|
2019-04-17 09:18:37 +00:00
|
|
|
{
|
|
|
|
return sys_mkdirat(AT_FDCWD, pathname, mode);
|
|
|
|
}
|
|
|
|
+EXPORT_SYMBOL(sys_mkdir);
|
|
|
|
|
|
|
|
int vfs_rmdir(struct inode *dir, struct dentry *dentry)
|
|
|
|
{
|
2020-01-30 12:43:22 +00:00
|
|
|
@@ -3985,6 +3986,7 @@ SYSCALL_DEFINE1(rmdir, const char __user *, pathname)
|
2019-04-17 09:18:37 +00:00
|
|
|
{
|
|
|
|
return do_rmdir(AT_FDCWD, pathname);
|
|
|
|
}
|
|
|
|
+EXPORT_SYMBOL(sys_rmdir);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* vfs_unlink - unlink a filesystem object
|
2020-01-30 12:43:22 +00:00
|
|
|
@@ -4138,6 +4140,7 @@ SYSCALL_DEFINE1(unlink, const char __user *, pathname)
|
2019-04-17 09:18:37 +00:00
|
|
|
{
|
|
|
|
return do_unlinkat(AT_FDCWD, pathname);
|
|
|
|
}
|
|
|
|
+EXPORT_SYMBOL(sys_unlink);
|
|
|
|
|
|
|
|
int vfs_symlink(struct inode *dir, struct dentry *dentry, const char *oldname)
|
|
|
|
{
|
2020-01-30 12:43:22 +00:00
|
|
|
@@ -4195,6 +4198,7 @@ SYSCALL_DEFINE2(symlink, const char __user *, oldname, const char __user *, newn
|
2019-04-17 09:18:37 +00:00
|
|
|
{
|
|
|
|
return sys_symlinkat(oldname, AT_FDCWD, newname);
|
|
|
|
}
|
|
|
|
+EXPORT_SYMBOL(sys_symlink);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* vfs_link - create a new link
|
2020-01-30 12:43:22 +00:00
|
|
|
@@ -4683,6 +4687,7 @@ SYSCALL_DEFINE2(rename, const char __user *, oldname, const char __user *, newna
|
2019-04-17 09:18:37 +00:00
|
|
|
{
|
|
|
|
return sys_renameat2(AT_FDCWD, oldname, AT_FDCWD, newname, 0);
|
|
|
|
}
|
|
|
|
+EXPORT_SYMBOL(sys_rename);
|
|
|
|
|
|
|
|
int vfs_whiteout(struct inode *dir, struct dentry *dentry)
|
|
|
|
{
|
|
|
|
diff --git a/fs/open.c b/fs/open.c
|
2020-01-30 12:43:22 +00:00
|
|
|
index 29a2cdcbcb17..a6e0eb8c9db9 100644
|
2019-04-17 09:18:37 +00:00
|
|
|
--- a/fs/open.c
|
|
|
|
+++ b/fs/open.c
|
2020-01-30 12:43:22 +00:00
|
|
|
@@ -595,6 +595,7 @@ SYSCALL_DEFINE2(chmod, const char __user *, filename, umode_t, mode)
|
2019-04-17 09:18:37 +00:00
|
|
|
{
|
|
|
|
return sys_fchmodat(AT_FDCWD, filename, mode);
|
|
|
|
}
|
|
|
|
+EXPORT_SYMBOL(sys_chmod);
|
|
|
|
|
|
|
|
static int chown_common(const struct path *path, uid_t user, gid_t group)
|
|
|
|
{
|
2020-01-30 12:43:22 +00:00
|
|
|
@@ -680,6 +681,7 @@ SYSCALL_DEFINE3(lchown, const char __user *, filename, uid_t, user, gid_t, group
|
2019-04-17 09:18:37 +00:00
|
|
|
return sys_fchownat(AT_FDCWD, filename, user, group,
|
|
|
|
AT_SYMLINK_NOFOLLOW);
|
|
|
|
}
|
|
|
|
+EXPORT_SYMBOL(sys_lchown);
|
|
|
|
|
|
|
|
SYSCALL_DEFINE3(fchown, unsigned int, fd, uid_t, user, gid_t, group)
|
|
|
|
{
|
|
|
|
diff --git a/fs/utimes.c b/fs/utimes.c
|
|
|
|
index e4b3d7c2c9f5..e24cfb5e9c5c 100644
|
|
|
|
--- a/fs/utimes.c
|
|
|
|
+++ b/fs/utimes.c
|
|
|
|
@@ -1,4 +1,5 @@
|
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
+#include <linux/module.h>
|
|
|
|
#include <linux/file.h>
|
|
|
|
#include <linux/mount.h>
|
|
|
|
#include <linux/namei.h>
|
|
|
|
@@ -164,6 +165,7 @@ long do_utimes(int dfd, const char __user *filename, struct timespec64 *times,
|
|
|
|
out:
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
+EXPORT_SYMBOL(do_utimes);
|
|
|
|
|
|
|
|
SYSCALL_DEFINE4(utimensat, int, dfd, const char __user *, filename,
|
|
|
|
struct timespec __user *, utimes, int, flags)
|
2020-01-30 12:43:22 +00:00
|
|
|
diff --git a/include/linux/aio.h b/include/linux/aio.h
|
|
|
|
index 9d8aabecfe2d..078612c87c56 100644
|
|
|
|
--- a/include/linux/aio.h
|
|
|
|
+++ b/include/linux/aio.h
|
|
|
|
@@ -14,6 +14,7 @@ typedef int (kiocb_cancel_fn)(struct kiocb *);
|
|
|
|
|
|
|
|
/* prototypes */
|
|
|
|
#ifdef CONFIG_AIO
|
|
|
|
+#define HAS_AIO_MAX
|
|
|
|
extern void exit_aio(struct mm_struct *mm);
|
|
|
|
void kiocb_set_cancel_fn(struct kiocb *req, kiocb_cancel_fn *cancel);
|
|
|
|
#else
|
2019-04-17 09:18:37 +00:00
|
|
|
diff --git a/include/uapi/linux/major.h b/include/uapi/linux/major.h
|
|
|
|
index 7e5fa8e15c43..edfbce01e4ac 100644
|
|
|
|
--- a/include/uapi/linux/major.h
|
|
|
|
+++ b/include/uapi/linux/major.h
|
|
|
|
@@ -149,6 +149,7 @@
|
|
|
|
#define UNIX98_PTY_SLAVE_MAJOR (UNIX98_PTY_MASTER_MAJOR+UNIX98_PTY_MAJOR_COUNT)
|
|
|
|
|
|
|
|
#define DRBD_MAJOR 147
|
|
|
|
+#define MARS_MAJOR 148
|
|
|
|
#define RTF_MAJOR 150
|
|
|
|
#define RAW_MAJOR 162
|
|
|
|
|
|
|
|
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
|
2020-01-30 12:43:22 +00:00
|
|
|
index 6f71518a4558..433fbb7d10a6 100644
|
2019-04-17 09:18:37 +00:00
|
|
|
--- a/mm/page_alloc.c
|
|
|
|
+++ b/mm/page_alloc.c
|
|
|
|
@@ -259,6 +259,7 @@ compound_page_dtor * const compound_page_dtors[] = {
|
|
|
|
};
|
|
|
|
|
|
|
|
int min_free_kbytes = 1024;
|
|
|
|
+EXPORT_SYMBOL(min_free_kbytes);
|
|
|
|
int user_min_free_kbytes = -1;
|
|
|
|
int watermark_scale_factor = 10;
|
|
|
|
|
2020-01-30 12:43:22 +00:00
|
|
|
@@ -6947,6 +6948,7 @@ static void __setup_per_zone_wmarks(void)
|
2019-04-17 09:18:37 +00:00
|
|
|
/* update totalreserve_pages */
|
|
|
|
calculate_totalreserve_pages();
|
|
|
|
}
|
|
|
|
+EXPORT_SYMBOL(setup_per_zone_wmarks);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* setup_per_zone_wmarks - called when min_free_kbytes changes
|
|
|
|
--
|
2020-01-30 12:43:22 +00:00
|
|
|
2.25.0
|
2019-04-17 09:18:37 +00:00
|
|
|
|