diff options
author | Christoph Hellwig <hch@infradead.org> | 2010-08-18 05:29:20 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-09-10 06:35:39 -0400 |
commit | 349f429eec36cb743fee20f4c193ecde97a3ed2e (patch) | |
tree | c4618700a2bbb4b7954f048155a095808d69dc45 /mm/swapfile.c | |
parent | e045db80d07250312500b2ed707b84dc703189d6 (diff) |
swap: do not send discards as barriers
The swap code already uses synchronous discards, no need to add I/O barriers.
tj: superflous newlines removed.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Hugh Dickins <hughd@google.com>
Tested-by: Nigel Cunningham <nigel@tuxonice.net>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r-- | mm/swapfile.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c index 1f3f9c59a73a..68cda164dff6 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c | |||
@@ -141,8 +141,7 @@ static int discard_swap(struct swap_info_struct *si) | |||
141 | nr_blocks = ((sector_t)se->nr_pages - 1) << (PAGE_SHIFT - 9); | 141 | nr_blocks = ((sector_t)se->nr_pages - 1) << (PAGE_SHIFT - 9); |
142 | if (nr_blocks) { | 142 | if (nr_blocks) { |
143 | err = blkdev_issue_discard(si->bdev, start_block, | 143 | err = blkdev_issue_discard(si->bdev, start_block, |
144 | nr_blocks, GFP_KERNEL, | 144 | nr_blocks, GFP_KERNEL, BLKDEV_IFL_WAIT); |
145 | BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER); | ||
146 | if (err) | 145 | if (err) |
147 | return err; | 146 | return err; |
148 | cond_resched(); | 147 | cond_resched(); |
@@ -153,8 +152,7 @@ static int discard_swap(struct swap_info_struct *si) | |||
153 | nr_blocks = (sector_t)se->nr_pages << (PAGE_SHIFT - 9); | 152 | nr_blocks = (sector_t)se->nr_pages << (PAGE_SHIFT - 9); |
154 | 153 | ||
155 | err = blkdev_issue_discard(si->bdev, start_block, | 154 | err = blkdev_issue_discard(si->bdev, start_block, |
156 | nr_blocks, GFP_KERNEL, | 155 | nr_blocks, GFP_KERNEL, BLKDEV_IFL_WAIT); |
157 | BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER); | ||
158 | if (err) | 156 | if (err) |
159 | break; | 157 | break; |
160 | 158 | ||
@@ -193,8 +191,7 @@ static void discard_swap_cluster(struct swap_info_struct *si, | |||
193 | start_block <<= PAGE_SHIFT - 9; | 191 | start_block <<= PAGE_SHIFT - 9; |
194 | nr_blocks <<= PAGE_SHIFT - 9; | 192 | nr_blocks <<= PAGE_SHIFT - 9; |
195 | if (blkdev_issue_discard(si->bdev, start_block, | 193 | if (blkdev_issue_discard(si->bdev, start_block, |
196 | nr_blocks, GFP_NOIO, BLKDEV_IFL_WAIT | | 194 | nr_blocks, GFP_NOIO, BLKDEV_IFL_WAIT)) |
197 | BLKDEV_IFL_BARRIER)) | ||
198 | break; | 195 | break; |
199 | } | 196 | } |
200 | 197 | ||