fs: make aio plug
Signed-off-by: Shaohua Li <shaohua.li@intel.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
This commit is contained in:
parent
2ed1a6bcf9
commit
9f5b942546
4
fs/aio.c
4
fs/aio.c
@ -1660,6 +1660,7 @@ long do_io_submit(aio_context_t ctx_id, long nr,
|
|||||||
long ret = 0;
|
long ret = 0;
|
||||||
int i;
|
int i;
|
||||||
struct hlist_head batch_hash[AIO_BATCH_HASH_SIZE] = { { 0, }, };
|
struct hlist_head batch_hash[AIO_BATCH_HASH_SIZE] = { { 0, }, };
|
||||||
|
struct blk_plug plug;
|
||||||
|
|
||||||
if (unlikely(nr < 0))
|
if (unlikely(nr < 0))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@ -1676,6 +1677,8 @@ long do_io_submit(aio_context_t ctx_id, long nr,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
blk_start_plug(&plug);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* AKPM: should this return a partial result if some of the IOs were
|
* AKPM: should this return a partial result if some of the IOs were
|
||||||
* successfully submitted?
|
* successfully submitted?
|
||||||
@ -1698,6 +1701,7 @@ long do_io_submit(aio_context_t ctx_id, long nr,
|
|||||||
if (ret)
|
if (ret)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
blk_finish_plug(&plug);
|
||||||
aio_batch_free(batch_hash);
|
aio_batch_free(batch_hash);
|
||||||
|
|
||||||
put_ioctx(ctx);
|
put_ioctx(ctx);
|
||||||
|
Loading…
Reference in New Issue
Block a user