Skip to content

Commit

Permalink
Rename a flag in MountPropagationFlags. (#1169)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sunfishcode authored Sep 19, 2024
1 parent 22e9043 commit 4e29b83
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ the functions in the `rustix::thread::futex` module instead.
`rustix::process::waitpid`'s return type changed from `WaitStatus` to
`(Pid, WaitStatus)`, to additionally return the pid of the child.

The `SLAVE` flag in `rustix::mount::MountPropagationFlags` is renamed
to `DOWNSTREAM`.

The "cc" feature is removed. It hasn't had any effect for several
major releases.

Expand Down
12 changes: 10 additions & 2 deletions src/backend/libc/mount/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,16 @@ bitflags! {
const SHARED = c::MS_SHARED;
/// `MS_PRIVATE`
const PRIVATE = c::MS_PRIVATE;
/// `MS_SLAVE`
const SLAVE = c::MS_SLAVE;
/// Mark a mount as a downstream of its current peer group.
///
/// Mount and unmount events propagate from the upstream peer group
/// into the downstream.
///
/// In Linux documentation, this flag is named <code>MS_SLAVE</code>,
/// and the concepts of “upstream” and “downstream” are called
/// “master” and “slave”.
#[doc(alias = "SLAVE")]
const DOWNSTREAM = c::MS_SLAVE;
/// `MS_UNBINDABLE`
const UNBINDABLE = c::MS_UNBINDABLE;
/// `MS_REC`
Expand Down
12 changes: 10 additions & 2 deletions src/backend/linux_raw/mount/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,16 @@ bitflags! {
const SHARED = linux_raw_sys::general::MS_SHARED;
/// `MS_PRIVATE`
const PRIVATE = linux_raw_sys::general::MS_PRIVATE;
/// `MS_SLAVE`
const SLAVE = linux_raw_sys::general::MS_SLAVE;
/// Mark a mount as a downstream of its current peer group.
///
/// Mount and unmount events propagate from the upstream peer group
/// into the downstream.
///
/// In Linux documentation, this flag is named <code>MS_SLAVE</code>,
/// and the concepts of “upstream” and “downstream” are called
/// “master” and “slave”.
#[doc(alias = "SLAVE")]
const DOWNSTREAM = linux_raw_sys::general::MS_SLAVE;
/// `MS_UNBINDABLE`
const UNBINDABLE = linux_raw_sys::general::MS_UNBINDABLE;
/// `MS_REC`
Expand Down

0 comments on commit 4e29b83

Please sign in to comment.