Skip to content

Commit

Permalink
bio: use memset() in bio_init()
Browse files Browse the repository at this point in the history
Use memset() to clear the bio, instead of doing each field manually.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
Jens Axboe committed Oct 16, 2007
1 parent 4fa253f commit 2b94de5
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions fs/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,21 +127,9 @@ static void bio_fs_destructor(struct bio *bio)

void bio_init(struct bio *bio)
{
bio->bi_next = NULL;
bio->bi_bdev = NULL;
memset(bio, 0, sizeof(*bio));
bio->bi_flags = 1 << BIO_UPTODATE;
bio->bi_rw = 0;
bio->bi_vcnt = 0;
bio->bi_idx = 0;
bio->bi_phys_segments = 0;
bio->bi_hw_segments = 0;
bio->bi_hw_front_size = 0;
bio->bi_hw_back_size = 0;
bio->bi_size = 0;
bio->bi_max_vecs = 0;
bio->bi_end_io = NULL;
atomic_set(&bio->bi_cnt, 1);
bio->bi_private = NULL;
}

/**
Expand Down

0 comments on commit 2b94de5

Please sign in to comment.