diff options
author | Kent Overstreet <koverstreet@google.com> | 2013-05-13 16:42:52 -0400 |
---|---|---|
committer | Benjamin LaHaise <bcrl@kvack.org> | 2013-07-30 11:53:12 -0400 |
commit | 57282d8fd744072d6d6f18fa6ebe3cc1149015bf (patch) | |
tree | fd01d088c8eb9e15ed4b1d486c9868b206b179c7 /include/linux/aio.h | |
parent | 8bc92afcf7f5c598001dd04e62d88f57f6e89e51 (diff) |
aio: Kill ki_users
The kiocb refcount is only needed for cancellation - to ensure a kiocb
isn't freed while a ki_cancel callback is running. But if we restrict
ki_cancel callbacks to not block (which they currently don't), we can
simply drop the refcount.
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>
Cc: 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: Benjamin LaHaise <bcrl@kvack.org>
Diffstat (limited to 'include/linux/aio.h')
-rw-r--r-- | include/linux/aio.h | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/include/linux/aio.h b/include/linux/aio.h index b570472355d1..c4f07ffa1cbb 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h | |||
@@ -30,8 +30,6 @@ struct kiocb; | |||
30 | typedef int (kiocb_cancel_fn)(struct kiocb *); | 30 | typedef int (kiocb_cancel_fn)(struct kiocb *); |
31 | 31 | ||
32 | struct kiocb { | 32 | struct 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; |
@@ -65,7 +63,6 @@ static inline bool is_sync_kiocb(struct kiocb *kiocb) | |||
65 | static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp) | 63 | static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp) |
66 | { | 64 | { |
67 | *kiocb = (struct kiocb) { | 65 | *kiocb = (struct kiocb) { |
68 | .ki_users = ATOMIC_INIT(1), | ||
69 | .ki_ctx = NULL, | 66 | .ki_ctx = NULL, |
70 | .ki_filp = filp, | 67 | .ki_filp = filp, |
71 | .ki_obj.tsk = current, | 68 | .ki_obj.tsk = current, |
@@ -75,7 +72,6 @@ static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp) | |||
75 | /* prototypes */ | 72 | /* prototypes */ |
76 | #ifdef CONFIG_AIO | 73 | #ifdef CONFIG_AIO |
77 | extern ssize_t wait_on_sync_kiocb(struct kiocb *iocb); | 74 | extern ssize_t wait_on_sync_kiocb(struct kiocb *iocb); |
78 | extern void aio_put_req(struct kiocb *iocb); | ||
79 | extern void aio_complete(struct kiocb *iocb, long res, long res2); | 75 | extern void aio_complete(struct kiocb *iocb, long res, long res2); |
80 | struct mm_struct; | 76 | struct mm_struct; |
81 | extern void exit_aio(struct mm_struct *mm); | 77 | extern void exit_aio(struct mm_struct *mm); |
@@ -84,7 +80,6 @@ extern long do_io_submit(aio_context_t ctx_id, long nr, | |||
84 | void kiocb_set_cancel_fn(struct kiocb *req, kiocb_cancel_fn *cancel); | 80 | void kiocb_set_cancel_fn(struct kiocb *req, kiocb_cancel_fn *cancel); |
85 | #else | 81 | #else |
86 | static inline ssize_t wait_on_sync_kiocb(struct kiocb *iocb) { return 0; } | 82 | static inline ssize_t wait_on_sync_kiocb(struct kiocb *iocb) { return 0; } |
87 | static inline void aio_put_req(struct kiocb *iocb) { } | ||
88 | static inline void aio_complete(struct kiocb *iocb, long res, long res2) { } | 83 | static inline void aio_complete(struct kiocb *iocb, long res, long res2) { } |
89 | struct mm_struct; | 84 | struct mm_struct; |
90 | static inline void exit_aio(struct mm_struct *mm) { } | 85 | static inline void exit_aio(struct mm_struct *mm) { } |