diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2007-07-18 07:14:03 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2007-10-16 05:03:51 -0400 |
commit | 2b94de552e07610dfa79fc49ea49d1cfa5cd9ce8 (patch) | |
tree | 4ead48b312a7faf00e0c0373156e1e92cab618f0 /fs | |
parent | 4fa253f33c1d4d6402de9eaacefdb45a47ed116d (diff) |
bio: use memset() in bio_init()
Use memset() to clear the bio, instead of doing each field manually.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/bio.c | 14 |
1 files changed, 1 insertions, 13 deletions
@@ -127,21 +127,9 @@ static void bio_fs_destructor(struct bio *bio) | |||
127 | 127 | ||
128 | void bio_init(struct bio *bio) | 128 | void bio_init(struct bio *bio) |
129 | { | 129 | { |
130 | bio->bi_next = NULL; | 130 | memset(bio, 0, sizeof(*bio)); |
131 | bio->bi_bdev = NULL; | ||
132 | bio->bi_flags = 1 << BIO_UPTODATE; | 131 | bio->bi_flags = 1 << BIO_UPTODATE; |
133 | bio->bi_rw = 0; | ||
134 | bio->bi_vcnt = 0; | ||
135 | bio->bi_idx = 0; | ||
136 | bio->bi_phys_segments = 0; | ||
137 | bio->bi_hw_segments = 0; | ||
138 | bio->bi_hw_front_size = 0; | ||
139 | bio->bi_hw_back_size = 0; | ||
140 | bio->bi_size = 0; | ||
141 | bio->bi_max_vecs = 0; | ||
142 | bio->bi_end_io = NULL; | ||
143 | atomic_set(&bio->bi_cnt, 1); | 132 | atomic_set(&bio->bi_cnt, 1); |
144 | bio->bi_private = NULL; | ||
145 | } | 133 | } |
146 | 134 | ||
147 | /** | 135 | /** |