package pmem

import "github.com/Microsoft/hcsshim/internal/guest/storage/pmem"

Index

Functions

func Mount

func Mount(ctx context.Context, device uint32, target string, mappingInfo *prot.DeviceMappingInfo, verityInfo *prot.DeviceVerityInfo, securityPolicy securitypolicy.SecurityPolicyEnforcer) (err error)

Mount mounts the pmem device at `/dev/pmem<device>` to `target` in a basic scenario. If either mappingInfo or verityInfo are non-nil, the device-mapper framework is used to create linear and verity targets accordingly. If both are non-nil, the linear target is created first and used as the data/hash device for the verity target.

`target` will be created. On mount failure the created `target` will be automatically cleaned up.

Note: For now the platform only supports readonly pmem that is assumed to be `ext4`.

Note: both mappingInfo and verityInfo can be non-nil at the same time, in that case linear target is created first and it becomes the data/hash device for verity target.

func Unmount

func Unmount(ctx context.Context, devNumber uint32, target string, mappingInfo *prot.DeviceMappingInfo, verityInfo *prot.DeviceVerityInfo, securityPolicy securitypolicy.SecurityPolicyEnforcer) (err error)

Unmount unmounts `target` and removes corresponding linear and verity targets when needed

Source Files

pmem.go

Version
v0.9.10
Published
Jul 20, 2023
Platform
linux/amd64
Imports
12 packages
Last checked
11 seconds ago

Tools for package owners.