Lines Matching full:directory

50  * Directory Repair
53 * We repair directories by reading the directory data blocks looking for
54 * directory entries that look salvageable (name passes verifiers, entry points
57 * directory to constrain memory use. Batching the construction of the
58 * temporary directory in this fashion reduces lock cycling of the directory
59 * being repaired and the temporary directory, and will later become important
63 * the directory by visiting each parent pointer of each file in the filesystem
65 * case, it is advantageous to stash all directory entries created from parent
67 * directory. To save memory, the live filesystem scan reuses the findparent
68 * fields. Directory repair chooses either parent pointer scanning or
69 * directory entry salvaging, but not both.
71 * Directory entries added to the temporary directory do not elevate the link
73 * entries are replayed to the temporary directory. An atomic mapping exchange
74 * is used to commit the new directory blocks to the directory being repaired.
94 /* Directory entry to be restored in the new directory. */
124 /* Blobs containing directory entry names. */
135 * dotdot entry for this directory. For directory salvaging when
148 * Context information for attaching this directory to the lost+found
149 * if this directory does not have a parent.
159 /* Should we move this directory to the orphanage? */
162 /* Directory entry name, plus the trailing null. */
179 /* Set up for a directory repair. */
255 /* Try to find the parent of the directory being repaired. */
418 /* Don't mix metadata and regular directory trees. */ in xrep_dir_salvage_entry()
430 /* Record a shortform directory entry for later reinsertion. */
446 /* Record a regular directory entry for later reinsertion. */
461 /* Try to recover block/data format directory entries. */
508 /* Try to recover shortform directory entries. */
549 * Try to figure out the format of this directory from the data fork mappings
550 * and the directory size. If we can be reasonably sure of format, we can be
551 * more aggressive in salvaging directory entries. On return, @magic_guess
553 * directory; DIR3_DATA_MAGIC if we think this is a "data format" directory,
572 * If there's a single directory block and the directory size is in xrep_dir_guess_format()
573 * exactly one block, this has to be a single block format directory. in xrep_dir_guess_format()
583 * If the last extent before the leaf offset matches the directory in xrep_dir_guess_format()
584 * size and the directory size is larger than 1 block, this is a in xrep_dir_guess_format()
585 * data format directory. in xrep_dir_guess_format()
597 /* Recover directory entries from a specific directory block. */
634 * If we couldn't guess what type of directory this is, then we will in xrep_dir_recover_dirblock()
635 * only salvage entries from directory blocks that match the magic in xrep_dir_recover_dirblock()
686 /* Replay a stashed createname into the temporary directory. */
713 /* Replay a stashed removename onto the temporary directory. */
733 * Add this stashed incore directory entry to the temporary directory.
755 /* Lock the temporary directory and join it to the transaction */ in xrep_dir_replay_update()
762 * Create a replacement dirent in the temporary directory. in xrep_dir_replay_update()
786 * Remove a dirent from the temporary directory. Note that in xrep_dir_replay_update()
833 * This is done to reduce the memory requirements of the directory rebuild,
834 * since directories can contain up to 32GB of directory data.
846 /* Add all the salvaged dirents to the temporary directory. */ in xrep_dir_replay_updates()
879 * Periodically flush stashed directory entries to the temporary dir. This
880 * is done to reduce the memory requirements of the directory rebuild, since
881 * directories can contain up to 32GB of directory data.
893 * are cycles in the directory structures. We hold ILOCK_EXCL on both in xrep_dir_flush_stashed()
899 * directory in preparation for exchanging the directory structures at in xrep_dir_flush_stashed()
905 * prevents anyone from accessing the damaged directory data while we in xrep_dir_flush_stashed()
950 /* Extract as many directory entries as we can. */
966 /* Iterate each directory data block in the data fork. */ in xrep_dir_recover()
1004 * Find all the directory entries for this inode by scraping them out of the
1005 * directory leaf blocks by hand, and flushing them into the temp dir.
1015 * Salvage directory entries from the old directory, and write them to in xrep_dir_find_entries()
1016 * the temporary directory. in xrep_dir_find_entries()
1042 * Drop the ILOCK on this directory so that we can scan for this in xrep_dir_salvage_entries()
1043 * directory's parent. Figure out who is going to be the parent of in xrep_dir_salvage_entries()
1044 * this directory, then retake the ILOCK so that we can salvage in xrep_dir_salvage_entries()
1045 * directory entries. in xrep_dir_salvage_entries()
1054 * Collect directory entries by parsing raw leaf blocks to salvage in xrep_dir_salvage_entries()
1067 * We still hold IOLOCK_EXCL (aka i_rwsem) which will prevent directory in xrep_dir_salvage_entries()
1069 * the directory until we're ready for the exchange operation. Reads in xrep_dir_salvage_entries()
1087 * Examine a parent pointer of a file. If it leads us back to the directory
1135 * If this child dirent points to the directory being repaired, remember that
1149 /* Dirent doesn't point to this directory. */ in xrep_dir_scan_dirent()
1188 * Select ILOCK_EXCL if the file is a directory with an unloaded data bmbt or
1217 * the directory we're rebuilding.
1247 * If the directory looks as though it has been zapped by the in xrep_dir_scan_file()
1278 /* Roots of directory trees are their own parents. */ in xrep_dir_scan_dirtree()
1283 * Filesystem scans are time consuming. Drop the directory ILOCK and in xrep_dir_scan_dirtree()
1343 * directory. in xrep_dir_scan_dirtree()
1351 * directory being repaired.
1368 * This thread updated a child dirent in the directory that we're in xrep_dir_live_update()
1370 * directory. in xrep_dir_live_update()
1387 * This thread updated another directory's child dirent that points to in xrep_dir_live_update()
1388 * the directory that we're rebuilding, so remember the new dotdot in xrep_dir_live_update()
1415 * Free all the directory blocks and reset the data fork. The caller must
1428 /* Unmap all the directory buffers. */ in xrep_dir_reset_fork()
1442 /* Reinitialize the short form directory. */ in xrep_dir_reset_fork()
1448 * Prepare both inodes' directory forks for exchanging mappings. Promote the
1461 * If the tempfile's directory is in shortform format, convert that to in xrep_dir_swap_prep()
1511 * Replace the inode number of a directory entry.
1537 * Reset the link count of this directory and adjust the unlinked list pointers
1553 * The directory is not on the incore unlinked list, which means that in xrep_dir_set_nlink()
1554 * it needs to be reachable via the directory tree. Update the nlink in xrep_dir_set_nlink()
1555 * with our observed link count. If the directory has no parent, it in xrep_dir_set_nlink()
1562 * The directory is on the unlinked list and we did not find any in xrep_dir_set_nlink()
1563 * dirents. Set the link count to zero and let the directory in xrep_dir_set_nlink()
1573 * The directory is on the unlinked list and we found dirents. This in xrep_dir_set_nlink()
1574 * directory needs to be reachable via the directory tree. Remove the in xrep_dir_set_nlink()
1576 * count. If the directory has no parent, it will be moved to the in xrep_dir_set_nlink()
1599 * before we commit the new directory structure.
1635 /* Exchange the temporary directory's data fork with the one being repaired. */
1646 * If we never found the parent for this directory, temporarily assign in xrep_dir_swap()
1658 * Reset the temporary directory's '..' entry to point to the parent in xrep_dir_swap()
1678 * the directory, so we recompute these. in xrep_dir_swap()
1685 * directory data would fit in the repaired file's data fork, copy in xrep_dir_swap()
1686 * the contents from the tempfile and update the directory link count. in xrep_dir_swap()
1697 * directory contents. in xrep_dir_swap()
1709 * Set nlink of the directory in the same transaction sequence that in xrep_dir_swap()
1710 * (atomically) commits the new directory data. in xrep_dir_swap()
1720 * Exchange the new directory contents (which we created in the tempfile) with
1721 * the directory being repaired.
1763 * Release the old directory blocks and reset the data fork of the temp in xrep_dir_rebuild_tree()
1764 * directory to an empty shortform directory because inactivation does in xrep_dir_rebuild_tree()
1774 * the scrub target directory. in xrep_dir_rebuild_tree()
1785 /* Set up the filesystem scan so we can regenerate directory entries. */
1795 descr = xchk_xfile_ino_descr(sc, "directory entries"); in xrep_dir_setup_scan()
1802 descr = xchk_xfile_ino_descr(sc, "directory entry names"); in xrep_dir_setup_scan()
1882 * the child directory was unlocked, we don't need to move the child to in xrep_dir_move_to_orphanage()
1890 * Attach to the orphanage if we still have a linked directory and it in xrep_dir_move_to_orphanage()
1913 * Repair the directory metadata.
1915 * XXX: Directory entry buffers can be multiple fsblocks in size. The buffer
1917 * misbehave if the directory blocks are crosslinked with other filesystem
1920 * XXX: Is it necessary to check the dcache for this directory to make sure