• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/fs/btrfs/

Lines Matching defs:log

27 #include "tree-log.h"
31 * LOG_INODE_ALL means to log everything
32 * LOG_INODE_EXISTS means to log just enough to recreate the inode
33 * during log replay
42 * log, we must force a full commit before doing an fsync of the directory
56 * 2) we must log any new names for any file or dir that is in the fsync
57 * log. ---> check inode while renaming/linking.
59 * 2a) we must log any new names for any file or dir during rename
85 * we find in the log are created in the subvolume.
102 struct btrfs_root *log,
107 * tree logging is a special write ahead log used to make sure that
120 * After a crash, items are copied out of the log-tree back into the
122 * allocation tree, and the log-tree freed.
124 * The log tree is read three times, once to pin down all the extents it is
130 * start a sub transaction and setup the log tree
131 * this increments the log tree writer count to make the people
175 * returns 0 if there was a log transaction running and we were able
197 * This either makes the current running log transaction wait
199 * log transactions wait until you call btrfs_end_log_trans()
212 * indicate we're done making changes to the log tree
228 * processing the log tree. The stage field tells us which part
229 * of the log tree processing we are currently doing. The others
234 * at transaction commit time while freeing a log tree
239 * while flushing the log tree to disk during a sync
244 * while flushing the log tree to disk for a sync
249 * log trees
267 int (*process_func)(struct btrfs_root *log, struct extent_buffer *eb,
274 static int process_one_buffer(struct btrfs_root *log,
279 btrfs_pin_extent(log->fs_info->extent_root,
392 * log replay inserts and removes directory items based on the
441 * This can only be called for subvolume roots and not for the log
466 * extents in the log tree have not been allocated out of the extent
644 * subvolume, directory names in the log and directory names in the
723 * helper function to check a log tree for a named back reference in
725 * found in the subvolume conflicts with what we find in the log.
730 * link is also in the log.
732 static noinline int backref_in_log(struct btrfs_root *log,
747 ret = btrfs_search_slot(NULL, log, key, path, 0, 0);
775 * replay one inode back reference item found in the log tree.
776 * eb, slot and key refer to the buffer and key found in the log tree.
782 struct btrfs_root *log,
803 * it is possible that we didn't log all the parent directories
858 * if they are in the log. if so, we allow them to stay
874 if (!backref_in_log(log, key, victim_name,
951 * lots of complexity to the log code, we just scan the backrefs
1118 * when replaying the log for a directory, we only insert names
1151 * take a single entry in a log directory item and replay it into
1158 * If a name from the log points to a file or directory that does
1287 * items in the log copied from the subvolume, and range items
1288 * created in the log while the subvolume was logged.
1290 * The range items tell us which parts of the key space the log
1292 * directory is in a logged range item, but not actually in the log
1369 * this looks for a given directory item in the log. If the directory
1370 * item is not in the log, the item is removed and the inode it points
1375 struct btrfs_root *log,
1411 if (log && dir_key->type == BTRFS_DIR_ITEM_KEY) {
1412 log_di = btrfs_lookup_dir_item(trans, log, log_path,
1415 } else if (log && dir_key->type == BTRFS_DIR_INDEX_KEY) {
1416 log_di = btrfs_lookup_dir_index_item(trans, log,
1425 btrfs_release_path(log, log_path);
1449 btrfs_release_path(log, log_path);
1458 btrfs_release_path(log, log_path);
1464 * out of the log or out of backreferences from inodes. It
1465 * scans the log to find ranges of keys that log is authoritative for,
1467 * not present in the log.
1469 * Anything we don't find in the log is unlinked and removed from the
1474 struct btrfs_root *log,
1496 * from the log
1509 ret = find_dir_range(log, path, dirid, key_type,
1538 ret = check_item_in_log(trans, root, log, path,
1568 * the process_func used to replay items from the log tree. This
1572 * The second stage copies all the other item types from the log into
1575 * only in the log (references come from either directory items or inode
1578 static int replay_one_buffer(struct btrfs_root *log, struct extent_buffer *eb,
1616 root, log, path, key.objectid, 0);
1646 ret = add_inode_ref(wc->trans, root, log, path,
1807 struct btrfs_root *log, struct walk_control *wc)
1819 level = btrfs_header_level(log->node);
1821 path->nodes[level] = log->node;
1822 extent_buffer_get(log->node);
1826 wret = walk_down_log_tree(trans, log, path, &level, wc);
1832 wret = walk_up_log_tree(trans, log, path, &level, wc);
1841 wc->process_func(log, path->nodes[orig_level], wc,
1849 clean_tree_block(trans, log, next);
1854 WARN_ON(log->root_key.objectid !=
1856 ret = btrfs_free_reserved_extent(log, next->start,
1873 * helper function to update the item for a given subvolumes log root
1874 * in the tree of log roots
1877 struct btrfs_root *log)
1881 if (log->log_transid == 1) {
1883 ret = btrfs_insert_root(trans, log->fs_info->log_root_tree,
1884 &log->root_key, &log->root_item);
1886 ret = btrfs_update_root(trans, log->fs_info->log_root_tree,
1887 &log->root_key, &log->root_item);
1899 * we only allow two pending log transactions at a time,
1938 * btrfs_sync_log does sends a given tree log down to the disk and
1956 struct btrfs_root *log = root->log_root;
1969 /* wait for previous tree log sync to complete */
2001 ret = btrfs_write_marked_extents(log, &log->dirty_log_pages, mark);
2004 btrfs_set_root_node(&log->root_item, log->node);
2008 log->log_transid = root->log_transid;
2012 * IO has been started, blocks of the log tree have WRITTEN flag set
2013 * in their headers. new modifications of the log will be written to
2014 * new positions. so it's safe to allow log writers to go in.
2023 ret = update_log_root(trans, log);
2035 btrfs_wait_marked_extents(log, &log->dirty_log_pages, mark);
2043 btrfs_wait_marked_extents(log, &log->dirty_log_pages, mark);
2059 * now that we've moved on to the tree of log tree roots,
2063 btrfs_wait_marked_extents(log, &log->dirty_log_pages, mark);
2073 btrfs_wait_marked_extents(log, &log->dirty_log_pages, mark);
2115 struct btrfs_root *log)
2125 ret = walk_log_tree(trans, log, &wc);
2129 ret = find_first_extent_bit(&log->dirty_log_pages,
2134 clear_extent_bits(&log->dirty_log_pages, start, end,
2138 free_extent_buffer(log->node);
2139 kfree(log);
2143 * free all the extents used by the tree log. This should be called
2176 * didn't get fsync'd again so the log has back refs for X and X.link.
2179 * log when a file that was logged in the current transaction is
2180 * unlinked. Any later fsync will include the updated log entries, and
2191 struct btrfs_root *log;
2207 log = root->log_root;
2209 di = btrfs_lookup_dir_item(trans, log, path, dir->i_ino,
2216 ret = btrfs_delete_one_dir_name(trans, log, path, di);
2220 btrfs_release_path(log, path);
2221 di = btrfs_lookup_dir_index_item(trans, log, path, dir->i_ino,
2228 ret = btrfs_delete_one_dir_name(trans, log, path, di);
2233 /* update the directory size in the log to reflect the names
2242 btrfs_release_path(log, path);
2244 ret = btrfs_search_slot(trans, log, &key, path, 0, 1);
2264 btrfs_release_path(log, path);
2284 struct btrfs_root *log;
2294 log = root->log_root;
2297 ret = btrfs_del_inode_ref(trans, log, name, name_len, inode->i_ino,
2310 * creates a range item in the log for 'dirid'. first_offset and
2311 * last_offset tell us which parts of the key space the log should
2315 struct btrfs_root *log,
2330 ret = btrfs_insert_empty_item(trans, log, path, &key, sizeof(*item));
2338 btrfs_release_path(log, path);
2343 * log all the items included in the current transaction for a given
2344 * directory. This also creates the range items in the log tree required
2355 struct btrfs_root *log = root->log_root;
2364 log = root->log_root;
2417 ret = overwrite_item(trans, log, dst_path,
2436 * we have a block from this transaction, log every item in it
2449 ret = overwrite_item(trans, log, dst_path, src, i,
2473 ret = overwrite_item(trans, log, dst_path,
2485 btrfs_release_path(log, dst_path);
2490 * insert the log range keys to indicate where the log
2493 ret = insert_dir_log_key(trans, log, path, key_type,
2504 * from the current transaction and write them to the log.
2507 * key in the range logged that is not present in the log tree, then it means
2546 * a helper function to drop items from the log before we relog an
2552 struct btrfs_root *log,
2565 ret = btrfs_search_slot(trans, log, &key, path, -1, 1);
2580 ret = btrfs_del_item(trans, log, path);
2582 btrfs_release_path(log, path);
2584 btrfs_release_path(log, path);
2589 struct btrfs_root *log,
2616 ret = btrfs_insert_empty_items(trans, log, dst_path,
2678 log->fs_info->csum_root,
2687 btrfs_release_path(log, dst_path);
2692 * log tree while trying to change the log tree.
2700 ret = btrfs_csum_file_blocks(trans, log, sums);
2707 /* log a single inode in the tree log.
2712 * to the log tree. An extra reference is taken on any extents in this
2729 struct btrfs_root *log = root->log_root;
2738 log = root->log_root;
2770 ret = drop_objectid_items(trans, log, path,
2773 ret = btrfs_truncate_inode_items(trans, log, inode, 0, 0);
2805 ret = copy_items(trans, log, dst_path, src, ins_start_slot,
2823 ret = copy_items(trans, log, dst_path, src,
2844 ret = copy_items(trans, log, dst_path, src,
2856 btrfs_release_path(log, dst_path);
2912 * make sure any commits to the log are forced
2952 * parent directories also end up in the log. A minimal inode and backref
3048 * it is not safe to log dentry if the chunk root has added new
3061 * should be called during mount to recover any replay any log trees
3072 struct btrfs_root *log;
3110 log = btrfs_read_fs_root_no_radix(log_root_tree,
3112 BUG_ON(!log);
3122 wc.replay_dest->log_root = log;
3124 ret = walk_log_tree(trans, log, &wc);
3135 free_extent_buffer(log->node);
3136 free_extent_buffer(log->commit_root);
3137 kfree(log);
3186 * to log its parents.
3190 * don't log the parents if the file is fully on disk.
3205 * the log will be properly updated for any new names
3229 * update the log to reflect the new name.
3249 * from hasn't been logged, we don't need to log it