aio: kill ki_key
ki_key wasn't actually used for anything previously - it was always 0. Drop it to trim struct kiocb a bit. 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> Reviewed-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:

committed by
Linus Torvalds

parent
4e23bcaeb9
commit
8a6608907c
7
fs/aio.c
7
fs/aio.c
@@ -1159,7 +1159,7 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
|
||||
}
|
||||
}
|
||||
|
||||
ret = put_user(req->ki_key, &user_iocb->aio_key);
|
||||
ret = put_user(KIOCB_KEY, &user_iocb->aio_key);
|
||||
if (unlikely(ret)) {
|
||||
pr_debug("EFAULT: aio_key\n");
|
||||
goto out_put_req;
|
||||
@@ -1281,10 +1281,13 @@ static struct kiocb *lookup_kiocb(struct kioctx *ctx, struct iocb __user *iocb,
|
||||
|
||||
assert_spin_locked(&ctx->ctx_lock);
|
||||
|
||||
if (key != KIOCB_KEY)
|
||||
return NULL;
|
||||
|
||||
/* TODO: use a hash or array, this sucks. */
|
||||
list_for_each(pos, &ctx->active_reqs) {
|
||||
struct kiocb *kiocb = list_kiocb(pos);
|
||||
if (kiocb->ki_obj.user == iocb && kiocb->ki_key == key)
|
||||
if (kiocb->ki_obj.user == iocb)
|
||||
return kiocb;
|
||||
}
|
||||
return NULL;
|
||||
|
Reference in New Issue
Block a user