Skip to content

Commit 4e29b83

Browse files
authored
Rename a flag in MountPropagationFlags. (#1169)
Rename `MountPropagationFlags`' `SLAVE` flag to `DOWNSTREAM`, to avoid propagating "master/slave" terminology. This differs from the Linux flag name and the terminology used in Linux's documentation, so add notes documenting the difference.
1 parent 22e9043 commit 4e29b83

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ the functions in the `rustix::thread::futex` module instead.
99
`rustix::process::waitpid`'s return type changed from `WaitStatus` to
1010
`(Pid, WaitStatus)`, to additionally return the pid of the child.
1111

12+
The `SLAVE` flag in `rustix::mount::MountPropagationFlags` is renamed
13+
to `DOWNSTREAM`.
14+
1215
The "cc" feature is removed. It hasn't had any effect for several
1316
major releases.
1417

src/backend/libc/mount/types.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,16 @@ bitflags! {
310310
const SHARED = c::MS_SHARED;
311311
/// `MS_PRIVATE`
312312
const PRIVATE = c::MS_PRIVATE;
313-
/// `MS_SLAVE`
314-
const SLAVE = c::MS_SLAVE;
313+
/// Mark a mount as a downstream of its current peer group.
314+
///
315+
/// Mount and unmount events propagate from the upstream peer group
316+
/// into the downstream.
317+
///
318+
/// In Linux documentation, this flag is named <code>MS_SLAVE</code>,
319+
/// and the concepts of “upstream” and “downstream” are called
320+
/// “master” and “slave”.
321+
#[doc(alias = "SLAVE")]
322+
const DOWNSTREAM = c::MS_SLAVE;
315323
/// `MS_UNBINDABLE`
316324
const UNBINDABLE = c::MS_UNBINDABLE;
317325
/// `MS_REC`

src/backend/linux_raw/mount/types.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,16 @@ bitflags! {
303303
const SHARED = linux_raw_sys::general::MS_SHARED;
304304
/// `MS_PRIVATE`
305305
const PRIVATE = linux_raw_sys::general::MS_PRIVATE;
306-
/// `MS_SLAVE`
307-
const SLAVE = linux_raw_sys::general::MS_SLAVE;
306+
/// Mark a mount as a downstream of its current peer group.
307+
///
308+
/// Mount and unmount events propagate from the upstream peer group
309+
/// into the downstream.
310+
///
311+
/// In Linux documentation, this flag is named <code>MS_SLAVE</code>,
312+
/// and the concepts of “upstream” and “downstream” are called
313+
/// “master” and “slave”.
314+
#[doc(alias = "SLAVE")]
315+
const DOWNSTREAM = linux_raw_sys::general::MS_SLAVE;
308316
/// `MS_UNBINDABLE`
309317
const UNBINDABLE = linux_raw_sys::general::MS_UNBINDABLE;
310318
/// `MS_REC`

0 commit comments

Comments
 (0)