Skip to content

Commit fac046a

Browse files
Shaohua Litorvalds
authored andcommitted
aio: remove unused field
Don't know the reason, but it appears ki_wait field of iocb never gets used. Signed-off-by: Shaohua Li <shaohua.li@intel.com> Cc: Jeff Moyer <jmoyer@redhat.com> Cc: Benjamin LaHaise <bcrl@kvack.org> Cc: Zach Brown <zach.brown@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent ea58ceb commit fac046a

2 files changed

Lines changed: 2 additions & 42 deletions

File tree

‎fs/aio.c‎

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -711,10 +711,8 @@ static ssize_t aio_run_iocb(struct kiocb *iocb)
711711
*/
712712
ret = retry(iocb);
713713

714-
if (ret != -EIOCBRETRY && ret != -EIOCBQUEUED) {
715-
BUG_ON(!list_empty(&iocb->ki_wait.task_list));
714+
if (ret != -EIOCBRETRY && ret != -EIOCBQUEUED)
716715
aio_complete(iocb, ret, 0);
717-
}
718716
out:
719717
spin_lock_irq(&ctx->ctx_lock);
720718

@@ -866,13 +864,6 @@ static void try_queue_kicked_iocb(struct kiocb *iocb)
866864
unsigned long flags;
867865
int run = 0;
868866

869-
/* We're supposed to be the only path putting the iocb back on the run
870-
* list. If we find that the iocb is *back* on a wait queue already
871-
* than retry has happened before we could queue the iocb. This also
872-
* means that the retry could have completed and freed our iocb, no
873-
* good. */
874-
BUG_ON((!list_empty(&iocb->ki_wait.task_list)));
875-
876867
spin_lock_irqsave(&ctx->ctx_lock, flags);
877868
/* set this inside the lock so that we can't race with aio_run_iocb()
878869
* testing it and putting the iocb on the run list under the lock */
@@ -886,7 +877,7 @@ static void try_queue_kicked_iocb(struct kiocb *iocb)
886877
/*
887878
* kick_iocb:
888879
* Called typically from a wait queue callback context
889-
* (aio_wake_function) to trigger a retry of the iocb.
880+
* to trigger a retry of the iocb.
890881
* The retry is usually executed by aio workqueue
891882
* threads (See aio_kick_handler).
892883
*/
@@ -1520,31 +1511,6 @@ static ssize_t aio_setup_iocb(struct kiocb *kiocb)
15201511
return 0;
15211512
}
15221513

1523-
/*
1524-
* aio_wake_function:
1525-
* wait queue callback function for aio notification,
1526-
* Simply triggers a retry of the operation via kick_iocb.
1527-
*
1528-
* This callback is specified in the wait queue entry in
1529-
* a kiocb.
1530-
*
1531-
* Note:
1532-
* This routine is executed with the wait queue lock held.
1533-
* Since kick_iocb acquires iocb->ctx->ctx_lock, it nests
1534-
* the ioctx lock inside the wait queue lock. This is safe
1535-
* because this callback isn't used for wait queues which
1536-
* are nested inside ioctx lock (i.e. ctx->wait)
1537-
*/
1538-
static int aio_wake_function(wait_queue_t *wait, unsigned mode,
1539-
int sync, void *key)
1540-
{
1541-
struct kiocb *iocb = container_of(wait, struct kiocb, ki_wait);
1542-
1543-
list_del_init(&wait->task_list);
1544-
kick_iocb(iocb);
1545-
return 1;
1546-
}
1547-
15481514
static void aio_batch_add(struct address_space *mapping,
15491515
struct hlist_head *batch_hash)
15501516
{
@@ -1642,8 +1608,6 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
16421608
req->ki_buf = (char __user *)(unsigned long)iocb->aio_buf;
16431609
req->ki_left = req->ki_nbytes = iocb->aio_nbytes;
16441610
req->ki_opcode = iocb->aio_lio_opcode;
1645-
init_waitqueue_func_entry(&req->ki_wait, aio_wake_function);
1646-
INIT_LIST_HEAD(&req->ki_wait.task_list);
16471611

16481612
ret = aio_setup_iocb(req);
16491613

‎include/linux/aio.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ struct kiocb {
102102
} ki_obj;
103103

104104
__u64 ki_user_data; /* user's data for completion */
105-
wait_queue_t ki_wait;
106105
loff_t ki_pos;
107106

108107
void *private;
@@ -140,7 +139,6 @@ struct kiocb {
140139
(x)->ki_dtor = NULL; \
141140
(x)->ki_obj.tsk = tsk; \
142141
(x)->ki_user_data = 0; \
143-
init_wait((&(x)->ki_wait)); \
144142
} while (0)
145143

146144
#define AIO_RING_MAGIC 0xa10a10a1
@@ -223,8 +221,6 @@ struct mm_struct;
223221
static inline void exit_aio(struct mm_struct *mm) { }
224222
#endif /* CONFIG_AIO */
225223

226-
#define io_wait_to_kiocb(wait) container_of(wait, struct kiocb, ki_wait)
227-
228224
static inline struct kiocb *list_kiocb(struct list_head *h)
229225
{
230226
return list_entry(h, struct kiocb, ki_list);

0 commit comments

Comments
 (0)