Skip to content

Commit 111a6bc

Browse files
committed
mount/linuc: add basic docstrings to public methods
1 parent ed0e859 commit 111a6bc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/mount/linux.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,18 @@ libc_bitflags!(
5050

5151
libc_bitflags!(
5252
pub struct MntFlags: c_int {
53+
/// Abort pending requests before attempting the unmount
5354
MNT_FORCE;
55+
/// Perform a lazy unmount
5456
MNT_DETACH;
57+
/// Mark the mount as expired
5558
MNT_EXPIRE;
59+
/// Do not dereference unmount path target if it is a symbolic link
5660
UMOUNT_NOFOLLOW;
5761
}
5862
);
5963

64+
/// Mount a filesystem.
6065
pub fn mount<
6166
P1: ?Sized + NixPath,
6267
P2: ?Sized + NixPath,
@@ -99,13 +104,15 @@ pub fn mount<
99104
Errno::result(res).map(drop)
100105
}
101106

107+
/// Unmount the filesystem mounted at `target`.
102108
pub fn umount<P: ?Sized + NixPath>(target: &P) -> Result<()> {
103109
let res =
104110
target.with_nix_path(|cstr| unsafe { libc::umount(cstr.as_ptr()) })?;
105111

106112
Errno::result(res).map(drop)
107113
}
108114

115+
/// Unmount the filesystem mounted at `target`, using `flags` to control the behavior of the operation.
109116
pub fn umount2<P: ?Sized + NixPath>(target: &P, flags: MntFlags) -> Result<()> {
110117
let res = target.with_nix_path(|cstr| unsafe {
111118
libc::umount2(cstr.as_ptr(), flags.bits)

0 commit comments

Comments
 (0)