Commit 5baebe5c86acd6100536a466905880529f79cf1a

Authored by Lukas Czerner
Committed by Jens Axboe
1 parent 5dba3089ed

blkdev: Simple cleanup in blkdev_issue_zeroout()

In blkdev_issue_zeroout() we are submitting regular WRITE bios, so we do
not need to check for -EOPNOTSUPP specifically in case of error. Also
there is no need to have label submit: because there is no way to jump
out from the while cycle without an error and we really want to exit,
rather than try again. And also remove the check for (sz == 0) since at
that point sz can never be zero.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
CC: Dmitry Monakhov <dmonakhov@openvz.org>
CC: Jens Axboe <jaxboe@fusionio.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>

Showing 1 changed file with 0 additions and 14 deletions Side-by-side Diff

... ... @@ -140,7 +140,6 @@
140 140 bb.flags = 1 << BIO_UPTODATE;
141 141 bb.wait = &wait;
142 142  
143   -submit:
144 143 ret = 0;
145 144 while (nr_sects != 0) {
146 145 bio = bio_alloc(gfp_mask,
... ... @@ -157,9 +156,6 @@
157 156  
158 157 while (nr_sects != 0) {
159 158 sz = min((sector_t) PAGE_SIZE >> 9 , nr_sects);
160   - if (sz == 0)
161   - /* bio has maximum size possible */
162   - break;
163 159 ret = bio_add_page(bio, ZERO_PAGE(0), sz << 9, 0);
164 160 nr_sects -= ret >> 9;
165 161 sector += ret >> 9;
... ... @@ -179,16 +175,6 @@
179 175 /* One of bios in the batch was completed with error.*/
180 176 ret = -EIO;
181 177  
182   - if (ret)
183   - goto out;
184   -
185   - if (test_bit(BIO_EOPNOTSUPP, &bb.flags)) {
186   - ret = -EOPNOTSUPP;
187   - goto out;
188   - }
189   - if (nr_sects != 0)
190   - goto submit;
191   -out:
192 178 return ret;
193 179 }
194 180 EXPORT_SYMBOL(blkdev_issue_zeroout);