Skip to main content

BalanceArgs

Struct BalanceArgs 

Source
pub struct BalanceArgs { /* private fields */ }
Expand description

Per-type filter arguments for a balance operation, corresponding to btrfs_balance_args.

Construct one with BalanceArgs::new and chain the setter methods to enable filters. Each setter automatically sets the corresponding flag bit.

Implementations§

Source§

impl BalanceArgs

Source

pub fn new() -> Self

Create a new BalanceArgs with no filters enabled.

Source

pub fn profiles(self, profiles: u64) -> Self

Filter by chunk profile bitmask. The value is a bitmask of BTRFS_BLOCK_GROUP_* profile flags.

Source

pub fn usage(self, percent: u64) -> Self

Filter chunks whose usage is below percent (0..100).

Source

pub fn usage_range(self, min: u32, max: u32) -> Self

Filter chunks whose usage falls in min..=max percent.

Source

pub fn devid(self, devid: u64) -> Self

Filter chunks that reside on the given device ID.

Source

pub fn drange(self, start: u64, end: u64) -> Self

Filter chunks whose physical range on-disk overlaps start..end.

Source

pub fn vrange(self, start: u64, end: u64) -> Self

Filter chunks whose virtual address range overlaps start..end.

Source

pub fn limit(self, limit: u64) -> Self

Process at most limit chunks.

Source

pub fn limit_range(self, min: u32, max: u32) -> Self

Process between min and max chunks.

Source

pub fn stripes_range(self, min: u32, max: u32) -> Self

Filter chunks that span between min and max stripes.

Source

pub fn convert(self, profile: u64) -> Self

Convert balanced chunks to the given profile.

Source

pub fn soft(self) -> Self

When converting, skip chunks already on the target profile.

Trait Implementations§

Source§

impl Clone for BalanceArgs

Source§

fn clone(&self) -> BalanceArgs

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BalanceArgs

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BalanceArgs

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.