Skip to content

Commit 4e179bc

Browse files
Kent Overstreettorvalds
authored andcommitted
aio: move private stuff out of aio.h
Signed-off-by: Kent Overstreet <koverstreet@google.com> Cc: Zach Brown <zab@redhat.com> Cc: Felipe Balbi <balbi@ti.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Jens Axboe <axboe@kernel.dk> Cc: Asai Thambi S P <asamymuthupa@micron.com> Cc: Selvan Mani <smani@micron.com> Cc: Sam Bradshaw <sbradshaw@micron.com> Acked-by: Jeff Moyer <jmoyer@redhat.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Benjamin LaHaise <bcrl@kvack.org> Cc: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 906b973 commit 4e179bc

3 files changed

Lines changed: 62 additions & 61 deletions

File tree

‎drivers/usb/gadget/inode.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/slab.h>
2626
#include <linux/poll.h>
2727
#include <linux/mmu_context.h>
28+
#include <linux/aio.h>
2829

2930
#include <linux/device.h>
3031
#include <linux/moduleparam.h>

‎fs/aio.c‎

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,67 @@
4545
#define dprintk(x...) do { ; } while (0)
4646
#endif
4747

48+
#define AIO_RING_MAGIC 0xa10a10a1
49+
#define AIO_RING_COMPAT_FEATURES 1
50+
#define AIO_RING_INCOMPAT_FEATURES 0
51+
struct aio_ring {
52+
unsigned id; /* kernel internal index number */
53+
unsigned nr; /* number of io_events */
54+
unsigned head;
55+
unsigned tail;
56+
57+
unsigned magic;
58+
unsigned compat_features;
59+
unsigned incompat_features;
60+
unsigned header_length; /* size of aio_ring */
61+
62+
63+
struct io_event io_events[0];
64+
}; /* 128 bytes + ring size */
65+
66+
#define AIO_RING_PAGES 8
67+
struct aio_ring_info {
68+
unsigned long mmap_base;
69+
unsigned long mmap_size;
70+
71+
struct page **ring_pages;
72+
spinlock_t ring_lock;
73+
long nr_pages;
74+
75+
unsigned nr, tail;
76+
77+
struct page *internal_pages[AIO_RING_PAGES];
78+
};
79+
80+
static inline unsigned aio_ring_avail(struct aio_ring_info *info,
81+
struct aio_ring *ring)
82+
{
83+
return (ring->head + info->nr - 1 - ring->tail) % info->nr;
84+
}
85+
86+
struct kioctx {
87+
atomic_t users;
88+
int dead;
89+
90+
/* This needs improving */
91+
unsigned long user_id;
92+
struct hlist_node list;
93+
94+
wait_queue_head_t wait;
95+
96+
spinlock_t ctx_lock;
97+
98+
int reqs_active;
99+
struct list_head active_reqs; /* used for cancellation */
100+
101+
/* sys_io_setup currently limits this to an unsigned int */
102+
unsigned max_reqs;
103+
104+
struct aio_ring_info ring_info;
105+
106+
struct rcu_head rcu_head;
107+
};
108+
48109
/*------ sysctl variables----*/
49110
static DEFINE_SPINLOCK(aio_nr_lock);
50111
unsigned long aio_nr; /* current system wide number of aio requests */

‎include/linux/aio.h‎

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -103,67 +103,6 @@ static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp)
103103
};
104104
}
105105

106-
#define AIO_RING_MAGIC 0xa10a10a1
107-
#define AIO_RING_COMPAT_FEATURES 1
108-
#define AIO_RING_INCOMPAT_FEATURES 0
109-
struct aio_ring {
110-
unsigned id; /* kernel internal index number */
111-
unsigned nr; /* number of io_events */
112-
unsigned head;
113-
unsigned tail;
114-
115-
unsigned magic;
116-
unsigned compat_features;
117-
unsigned incompat_features;
118-
unsigned header_length; /* size of aio_ring */
119-
120-
121-
struct io_event io_events[0];
122-
}; /* 128 bytes + ring size */
123-
124-
#define AIO_RING_PAGES 8
125-
struct aio_ring_info {
126-
unsigned long mmap_base;
127-
unsigned long mmap_size;
128-
129-
struct page **ring_pages;
130-
spinlock_t ring_lock;
131-
long nr_pages;
132-
133-
unsigned nr, tail;
134-
135-
struct page *internal_pages[AIO_RING_PAGES];
136-
};
137-
138-
static inline unsigned aio_ring_avail(struct aio_ring_info *info,
139-
struct aio_ring *ring)
140-
{
141-
return (ring->head + info->nr - 1 - ring->tail) % info->nr;
142-
}
143-
144-
struct kioctx {
145-
atomic_t users;
146-
int dead;
147-
148-
/* This needs improving */
149-
unsigned long user_id;
150-
struct hlist_node list;
151-
152-
wait_queue_head_t wait;
153-
154-
spinlock_t ctx_lock;
155-
156-
int reqs_active;
157-
struct list_head active_reqs; /* used for cancellation */
158-
159-
/* sys_io_setup currently limits this to an unsigned int */
160-
unsigned max_reqs;
161-
162-
struct aio_ring_info ring_info;
163-
164-
struct rcu_head rcu_head;
165-
};
166-
167106
/* prototypes */
168107
#ifdef CONFIG_AIO
169108
extern ssize_t wait_on_sync_kiocb(struct kiocb *iocb);

0 commit comments

Comments
 (0)