Documentation ¶
Index ¶
Constants ¶
View Source
const (
PathNfsSeparator = ':'
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MountInfo ¶
type MountInfo struct { Source string `json:"source"` Target string `json:"target"` FsType string `json:"fstype"` Options string `json:"options"` }
func List ¶
List return matching dev and mnt list of MountInfo. findmnt exec is used to do initial filtering, then filter on mnt is used (for nfs) + custom filter on [dev] for bind mounts.
We can't use findmnt -J -T {mnt} -S {dev} for nfs because it may hang. A timeout version of findmnt is not sufficient, we have to differentiate hang but mounted from not mounted.
So when dev is on nfs, We can't use findmnt -J -T {mnt} -S {dev} Instead findmnt -J -S {dev} is used, then mnt is filtered within List function.
Click to show internal directories.
Click to hide internal directories.