static void init_commit_handle(struct commit_handle *ch, txn_atom *atom) { memset(ch, 0, sizeof(struct commit_handle)); INIT_LIST_HEAD(&ch->tx_list); ch->atom = atom; ch->super = reiser4_get_current_sb(); }
/** * grabbed2fake_allocated_unformatted * @count: * */ static void grabbed2fake_allocated_unformatted(int count) { reiser4_super_info_data *sbinfo; sbinfo = grabbed2fake_allocated_head(count); sbinfo->blocks_fake_allocated_unformatted += count; assert("vs-9221", reiser4_check_block_counters(reiser4_get_current_sb())); spin_unlock_reiser4_super(sbinfo); }
/* this used to be done through used2grabbed and grabbed2free*/ static void used2free(reiser4_super_info_data * sbinfo, __u64 count) { spin_lock_reiser4_super(sbinfo); sbinfo->blocks_free += count; sub_from_sb_used(sbinfo, count); assert("nikita-2685", reiser4_check_block_counters(reiser4_get_current_sb())); spin_unlock_reiser4_super(sbinfo); }
/* adjust sb block counters when @count unallocated blocks get mapped to disk */ static void fake_allocated2used(reiser4_super_info_data *sbinfo, __u64 count, reiser4_ba_flags_t flags) { spin_lock_reiser4_super(sbinfo); sub_from_sb_fake_allocated(sbinfo, count, flags); sbinfo->blocks_used += count; assert("nikita-2680", reiser4_check_block_counters(reiser4_get_current_sb())); spin_unlock_reiser4_super(sbinfo); }
/* adjust sb block counters when @count unallocated blocks get unmapped from disk */ static void used2fake_allocated(reiser4_super_info_data * sbinfo, __u64 count, int formatted) { spin_lock_reiser4_super(sbinfo); if (formatted) sbinfo->blocks_fake_allocated += count; else sbinfo->blocks_fake_allocated_unformatted += count; sub_from_sb_used(sbinfo, count); assert("nikita-2681", reiser4_check_block_counters(reiser4_get_current_sb())); spin_unlock_reiser4_super(sbinfo); }
static void used2flush_reserved(reiser4_super_info_data * sbinfo, txn_atom * atom, __u64 count, reiser4_ba_flags_t flags UNUSED_ARG) { assert("nikita-2791", atom != NULL); assert_spin_locked(&(atom->alock)); add_to_atom_flush_reserved_nolock(atom, (__u32) count); spin_lock_reiser4_super(sbinfo); sbinfo->blocks_flush_reserved += count; /*add_to_sb_flush_reserved(sbinfo, count); */ sub_from_sb_used(sbinfo, count); assert("nikita-2681", reiser4_check_block_counters(reiser4_get_current_sb())); spin_unlock_reiser4_super(sbinfo); }
static void flush_reserved2used(txn_atom * atom, __u64 count) { reiser4_super_info_data *sbinfo; assert("zam-787", atom != NULL); assert_spin_locked(&(atom->alock)); sub_from_atom_flush_reserved_nolock(atom, (__u32) count); sbinfo = get_current_super_private(); spin_lock_reiser4_super(sbinfo); sub_from_sb_flush_reserved(sbinfo, count); sbinfo->blocks_used += count; assert("zam-789", reiser4_check_block_counters(reiser4_get_current_sb())); spin_unlock_reiser4_super(sbinfo); }
int wbq_available(void) { struct super_block *sb = reiser4_get_current_sb(); entd_context *ent = get_entd_context(sb); return ent->nr_todo_reqs; }