aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2011-10-30 18:41:19 -0400
committerTheodore Ts'o <tytso@mit.edu>2011-10-30 18:41:19 -0400
commit4e298021216727cc27017c5032ade86167c66256 (patch)
treee50ab2e0747252c200773fc3e2a5bd885f85a30c /fs/ext4
parentd73d5046a72467d4510825b99e2269e09ad80e15 (diff)
ext4: remove unnecessary call to waitqueue_active()
The usage of waitqueue_active() is not necessary, and introduces (I believe) a hard-to-hit race. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/page-io.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
index aed40966f342..4fa1d709b604 100644
--- a/fs/ext4/page-io.c
+++ b/fs/ext4/page-io.c
@@ -70,7 +70,6 @@ static void put_io_page(struct ext4_io_page *io_page)
70void ext4_free_io_end(ext4_io_end_t *io) 70void ext4_free_io_end(ext4_io_end_t *io)
71{ 71{
72 int i; 72 int i;
73 wait_queue_head_t *wq;
74 73
75 BUG_ON(!io); 74 BUG_ON(!io);
76 if (io->page) 75 if (io->page)
@@ -78,10 +77,8 @@ void ext4_free_io_end(ext4_io_end_t *io)
78 for (i = 0; i < io->num_io_pages; i++) 77 for (i = 0; i < io->num_io_pages; i++)
79 put_io_page(io->pages[i]); 78 put_io_page(io->pages[i]);
80 io->num_io_pages = 0; 79 io->num_io_pages = 0;
81 wq = ext4_ioend_wq(io->inode); 80 if (atomic_dec_and_test(&EXT4_I(io->inode)->i_ioend_count))
82 if (atomic_dec_and_test(&EXT4_I(io->inode)->i_ioend_count) && 81 wake_up_all(ext4_ioend_wq(io->inode));
83 waitqueue_active(wq))
84 wake_up_all(wq);
85 kmem_cache_free(io_end_cachep, io); 82 kmem_cache_free(io_end_cachep, io);
86} 83}
87 84
@@ -96,7 +93,6 @@ int ext4_end_io_nolock(ext4_io_end_t *io)
96 struct inode *inode = io->inode; 93 struct inode *inode = io->inode;
97 loff_t offset = io->offset; 94 loff_t offset = io->offset;
98 ssize_t size = io->size; 95 ssize_t size = io->size;
99 wait_queue_head_t *wq;
100 int ret = 0; 96 int ret = 0;
101 97
102 ext4_debug("ext4_end_io_nolock: io 0x%p from inode %lu,list->next 0x%p," 98 ext4_debug("ext4_end_io_nolock: io 0x%p from inode %lu,list->next 0x%p,"
@@ -121,11 +117,8 @@ int ext4_end_io_nolock(ext4_io_end_t *io)
121 if (io->flag & EXT4_IO_END_UNWRITTEN) { 117 if (io->flag & EXT4_IO_END_UNWRITTEN) {
122 io->flag &= ~EXT4_IO_END_UNWRITTEN; 118 io->flag &= ~EXT4_IO_END_UNWRITTEN;
123 /* Wake up anyone waiting on unwritten extent conversion */ 119 /* Wake up anyone waiting on unwritten extent conversion */
124 wq = ext4_ioend_wq(io->inode); 120 if (atomic_dec_and_test(&EXT4_I(inode)->i_aiodio_unwritten))
125 if (atomic_dec_and_test(&EXT4_I(inode)->i_aiodio_unwritten) && 121 wake_up_all(ext4_ioend_wq(io->inode));
126 waitqueue_active(wq)) {
127 wake_up_all(wq);
128 }
129 } 122 }
130 123
131 return ret; 124 return ret;