Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mount_setattr #1002

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yujincheng08
Copy link
Contributor

@yujincheng08 yujincheng08 commented Jan 24, 2024

Preliminary implementation of mount_setattr.

A few notes:

  1. I leave the size non-exported. Should we export this?
  2. I intentionally place mount_setattr in misc.rs because I am going to add statmount and listmount syscall once 6.8 releases and libc adds the syscall number.
  3. CI test requires android: add missing syscall constants rust-lang/libc#3558

Fix #975

@yujincheng08 yujincheng08 force-pushed the mount_setattr branch 3 times, most recently from 396991e to 78c5696 Compare January 24, 2024 05:26
#[derive(Debug, Copy, Clone)]
#[allow(missing_docs)]
pub struct MountAttr<'a> {
pub attr_set: MountAttrFlags,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to Linux's documentation, attr_set is a __u64, while MountAttrFlags is currently a c_uint. Could you add a test testing that the layout matches, following one of the "layouts" tests in the tree?

use crate::fs::AtFlags;
use crate::{backend, io, path};

/// `mount_setattr(dir_fd, path, flags, mount_attr)`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there is no mount_setattr declaration exposed in C, could you change this comment to syscall(SYS_mount_setattr, ...)?

@sunfishcode
Copy link
Member

I leave the size non-exported. Should we export this?

If you don't have a need for it at this time, then we don't need to. If someone later has a need for it, we can add another function that exposes it.

@yujincheng08 yujincheng08 marked this pull request as draft April 14, 2024 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add mount_setattr
2 participants