Message type for VFS_MOUNT
Change-Id: I4114f5a1aa4f9efe49a12996722499b695c17230
This commit is contained in:
parent
ad7e3e56c8
commit
ecc9010c4b
4 changed files with 34 additions and 29 deletions
|
@ -232,17 +232,6 @@
|
|||
|
||||
#define NR_VFS_CALLS 49 /* highest number from base plus one */
|
||||
|
||||
/* Field names for the mount(2) call. */
|
||||
#define VFS_MOUNT_FLAGS m11_i1 /* int */
|
||||
#define VFS_MOUNT_DEVLEN m11_s1 /* size_t */
|
||||
#define VFS_MOUNT_PATHLEN m11_s2 /* size_t */
|
||||
#define VFS_MOUNT_TYPELEN m11_s3 /* size_t */
|
||||
#define VFS_MOUNT_LABELLEN m11_s4 /* size_t */
|
||||
#define VFS_MOUNT_DEV m11_p1 /* char * */
|
||||
#define VFS_MOUNT_PATH m11_p2 /* char * */
|
||||
#define VFS_MOUNT_TYPE m11_p3 /* char * */
|
||||
#define VFS_MOUNT_LABEL m11_p4 /* char * */
|
||||
|
||||
/* Field names for the umount(2) call. */
|
||||
#define VFS_UMOUNT_NAME m1_p1 /* char * */
|
||||
#define VFS_UMOUNT_NAMELEN m1_i1 /* size_t */
|
||||
|
|
|
@ -155,6 +155,21 @@ typedef struct {
|
|||
} mess_lc_vfs_getvfsstat;
|
||||
_ASSERT_MSG_SIZE(mess_lc_vfs_getvfsstat);
|
||||
|
||||
typedef struct {
|
||||
int flags;
|
||||
size_t devlen;
|
||||
size_t pathlen;
|
||||
size_t typelen;
|
||||
size_t labellen;
|
||||
vir_bytes dev;
|
||||
vir_bytes path;
|
||||
vir_bytes type;
|
||||
vir_bytes label;
|
||||
|
||||
uint8_t padding[20];
|
||||
} mess_lc_vfs_mount;
|
||||
_ASSERT_MSG_SIZE(mess_lc_vfs_mount);
|
||||
|
||||
typedef struct {
|
||||
uint32_t nfds;
|
||||
fd_set *readfds;
|
||||
|
@ -629,6 +644,7 @@ typedef struct {
|
|||
mess_fs_vfs_readwrite m_fs_vfs_readwrite;
|
||||
|
||||
mess_lc_vfs_getvfsstat m_lc_vfs_getvfsstat;
|
||||
mess_lc_vfs_mount m_lc_vfs_mount;
|
||||
mess_lc_vfs_select m_lc_vfs_select;
|
||||
mess_lc_vfs_statvfs1 m_lc_vfs_statvfs1;
|
||||
|
||||
|
|
|
@ -144,15 +144,15 @@ int minix_mount(char *special, char *name, int mountflags, int srvflags,
|
|||
|
||||
/* Now perform mount(). */
|
||||
memset(&m, 0, sizeof(m));
|
||||
m.VFS_MOUNT_FLAGS = mountflags;
|
||||
m.VFS_MOUNT_DEVLEN = special ? strlen(special) + 1 : 0;
|
||||
m.VFS_MOUNT_PATHLEN = strlen(name) + 1;
|
||||
m.VFS_MOUNT_TYPELEN = strlen(type) + 1;
|
||||
m.VFS_MOUNT_LABELLEN = strlen(label) + 1;
|
||||
m.VFS_MOUNT_DEV = special;
|
||||
m.VFS_MOUNT_PATH = name;
|
||||
m.VFS_MOUNT_TYPE = type;
|
||||
m.VFS_MOUNT_LABEL = label;
|
||||
m.m_lc_vfs_mount.flags = mountflags;
|
||||
m.m_lc_vfs_mount.devlen = special ? strlen(special) + 1 : 0;
|
||||
m.m_lc_vfs_mount.pathlen = strlen(name) + 1;
|
||||
m.m_lc_vfs_mount.typelen = strlen(type) + 1;
|
||||
m.m_lc_vfs_mount.labellen = strlen(label) + 1;
|
||||
m.m_lc_vfs_mount.dev = (vir_bytes)special;
|
||||
m.m_lc_vfs_mount.path = (vir_bytes)name;
|
||||
m.m_lc_vfs_mount.type = (vir_bytes)type;
|
||||
m.m_lc_vfs_mount.label = (vir_bytes)label;
|
||||
r = _syscall(VFS_PROC_NR, VFS_MOUNT, &m);
|
||||
|
||||
if (r != OK && !use_existing) {
|
||||
|
|
|
@ -93,15 +93,15 @@ int do_mount(void)
|
|||
vir_bytes label, type, vname1, vname2;
|
||||
size_t vname1_length, vname2_length, label_len, type_len;
|
||||
|
||||
mflags = job_m_in.VFS_MOUNT_FLAGS;
|
||||
label = (vir_bytes) job_m_in.VFS_MOUNT_LABEL;
|
||||
label_len = (size_t) job_m_in.VFS_MOUNT_LABELLEN;
|
||||
vname1 = (vir_bytes) job_m_in.VFS_MOUNT_DEV;
|
||||
vname1_length = (size_t) job_m_in.VFS_MOUNT_DEVLEN;
|
||||
vname2 = (vir_bytes) job_m_in.VFS_MOUNT_PATH;
|
||||
vname2_length = (size_t) job_m_in.VFS_MOUNT_PATHLEN;
|
||||
type = (vir_bytes) job_m_in.VFS_MOUNT_TYPE;
|
||||
type_len = (size_t) job_m_in.VFS_MOUNT_TYPELEN;
|
||||
mflags = job_m_in.m_lc_vfs_mount.flags;
|
||||
label = job_m_in.m_lc_vfs_mount.label;
|
||||
label_len = job_m_in.m_lc_vfs_mount.labellen;
|
||||
vname1 = job_m_in.m_lc_vfs_mount.dev;
|
||||
vname1_length = job_m_in.m_lc_vfs_mount.devlen;
|
||||
vname2 = job_m_in.m_lc_vfs_mount.path;
|
||||
vname2_length = job_m_in.m_lc_vfs_mount.pathlen;
|
||||
type = job_m_in.m_lc_vfs_mount.type;
|
||||
type_len = job_m_in.m_lc_vfs_mount.typelen;
|
||||
|
||||
/* Only the super-user may do MOUNT. */
|
||||
if (!super_user) return(EPERM);
|
||||
|
|
Loading…
Reference in a new issue