Thread (22 messages) 22 messages, 4 authors, 2017-12-07
STALE3118d

[PATCH 2/5] aio: Export aio_nr_lock and aio_max_nr initial value to include/linux/aio.h

From: Kirill Tkhai <hidden>
Date: 2017-12-04 16:13:22
Also in: lkml
Subsystem: aio, filesystems (vfs and infrastructure), the rest · Maintainers: Benjamin LaHaise, Alexander Viro, Christian Brauner, Linus Torvalds

Next patch will use the values in more files, so let's make them visible external.

Signed-off-by: Kirill Tkhai <redacted>
---
 fs/aio.c            |    4 ++--
 include/linux/aio.h |    4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/fs/aio.c b/fs/aio.c
index 04209c0561b2..9dc98a29077c 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -188,10 +188,10 @@ struct aio_kiocb {
 	struct eventfd_ctx	*ki_eventfd;
 };
 
+DEFINE_SPINLOCK(aio_nr_lock);
 /*------ sysctl variables----*/
-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 */
+unsigned long aio_max_nr = AIO_NR_DEF; /* system wide maximum number of aio requests */
 /*----end sysctl variables---*/
 
 static struct kmem_cache	*kiocb_cachep;
diff --git a/include/linux/aio.h b/include/linux/aio.h
index 9d8aabecfe2d..5dda2663802f 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -10,6 +10,10 @@ struct mm_struct;
 
 #define KIOCB_KEY		0
 
+#define AIO_NR_INF		(-1UL)
+#define AIO_NR_DEF		0x10000
+
+extern spinlock_t aio_nr_lock;
 typedef int (kiocb_cancel_fn)(struct kiocb *);
 
 /* prototypes */
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help