Struct pmem_blk::blkpool::BlkPool [] [src]

pub struct BlkPool {
    // some fields omitted
}

Methods

impl BlkPool
[src]

Opens an existent memory pool with an unknown block size

Use block_size() to query the block size of the opened memory pool.

Opens an existent memory pool

If the blksize provided is non-zero, we will verify the given block size matches the block size used when the pool was created.

Creates a block memory pool with the given total poolsize divided up into as many elements of size blksize as will fit in the pool

Since the transactional nature of a block memory pool requires some space overhead in the memory pool, the resulting number of available blocks is less than poolsize / blksize.

You can query the total number of blocks with capacity().

Given the specifics of the implementation, the number of available blocks for the user cannot be less than 256. This translates to at least 512 internal blocks.

The block size for this pool

The capacity of the pool in number of blocks

Reads block number blockno from the memory pool into buf

Reading a block that has never been written will return a block of zeroes.

Writes a block from buf to block number blockno in the memory pool

The write is atomic with respect to other reads and writes. In addition, the write cannot be torn by program failure or system crash; on recovery the block is guaranteed to contain either the old data or the new data never a mixture of both.

Check consistency of the memory pool

Trait Implementations

impl Drop for BlkPool
[src]

A method called when the value goes out of scope. Read more