aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-09-13 13:55:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-13 13:55:58 -0400
commit9bf12df31f282e845b3dfaac1e5d5376a041da22 (patch)
tree10d7a21d34c7f2c47eff3e807f5efef46228d507 /include
parent399a946edbbe90bd03aec2e93ce58c9b3f18e70b (diff)
parentd9b2c8714aef102dea95544a8cd9372b21af463f (diff)
Merge git://git.kvack.org/~bcrl/aio-next
Pull aio changes from Ben LaHaise: "First off, sorry for this pull request being late in the merge window. Al had raised a couple of concerns about 2 items in the series below. I addressed the first issue (the race introduced by Gu's use of mm_populate()), but he has not provided any further details on how he wants to rework the anon_inode.c changes (which were sent out months ago but have yet to be commented on). The bulk of the changes have been sitting in the -next tree for a few months, with all the issues raised being addressed" * git://git.kvack.org/~bcrl/aio-next: (22 commits) aio: rcu_read_lock protection for new rcu_dereference calls aio: fix race in ring buffer page lookup introduced by page migration support aio: fix rcu sparse warnings introduced by ioctx table lookup patch aio: remove unnecessary debugging from aio_free_ring() aio: table lookup: verify ctx pointer staging/lustre: kiocb->ki_left is removed aio: fix error handling and rcu usage in "convert the ioctx list to table lookup v3" aio: be defensive to ensure request batching is non-zero instead of BUG_ON() aio: convert the ioctx list to table lookup v3 aio: double aio_max_nr in calculations aio: Kill ki_dtor aio: Kill ki_users aio: Kill unneeded kiocb members aio: Kill aio_rw_vect_retry() aio: Don't use ctx->tail unnecessarily aio: io_cancel() no longer returns the io_event aio: percpu ioctx refcount aio: percpu reqs_available aio: reqs_active -> reqs_available aio: fix build when migration is disabled ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/aio.h21
-rw-r--r--include/linux/anon_inodes.h3
-rw-r--r--include/linux/migrate.h3
-rw-r--r--include/linux/mm_types.h5
4 files changed, 12 insertions, 20 deletions
diff --git a/include/linux/aio.h b/include/linux/aio.h
index 1bdf965339f9..d9c92daa3944 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -27,15 +27,13 @@ struct kiocb;
27 */ 27 */
28#define KIOCB_CANCELLED ((void *) (~0ULL)) 28#define KIOCB_CANCELLED ((void *) (~0ULL))
29 29
30typedef int (kiocb_cancel_fn)(struct kiocb *, struct io_event *); 30typedef int (kiocb_cancel_fn)(struct kiocb *);
31 31
32struct kiocb { 32struct kiocb {
33 atomic_t ki_users;
34
35 struct file *ki_filp; 33 struct file *ki_filp;
36 struct kioctx *ki_ctx; /* NULL for sync ops */ 34 struct kioctx *ki_ctx; /* NULL for sync ops */
37 kiocb_cancel_fn *ki_cancel; 35 kiocb_cancel_fn *ki_cancel;
38 void (*ki_dtor)(struct kiocb *); 36 void *private;
39 37
40 union { 38 union {
41 void __user *user; 39 void __user *user;
@@ -44,17 +42,7 @@ struct kiocb {
44 42
45 __u64 ki_user_data; /* user's data for completion */ 43 __u64 ki_user_data; /* user's data for completion */
46 loff_t ki_pos; 44 loff_t ki_pos;
47 45 size_t ki_nbytes; /* copy of iocb->aio_nbytes */
48 void *private;
49 /* State that we remember to be able to restart/retry */
50 unsigned short ki_opcode;
51 size_t ki_nbytes; /* copy of iocb->aio_nbytes */
52 char __user *ki_buf; /* remaining iocb->aio_buf */
53 size_t ki_left; /* remaining bytes */
54 struct iovec ki_inline_vec; /* inline vector */
55 struct iovec *ki_iovec;
56 unsigned long ki_nr_segs;
57 unsigned long ki_cur_seg;
58 46
59 struct list_head ki_list; /* the aio core uses this 47 struct list_head ki_list; /* the aio core uses this
60 * for cancellation */ 48 * for cancellation */
@@ -74,7 +62,6 @@ static inline bool is_sync_kiocb(struct kiocb *kiocb)
74static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp) 62static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp)
75{ 63{
76 *kiocb = (struct kiocb) { 64 *kiocb = (struct kiocb) {
77 .ki_users = ATOMIC_INIT(1),
78 .ki_ctx = NULL, 65 .ki_ctx = NULL,
79 .ki_filp = filp, 66 .ki_filp = filp,
80 .ki_obj.tsk = current, 67 .ki_obj.tsk = current,
@@ -84,7 +71,6 @@ static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp)
84/* prototypes */ 71/* prototypes */
85#ifdef CONFIG_AIO 72#ifdef CONFIG_AIO
86extern ssize_t wait_on_sync_kiocb(struct kiocb *iocb); 73extern ssize_t wait_on_sync_kiocb(struct kiocb *iocb);
87extern void aio_put_req(struct kiocb *iocb);
88extern void aio_complete(struct kiocb *iocb, long res, long res2); 74extern void aio_complete(struct kiocb *iocb, long res, long res2);
89struct mm_struct; 75struct mm_struct;
90extern void exit_aio(struct mm_struct *mm); 76extern void exit_aio(struct mm_struct *mm);
@@ -93,7 +79,6 @@ extern long do_io_submit(aio_context_t ctx_id, long nr,
93void kiocb_set_cancel_fn(struct kiocb *req, kiocb_cancel_fn *cancel); 79void kiocb_set_cancel_fn(struct kiocb *req, kiocb_cancel_fn *cancel);
94#else 80#else
95static inline ssize_t wait_on_sync_kiocb(struct kiocb *iocb) { return 0; } 81static inline ssize_t wait_on_sync_kiocb(struct kiocb *iocb) { return 0; }
96static inline void aio_put_req(struct kiocb *iocb) { }
97static inline void aio_complete(struct kiocb *iocb, long res, long res2) { } 82static inline void aio_complete(struct kiocb *iocb, long res, long res2) { }
98struct mm_struct; 83struct mm_struct;
99static inline void exit_aio(struct mm_struct *mm) { } 84static inline void exit_aio(struct mm_struct *mm) { }
diff --git a/include/linux/anon_inodes.h b/include/linux/anon_inodes.h
index 8013a45242fe..cf573c22b81e 100644
--- a/include/linux/anon_inodes.h
+++ b/include/linux/anon_inodes.h
@@ -13,6 +13,9 @@ struct file_operations;
13struct file *anon_inode_getfile(const char *name, 13struct file *anon_inode_getfile(const char *name,
14 const struct file_operations *fops, 14 const struct file_operations *fops,
15 void *priv, int flags); 15 void *priv, int flags);
16struct file *anon_inode_getfile_private(const char *name,
17 const struct file_operations *fops,
18 void *priv, int flags);
16int anon_inode_getfd(const char *name, const struct file_operations *fops, 19int anon_inode_getfd(const char *name, const struct file_operations *fops,
17 void *priv, int flags); 20 void *priv, int flags);
18 21
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 6fe521420631..8d3c57fdf221 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -53,6 +53,9 @@ extern int migrate_vmas(struct mm_struct *mm,
53extern void migrate_page_copy(struct page *newpage, struct page *page); 53extern void migrate_page_copy(struct page *newpage, struct page *page);
54extern int migrate_huge_page_move_mapping(struct address_space *mapping, 54extern int migrate_huge_page_move_mapping(struct address_space *mapping,
55 struct page *newpage, struct page *page); 55 struct page *newpage, struct page *page);
56extern int migrate_page_move_mapping(struct address_space *mapping,
57 struct page *newpage, struct page *page,
58 struct buffer_head *head, enum migrate_mode mode);
56#else 59#else
57 60
58static inline void putback_lru_pages(struct list_head *l) {} 61static inline void putback_lru_pages(struct list_head *l) {}
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index faf4b7c1ad12..d9851eeb6e1d 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -322,6 +322,7 @@ struct mm_rss_stat {
322 atomic_long_t count[NR_MM_COUNTERS]; 322 atomic_long_t count[NR_MM_COUNTERS];
323}; 323};
324 324
325struct kioctx_table;
325struct mm_struct { 326struct mm_struct {
326 struct vm_area_struct * mmap; /* list of VMAs */ 327 struct vm_area_struct * mmap; /* list of VMAs */
327 struct rb_root mm_rb; 328 struct rb_root mm_rb;
@@ -383,8 +384,8 @@ struct mm_struct {
383 384
384 struct core_state *core_state; /* coredumping support */ 385 struct core_state *core_state; /* coredumping support */
385#ifdef CONFIG_AIO 386#ifdef CONFIG_AIO
386 spinlock_t ioctx_lock; 387 spinlock_t ioctx_lock;
387 struct hlist_head ioctx_list; 388 struct kioctx_table __rcu *ioctx_table;
388#endif 389#endif
389#ifdef CONFIG_MM_OWNER 390#ifdef CONFIG_MM_OWNER
390 /* 391 /*