/* This exists for btrfs-progs usages. */
u16 btrfs_csum_type_size(u16 type)
{ return btrfs_csums[type].size;
}
int btrfs_super_csum_size(conststruct btrfs_super_block *s)
{
u16 t = btrfs_super_csum_type(s);
/* csum type is validated at mount time. */ return btrfs_csum_type_size(t);
}
constchar *btrfs_super_csum_name(u16 csum_type)
{ /* csum type is validated at mount time. */ return btrfs_csums[csum_type].name;
}
/* * Return driver name if defined, otherwise the name that's also a valid driver * name.
*/ constchar *btrfs_super_csum_driver(u16 csum_type)
{ /* csum type is validated at mount time */ return btrfs_csums[csum_type].driver[0] ?
btrfs_csums[csum_type].driver :
btrfs_csums[csum_type].name;
}
spin_lock(&fs_info->super_lock); if (fs_info->exclusive_operation == BTRFS_EXCLOP_NONE) {
fs_info->exclusive_operation = type;
ret = true;
}
spin_unlock(&fs_info->super_lock);
return ret;
}
/* * Conditionally allow to enter the exclusive operation in case it's compatible * with the running one. This must be paired with btrfs_exclop_start_unlock() * and btrfs_exclop_finish(). * * Compatibility: * - the same type is already running * - when trying to add a device and balance has been paused * - not BTRFS_EXCLOP_NONE - this is intentionally incompatible and the caller * must check the condition first that would allow none -> @type
*/ bool btrfs_exclop_start_try_lock(struct btrfs_fs_info *fs_info, enum btrfs_exclusive_operation type)
{
spin_lock(&fs_info->super_lock); if (fs_info->exclusive_operation == type ||
(fs_info->exclusive_operation == BTRFS_EXCLOP_BALANCE_PAUSED &&
type == BTRFS_EXCLOP_DEV_ADD)) returntrue;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.