Lines Matching refs:qbh
114 void *hpfs_map_4sectors(struct super_block *s, unsigned secno, struct quad_buffer_head *qbh, in hpfs_map_4sectors() argument
130 if (!hpfs_map_sector(s, secno + 0, &qbh->bh[0], 0)) goto bail0; in hpfs_map_4sectors()
131 if (!hpfs_map_sector(s, secno + 1, &qbh->bh[1], 0)) goto bail1; in hpfs_map_4sectors()
132 if (!hpfs_map_sector(s, secno + 2, &qbh->bh[2], 0)) goto bail2; in hpfs_map_4sectors()
133 if (!hpfs_map_sector(s, secno + 3, &qbh->bh[3], 0)) goto bail3; in hpfs_map_4sectors()
135 if (likely(qbh->bh[1]->b_data == qbh->bh[0]->b_data + 1 * 512) && in hpfs_map_4sectors()
136 likely(qbh->bh[2]->b_data == qbh->bh[0]->b_data + 2 * 512) && in hpfs_map_4sectors()
137 likely(qbh->bh[3]->b_data == qbh->bh[0]->b_data + 3 * 512)) { in hpfs_map_4sectors()
138 return qbh->data = qbh->bh[0]->b_data; in hpfs_map_4sectors()
141 qbh->data = data = kmalloc(2048, GFP_NOFS); in hpfs_map_4sectors()
147 memcpy(data + 0 * 512, qbh->bh[0]->b_data, 512); in hpfs_map_4sectors()
148 memcpy(data + 1 * 512, qbh->bh[1]->b_data, 512); in hpfs_map_4sectors()
149 memcpy(data + 2 * 512, qbh->bh[2]->b_data, 512); in hpfs_map_4sectors()
150 memcpy(data + 3 * 512, qbh->bh[3]->b_data, 512); in hpfs_map_4sectors()
155 brelse(qbh->bh[3]); in hpfs_map_4sectors()
157 brelse(qbh->bh[2]); in hpfs_map_4sectors()
159 brelse(qbh->bh[1]); in hpfs_map_4sectors()
161 brelse(qbh->bh[0]); in hpfs_map_4sectors()
169 struct quad_buffer_head *qbh) in hpfs_get_4sectors() argument
180 if (!hpfs_get_sector(s, secno + 0, &qbh->bh[0])) goto bail0; in hpfs_get_4sectors()
181 if (!hpfs_get_sector(s, secno + 1, &qbh->bh[1])) goto bail1; in hpfs_get_4sectors()
182 if (!hpfs_get_sector(s, secno + 2, &qbh->bh[2])) goto bail2; in hpfs_get_4sectors()
183 if (!hpfs_get_sector(s, secno + 3, &qbh->bh[3])) goto bail3; in hpfs_get_4sectors()
185 if (likely(qbh->bh[1]->b_data == qbh->bh[0]->b_data + 1 * 512) && in hpfs_get_4sectors()
186 likely(qbh->bh[2]->b_data == qbh->bh[0]->b_data + 2 * 512) && in hpfs_get_4sectors()
187 likely(qbh->bh[3]->b_data == qbh->bh[0]->b_data + 3 * 512)) { in hpfs_get_4sectors()
188 return qbh->data = qbh->bh[0]->b_data; in hpfs_get_4sectors()
191 if (!(qbh->data = kmalloc(2048, GFP_NOFS))) { in hpfs_get_4sectors()
195 return qbh->data; in hpfs_get_4sectors()
198 brelse(qbh->bh[3]); in hpfs_get_4sectors()
200 brelse(qbh->bh[2]); in hpfs_get_4sectors()
202 brelse(qbh->bh[1]); in hpfs_get_4sectors()
204 brelse(qbh->bh[0]); in hpfs_get_4sectors()
210 void hpfs_brelse4(struct quad_buffer_head *qbh) in hpfs_brelse4() argument
212 if (unlikely(qbh->data != qbh->bh[0]->b_data)) in hpfs_brelse4()
213 kfree(qbh->data); in hpfs_brelse4()
214 brelse(qbh->bh[0]); in hpfs_brelse4()
215 brelse(qbh->bh[1]); in hpfs_brelse4()
216 brelse(qbh->bh[2]); in hpfs_brelse4()
217 brelse(qbh->bh[3]); in hpfs_brelse4()
220 void hpfs_mark_4buffers_dirty(struct quad_buffer_head *qbh) in hpfs_mark_4buffers_dirty() argument
222 if (unlikely(qbh->data != qbh->bh[0]->b_data)) { in hpfs_mark_4buffers_dirty()
223 memcpy(qbh->bh[0]->b_data, qbh->data + 0 * 512, 512); in hpfs_mark_4buffers_dirty()
224 memcpy(qbh->bh[1]->b_data, qbh->data + 1 * 512, 512); in hpfs_mark_4buffers_dirty()
225 memcpy(qbh->bh[2]->b_data, qbh->data + 2 * 512, 512); in hpfs_mark_4buffers_dirty()
226 memcpy(qbh->bh[3]->b_data, qbh->data + 3 * 512, 512); in hpfs_mark_4buffers_dirty()
228 mark_buffer_dirty(qbh->bh[0]); in hpfs_mark_4buffers_dirty()
229 mark_buffer_dirty(qbh->bh[1]); in hpfs_mark_4buffers_dirty()
230 mark_buffer_dirty(qbh->bh[2]); in hpfs_mark_4buffers_dirty()
231 mark_buffer_dirty(qbh->bh[3]); in hpfs_mark_4buffers_dirty()