Lines Matching refs:qbh

113 void *hpfs_map_4sectors(struct super_block *s, unsigned secno, struct quad_buffer_head *qbh,  in hpfs_map_4sectors()  argument
129 if (!hpfs_map_sector(s, secno + 0, &qbh->bh[0], 0)) goto bail0; in hpfs_map_4sectors()
130 if (!hpfs_map_sector(s, secno + 1, &qbh->bh[1], 0)) goto bail1; in hpfs_map_4sectors()
131 if (!hpfs_map_sector(s, secno + 2, &qbh->bh[2], 0)) goto bail2; in hpfs_map_4sectors()
132 if (!hpfs_map_sector(s, secno + 3, &qbh->bh[3], 0)) goto bail3; in hpfs_map_4sectors()
134 if (likely(qbh->bh[1]->b_data == qbh->bh[0]->b_data + 1 * 512) && in hpfs_map_4sectors()
135 likely(qbh->bh[2]->b_data == qbh->bh[0]->b_data + 2 * 512) && in hpfs_map_4sectors()
136 likely(qbh->bh[3]->b_data == qbh->bh[0]->b_data + 3 * 512)) { in hpfs_map_4sectors()
137 return qbh->data = qbh->bh[0]->b_data; in hpfs_map_4sectors()
140 qbh->data = data = kmalloc(2048, GFP_NOFS); in hpfs_map_4sectors()
146 memcpy(data + 0 * 512, qbh->bh[0]->b_data, 512); in hpfs_map_4sectors()
147 memcpy(data + 1 * 512, qbh->bh[1]->b_data, 512); in hpfs_map_4sectors()
148 memcpy(data + 2 * 512, qbh->bh[2]->b_data, 512); in hpfs_map_4sectors()
149 memcpy(data + 3 * 512, qbh->bh[3]->b_data, 512); in hpfs_map_4sectors()
154 brelse(qbh->bh[3]); in hpfs_map_4sectors()
156 brelse(qbh->bh[2]); in hpfs_map_4sectors()
158 brelse(qbh->bh[1]); in hpfs_map_4sectors()
160 brelse(qbh->bh[0]); in hpfs_map_4sectors()
168 struct quad_buffer_head *qbh) in hpfs_get_4sectors() argument
179 if (!hpfs_get_sector(s, secno + 0, &qbh->bh[0])) goto bail0; in hpfs_get_4sectors()
180 if (!hpfs_get_sector(s, secno + 1, &qbh->bh[1])) goto bail1; in hpfs_get_4sectors()
181 if (!hpfs_get_sector(s, secno + 2, &qbh->bh[2])) goto bail2; in hpfs_get_4sectors()
182 if (!hpfs_get_sector(s, secno + 3, &qbh->bh[3])) goto bail3; in hpfs_get_4sectors()
184 if (likely(qbh->bh[1]->b_data == qbh->bh[0]->b_data + 1 * 512) && in hpfs_get_4sectors()
185 likely(qbh->bh[2]->b_data == qbh->bh[0]->b_data + 2 * 512) && in hpfs_get_4sectors()
186 likely(qbh->bh[3]->b_data == qbh->bh[0]->b_data + 3 * 512)) { in hpfs_get_4sectors()
187 return qbh->data = qbh->bh[0]->b_data; in hpfs_get_4sectors()
190 if (!(qbh->data = kmalloc(2048, GFP_NOFS))) { in hpfs_get_4sectors()
194 return qbh->data; in hpfs_get_4sectors()
197 brelse(qbh->bh[3]); in hpfs_get_4sectors()
199 brelse(qbh->bh[2]); in hpfs_get_4sectors()
201 brelse(qbh->bh[1]); in hpfs_get_4sectors()
203 brelse(qbh->bh[0]); in hpfs_get_4sectors()
209 void hpfs_brelse4(struct quad_buffer_head *qbh) in hpfs_brelse4() argument
211 if (unlikely(qbh->data != qbh->bh[0]->b_data)) in hpfs_brelse4()
212 kfree(qbh->data); in hpfs_brelse4()
213 brelse(qbh->bh[0]); in hpfs_brelse4()
214 brelse(qbh->bh[1]); in hpfs_brelse4()
215 brelse(qbh->bh[2]); in hpfs_brelse4()
216 brelse(qbh->bh[3]); in hpfs_brelse4()
219 void hpfs_mark_4buffers_dirty(struct quad_buffer_head *qbh) in hpfs_mark_4buffers_dirty() argument
221 if (unlikely(qbh->data != qbh->bh[0]->b_data)) { in hpfs_mark_4buffers_dirty()
222 memcpy(qbh->bh[0]->b_data, qbh->data + 0 * 512, 512); in hpfs_mark_4buffers_dirty()
223 memcpy(qbh->bh[1]->b_data, qbh->data + 1 * 512, 512); in hpfs_mark_4buffers_dirty()
224 memcpy(qbh->bh[2]->b_data, qbh->data + 2 * 512, 512); in hpfs_mark_4buffers_dirty()
225 memcpy(qbh->bh[3]->b_data, qbh->data + 3 * 512, 512); in hpfs_mark_4buffers_dirty()
227 mark_buffer_dirty(qbh->bh[0]); in hpfs_mark_4buffers_dirty()
228 mark_buffer_dirty(qbh->bh[1]); in hpfs_mark_4buffers_dirty()
229 mark_buffer_dirty(qbh->bh[2]); in hpfs_mark_4buffers_dirty()
230 mark_buffer_dirty(qbh->bh[3]); in hpfs_mark_4buffers_dirty()