Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 16554
b: refs/heads/master
c: 1345b1d
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Jan 6, 2006
1 parent 191e695 commit c167ca2
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7dd5d34c6c2da04e8cd0732e08b33cd3359e4bae
refs/heads/master: 1345b1d8adbdeceb1c871d9a4af5e2a700b341c6
3 changes: 1 addition & 2 deletions trunk/drivers/md/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,8 +626,7 @@ static void bitmap_file_unmap(struct bitmap *bitmap)
kfree(map);
kfree(attr);

if (sb_page)
put_page(sb_page);
safe_put_page(sb_page);
}

static void bitmap_stop_daemon(struct bitmap *bitmap);
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/md/raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ static void * r1buf_pool_alloc(gfp_t gfp_flags, void *data)
out_free_pages:
for (i=0; i < RESYNC_PAGES ; i++)
for (j=0 ; j < pi->raid_disks; j++)
put_page(r1_bio->bios[j]->bi_io_vec[i].bv_page);
safe_put_page(r1_bio->bios[j]->bi_io_vec[i].bv_page);
j = -1;
out_free_bio:
while ( ++j < pi->raid_disks )
Expand All @@ -156,7 +156,7 @@ static void r1buf_pool_free(void *__r1_bio, void *data)
if (j == 0 ||
r1bio->bios[j]->bi_io_vec[i].bv_page !=
r1bio->bios[0]->bi_io_vec[i].bv_page)
put_page(r1bio->bios[j]->bi_io_vec[i].bv_page);
safe_put_page(r1bio->bios[j]->bi_io_vec[i].bv_page);
}
for (i=0 ; i < pi->raid_disks; i++)
bio_put(r1bio->bios[i]);
Expand Down Expand Up @@ -381,7 +381,7 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int
/* free extra copy of the data pages */
int i = bio->bi_vcnt;
while (i--)
put_page(bio->bi_io_vec[i].bv_page);
safe_put_page(bio->bi_io_vec[i].bv_page);
}
/* clear the bitmap if all writes complete successfully */
bitmap_endwrite(r1_bio->mddev->bitmap, r1_bio->sector,
Expand Down Expand Up @@ -1907,7 +1907,7 @@ static int run(mddev_t *mddev)
if (conf->r1bio_pool)
mempool_destroy(conf->r1bio_pool);
kfree(conf->mirrors);
put_page(conf->tmppage);
safe_put_page(conf->tmppage);
kfree(conf->poolinfo);
kfree(conf);
mddev->private = NULL;
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/md/raid10.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ static void * r10buf_pool_alloc(gfp_t gfp_flags, void *data)

out_free_pages:
for ( ; i > 0 ; i--)
put_page(bio->bi_io_vec[i-1].bv_page);
safe_put_page(bio->bi_io_vec[i-1].bv_page);
while (j--)
for (i = 0; i < RESYNC_PAGES ; i++)
put_page(r10_bio->devs[j].bio->bi_io_vec[i].bv_page);
safe_put_page(r10_bio->devs[j].bio->bi_io_vec[i].bv_page);
j = -1;
out_free_bio:
while ( ++j < nalloc )
Expand All @@ -155,7 +155,7 @@ static void r10buf_pool_free(void *__r10_bio, void *data)
struct bio *bio = r10bio->devs[j].bio;
if (bio) {
for (i = 0; i < RESYNC_PAGES; i++) {
put_page(bio->bi_io_vec[i].bv_page);
safe_put_page(bio->bi_io_vec[i].bv_page);
bio->bi_io_vec[i].bv_page = NULL;
}
bio_put(bio);
Expand Down Expand Up @@ -2042,7 +2042,7 @@ static int run(mddev_t *mddev)
out_free_conf:
if (conf->r10bio_pool)
mempool_destroy(conf->r10bio_pool);
put_page(conf->tmppage);
safe_put_page(conf->tmppage);
kfree(conf->mirrors);
kfree(conf);
mddev->private = NULL;
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/md/raid6main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2072,8 +2072,7 @@ static int run(mddev_t *mddev)
abort:
if (conf) {
print_raid6_conf(conf);
if (conf->spare_page)
put_page(conf->spare_page);
safe_put_page(conf->spare_page);
kfree(conf->stripe_hashtbl);
kfree(conf);
}
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/linux/raid/md_k.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,5 +324,10 @@ do { \
__wait_event_lock_irq(wq, condition, lock, cmd); \
} while (0)

static inline void safe_put_page(struct page *p)
{
if (p) put_page(p);
}

#endif

0 comments on commit c167ca2

Please sign in to comment.