diff options
author | David S. Miller <davem@davemloft.net> | 2011-01-24 16:17:06 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-24 16:17:06 -0500 |
commit | e92427b289d252cfbd4cb5282d92f4ce1a5bb1fb (patch) | |
tree | 6d30e5e7b7f8e9aaa51d43b7128ac56860fa03bb /fs/aio.c | |
parent | c506653d35249bb4738bb139c24362e1ae724bc1 (diff) | |
parent | ec30f343d61391ab23705e50a525da1d55395780 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'fs/aio.c')
-rw-r--r-- | fs/aio.c | 31 |
1 files changed, 7 insertions, 24 deletions
@@ -87,7 +87,7 @@ static int __init aio_setup(void) | |||
87 | 87 | ||
88 | aio_wq = create_workqueue("aio"); | 88 | aio_wq = create_workqueue("aio"); |
89 | abe_pool = mempool_create_kmalloc_pool(1, sizeof(struct aio_batch_entry)); | 89 | abe_pool = mempool_create_kmalloc_pool(1, sizeof(struct aio_batch_entry)); |
90 | BUG_ON(!abe_pool); | 90 | BUG_ON(!aio_wq || !abe_pool); |
91 | 91 | ||
92 | pr_debug("aio_setup: sizeof(struct page) = %d\n", (int)sizeof(struct page)); | 92 | pr_debug("aio_setup: sizeof(struct page) = %d\n", (int)sizeof(struct page)); |
93 | 93 | ||
@@ -798,29 +798,12 @@ static void aio_queue_work(struct kioctx * ctx) | |||
798 | queue_delayed_work(aio_wq, &ctx->wq, timeout); | 798 | queue_delayed_work(aio_wq, &ctx->wq, timeout); |
799 | } | 799 | } |
800 | 800 | ||
801 | |||
802 | /* | ||
803 | * aio_run_iocbs: | ||
804 | * Process all pending retries queued on the ioctx | ||
805 | * run list. | ||
806 | * Assumes it is operating within the aio issuer's mm | ||
807 | * context. | ||
808 | */ | ||
809 | static inline void aio_run_iocbs(struct kioctx *ctx) | ||
810 | { | ||
811 | int requeue; | ||
812 | |||
813 | spin_lock_irq(&ctx->ctx_lock); | ||
814 | |||
815 | requeue = __aio_run_iocbs(ctx); | ||
816 | spin_unlock_irq(&ctx->ctx_lock); | ||
817 | if (requeue) | ||
818 | aio_queue_work(ctx); | ||
819 | } | ||
820 | |||
821 | /* | 801 | /* |
822 | * just like aio_run_iocbs, but keeps running them until | 802 | * aio_run_all_iocbs: |
823 | * the list stays empty | 803 | * Process all pending retries queued on the ioctx |
804 | * run list, and keep running them until the list | ||
805 | * stays empty. | ||
806 | * Assumes it is operating within the aio issuer's mm context. | ||
824 | */ | 807 | */ |
825 | static inline void aio_run_all_iocbs(struct kioctx *ctx) | 808 | static inline void aio_run_all_iocbs(struct kioctx *ctx) |
826 | { | 809 | { |
@@ -1839,7 +1822,7 @@ SYSCALL_DEFINE5(io_getevents, aio_context_t, ctx_id, | |||
1839 | long ret = -EINVAL; | 1822 | long ret = -EINVAL; |
1840 | 1823 | ||
1841 | if (likely(ioctx)) { | 1824 | if (likely(ioctx)) { |
1842 | if (likely(min_nr <= nr && min_nr >= 0 && nr >= 0)) | 1825 | if (likely(min_nr <= nr && min_nr >= 0)) |
1843 | ret = read_events(ioctx, min_nr, nr, events, timeout); | 1826 | ret = read_events(ioctx, min_nr, nr, events, timeout); |
1844 | put_ioctx(ioctx); | 1827 | put_ioctx(ioctx); |
1845 | } | 1828 | } |