aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_aops.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2011-08-23 04:28:13 -0400
committerAlex Elder <aelder@sgi.com>2011-10-11 22:15:01 -0400
commit4a06fd262dbeb70a2c315f7259e063efa493fe3d (patch)
treecca4aee6c419a8b3dc267176bb43d93048593919 /fs/xfs/xfs_aops.c
parent2b3ffd7eb7b4392e3657c5046b055ca9f1f7cf5e (diff)
xfs: remove i_iocount
We now have an i_dio_count filed and surrounding infrastructure to wait for direct I/O completion instead of i_icount, and we have never needed to iocount waits for buffered I/O given that we only set the page uptodate after finishing all required work. Thus remove i_iocount, and replace the actually needed waits with calls to inode_dio_wait. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_aops.c')
-rw-r--r--fs/xfs/xfs_aops.c39
1 files changed, 1 insertions, 38 deletions
diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index e1ff0770784e..46bba3e0af47 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -38,40 +38,6 @@
38#include <linux/pagevec.h> 38#include <linux/pagevec.h>
39#include <linux/writeback.h> 39#include <linux/writeback.h>
40 40
41
42/*
43 * Prime number of hash buckets since address is used as the key.
44 */
45#define NVSYNC 37
46#define to_ioend_wq(v) (&xfs_ioend_wq[((unsigned long)v) % NVSYNC])
47static wait_queue_head_t xfs_ioend_wq[NVSYNC];
48
49void __init
50xfs_ioend_init(void)
51{
52 int i;
53
54 for (i = 0; i < NVSYNC; i++)
55 init_waitqueue_head(&xfs_ioend_wq[i]);
56}
57
58void
59xfs_ioend_wait(
60 xfs_inode_t *ip)
61{
62 wait_queue_head_t *wq = to_ioend_wq(ip);
63
64 wait_event(*wq, (atomic_read(&ip->i_iocount) == 0));
65}
66
67STATIC void
68xfs_ioend_wake(
69 xfs_inode_t *ip)
70{
71 if (atomic_dec_and_test(&ip->i_iocount))
72 wake_up(to_ioend_wq(ip));
73}
74
75void 41void
76xfs_count_page_state( 42xfs_count_page_state(
77 struct page *page, 43 struct page *page,
@@ -115,7 +81,6 @@ xfs_destroy_ioend(
115 xfs_ioend_t *ioend) 81 xfs_ioend_t *ioend)
116{ 82{
117 struct buffer_head *bh, *next; 83 struct buffer_head *bh, *next;
118 struct xfs_inode *ip = XFS_I(ioend->io_inode);
119 84
120 for (bh = ioend->io_buffer_head; bh; bh = next) { 85 for (bh = ioend->io_buffer_head; bh; bh = next) {
121 next = bh->b_private; 86 next = bh->b_private;
@@ -127,7 +92,7 @@ xfs_destroy_ioend(
127 aio_complete(ioend->io_iocb, ioend->io_result, 0); 92 aio_complete(ioend->io_iocb, ioend->io_result, 0);
128 inode_dio_done(ioend->io_inode); 93 inode_dio_done(ioend->io_inode);
129 } 94 }
130 xfs_ioend_wake(ip); 95
131 mempool_free(ioend, xfs_ioend_pool); 96 mempool_free(ioend, xfs_ioend_pool);
132} 97}
133 98
@@ -298,7 +263,6 @@ xfs_alloc_ioend(
298 ioend->io_inode = inode; 263 ioend->io_inode = inode;
299 ioend->io_buffer_head = NULL; 264 ioend->io_buffer_head = NULL;
300 ioend->io_buffer_tail = NULL; 265 ioend->io_buffer_tail = NULL;
301 atomic_inc(&XFS_I(ioend->io_inode)->i_iocount);
302 ioend->io_offset = 0; 266 ioend->io_offset = 0;
303 ioend->io_size = 0; 267 ioend->io_size = 0;
304 ioend->io_iocb = NULL; 268 ioend->io_iocb = NULL;
@@ -558,7 +522,6 @@ xfs_cancel_ioend(
558 unlock_buffer(bh); 522 unlock_buffer(bh);
559 } while ((bh = next_bh) != NULL); 523 } while ((bh = next_bh) != NULL);
560 524
561 xfs_ioend_wake(XFS_I(ioend->io_inode));
562 mempool_free(ioend, xfs_ioend_pool); 525 mempool_free(ioend, xfs_ioend_pool);
563 } while ((ioend = next) != NULL); 526 } while ((ioend = next) != NULL);
564} 527}