#include <linux/highmem.h>
#include <linux/workqueue.h>
#include <linux/security.h>
#include <linux/highmem.h>
#include <linux/workqueue.h>
#include <linux/security.h>
dprintk(KERN_DEBUG "aio_put(%p): f_count=%d\n",
req, atomic_read(&req->ki_filp->f_count));
dprintk(KERN_DEBUG "aio_put(%p): f_count=%d\n",
req, atomic_read(&req->ki_filp->f_count));
/* Must be done under the lock to serialise against cancellation.
* Call this aio_fput as it duplicates fput via the fput_work.
*/
/* Must be done under the lock to serialise against cancellation.
* Call this aio_fput as it duplicates fput via the fput_work.
*/
* the kiocb (to tell the caller to activate the work
* queue to process it), or 0, if it found that it was
* already queued.
* the kiocb (to tell the caller to activate the work
* queue to process it), or 0, if it found that it was
* already queued.
if (list_empty(&iocb->ki_run_list)) {
list_add_tail(&iocb->ki_run_list,
&ctx->run_list);
if (list_empty(&iocb->ki_run_list)) {
list_add_tail(&iocb->ki_run_list,
&ctx->run_list);
* Process all pending retries queued on the ioctx
* run list.
* Assumes it is operating within the aio issuer's mm
* Process all pending retries queued on the ioctx
* run list.
* Assumes it is operating within the aio issuer's mm
list_splice_init(&ctx->run_list, &run_list);
while (!list_empty(&run_list)) {
iocb = list_entry(run_list.next, struct kiocb,
list_splice_init(&ctx->run_list, &run_list);
while (!list_empty(&run_list)) {
iocb = list_entry(run_list.next, struct kiocb,
/* TODO: use a hash or array, this sucks. */
list_for_each(pos, &ctx->active_reqs) {
struct kiocb *kiocb = list_kiocb(pos);
/* TODO: use a hash or array, this sucks. */
list_for_each(pos, &ctx->active_reqs) {
struct kiocb *kiocb = list_kiocb(pos);