Lines Matching refs:ds

31 	struct xchk_da_btree	*ds,
35 struct xfs_scrub *sc = ds->sc;
53 trace_xchk_file_op_error(sc, ds->dargs.whichfork,
54 xfs_dir2_da_to_db(ds->dargs.geo,
55 ds->state->path.blk[level].blkno),
68 struct xchk_da_btree *ds,
71 struct xfs_scrub *sc = ds->sc;
75 trace_xchk_fblock_error(sc, ds->dargs.whichfork,
76 xfs_dir2_da_to_db(ds->dargs.geo,
77 ds->state->path.blk[level].blkno),
83 struct xchk_da_btree *ds,
86 struct xfs_da_state_blk *blk = &ds->state->path.blk[level];
91 xfs_da3_node_hdr_from_disk(ds->sc->mp, &hdr, blk->bp->b_addr);
98 struct xchk_da_btree *ds,
108 if (hash < ds->hashes[level])
109 xchk_da_set_corrupt(ds, level);
110 ds->hashes[level] = hash;
116 entry = xchk_da_btree_node_entry(ds, level - 1);
119 xchk_da_set_corrupt(ds, level);
130 struct xchk_da_btree *ds,
134 if (blkno < ds->lowest || (ds->highest != 0 && blkno >= ds->highest)) {
135 xchk_da_set_corrupt(ds, level);
218 struct xchk_da_btree *ds,
223 struct xfs_da_state_path *path = &ds->state->path;
224 struct xfs_da_state_path *altpath = &ds->state->altpath;
229 memcpy(altpath, path, sizeof(ds->state->altpath));
236 error = xfs_da3_path_shift(ds->state, altpath, direction,
239 xchk_da_set_corrupt(ds, level);
245 error = xfs_da3_path_shift(ds->state, altpath, direction, false,
247 if (!xchk_da_process_error(ds, level, &error))
250 xchk_da_set_corrupt(ds, level);
254 xchk_buffer_recheck(ds->sc, altpath->blk[level].bp);
258 xchk_da_set_corrupt(ds, level);
268 xfs_trans_brelse(ds->dargs.trans, altpath->blk[plevel].bp);
278 struct xchk_da_btree *ds,
292 xchk_da_set_corrupt(ds, level);
300 error = xchk_da_btree_block_check_sibling(ds, level, 0, back);
303 error = xchk_da_btree_block_check_sibling(ds, level, 1, forw);
306 memset(&ds->state->altpath, 0, sizeof(ds->state->altpath));
313 struct xchk_da_btree *ds,
321 struct xfs_da_args *dargs = &ds->dargs;
322 struct xfs_inode *ip = ds->dargs.dp;
328 blk = &ds->state->path.blk[level];
329 ds->state->path.active = level + 1;
339 if (!xchk_da_btree_ptr_ok(ds, level, blkno))
346 if (!xchk_da_process_error(ds, level, &error))
349 xchk_buffer_recheck(ds->sc, blk->bp);
356 if (ds->dargs.whichfork == XFS_DATA_FORK && level == 0 &&
362 xchk_da_set_corrupt(ds, level);
368 pmaxrecs = &ds->maxrecs[level];
371 if (xfs_has_crc(ds->sc->mp) && hdr3->hdr.pad)
372 xchk_da_set_corrupt(ds, level);
378 xchk_da_set_corrupt(ds, level);
382 error = xchk_da_btree_block_check_siblings(ds, level, &hdr3->hdr);
394 if (ds->tree_level != 0)
395 xchk_da_set_corrupt(ds, level);
403 if (ds->tree_level != 0)
404 xchk_da_set_corrupt(ds, level);
412 if (ds->tree_level != 0)
413 xchk_da_set_corrupt(ds, level);
427 xchk_da_set_corrupt(ds, level);
430 ds->tree_level = nodehdr.level;
432 if (ds->tree_level != nodehdr.level) {
433 xchk_da_set_corrupt(ds, level);
441 xchk_da_set_corrupt(ds, level);
452 key = xchk_da_btree_node_entry(ds, level - 1);
454 xchk_da_set_corrupt(ds, level);
477 struct xchk_da_btree *ds;
490 ds = kzalloc(sizeof(struct xchk_da_btree), XCHK_GFP_FLAGS);
491 if (!ds)
493 ds->dargs.dp = sc->ip;
494 ds->dargs.whichfork = whichfork;
495 ds->dargs.trans = sc->tp;
496 ds->dargs.op_flags = XFS_DA_OP_OKNOENT;
497 ds->state = xfs_da_state_alloc(&ds->dargs);
498 ds->sc = sc;
499 ds->private = private;
501 ds->dargs.geo = mp->m_attr_geo;
502 ds->lowest = 0;
503 ds->highest = 0;
505 ds->dargs.geo = mp->m_dir_geo;
506 ds->lowest = ds->dargs.geo->leafblk;
507 ds->highest = ds->dargs.geo->freeblk;
509 blkno = ds->lowest;
513 blks = ds->state->path.blk;
514 error = xchk_da_btree_block(ds, level, blkno);
518 * We didn't find a block at ds->lowest, which means that there's
530 if (blks[level].index >= ds->maxrecs[level]) {
533 ds->tree_level++;
539 error = scrub_fn(ds, level);
552 if (blks[level].index >= ds->maxrecs[level]) {
555 ds->tree_level++;
561 key = xchk_da_btree_node_entry(ds, level);
562 error = xchk_da_btree_hash(ds, level, &key->hashval);
571 xchk_da_set_corrupt(ds, level - 1);
574 ds->tree_level--;
575 error = xchk_da_btree_block(ds, level, blkno);
594 xfs_da_state_free(ds->state);
595 kfree(ds);