Message type for VFS_UMOUNT

Change-Id: Ia3b8e818b45a31178215cad77fa0fa3e5325f18a
This commit is contained in:
Lionel Sambuc 2014-05-12 12:44:59 +02:00
parent ecc9010c4b
commit a16ccbaaf8
4 changed files with 19 additions and 14 deletions

View file

@ -232,12 +232,6 @@
#define NR_VFS_CALLS 49 /* highest number from base plus one */ #define NR_VFS_CALLS 49 /* highest number from base plus one */
/* Field names for the umount(2) call. */
#define VFS_UMOUNT_NAME m1_p1 /* char * */
#define VFS_UMOUNT_NAMELEN m1_i1 /* size_t */
#define VFS_UMOUNT_LABEL m1_p2 /* char * */
#define VFS_UMOUNT_LABELLEN m1_i2 /* size_t */
/* Field names for the ioctl(2) call. */ /* Field names for the ioctl(2) call. */
#define VFS_IOCTL_FD m2_i1 /* int */ #define VFS_IOCTL_FD m2_i1 /* int */
#define VFS_IOCTL_REQ m2_i3 /* unsigned long */ #define VFS_IOCTL_REQ m2_i3 /* unsigned long */

View file

@ -192,6 +192,16 @@ typedef struct {
} mess_lc_vfs_statvfs1; } mess_lc_vfs_statvfs1;
_ASSERT_MSG_SIZE(mess_lc_vfs_statvfs1); _ASSERT_MSG_SIZE(mess_lc_vfs_statvfs1);
typedef struct {
vir_bytes name;
size_t namelen;
vir_bytes label;
size_t labellen;
uint8_t padding[40];
} mess_lc_vfs_umount;
_ASSERT_MSG_SIZE(mess_lc_vfs_umount);
typedef struct { typedef struct {
dev_t device; dev_t device;
off_t seek_pos; off_t seek_pos;
@ -647,6 +657,7 @@ typedef struct {
mess_lc_vfs_mount m_lc_vfs_mount; mess_lc_vfs_mount m_lc_vfs_mount;
mess_lc_vfs_select m_lc_vfs_select; mess_lc_vfs_select m_lc_vfs_select;
mess_lc_vfs_statvfs1 m_lc_vfs_statvfs1; mess_lc_vfs_statvfs1 m_lc_vfs_statvfs1;
mess_lc_vfs_umount m_lc_vfs_umount;
mess_vfs_fs_breadwrite m_vfs_fs_breadwrite; mess_vfs_fs_breadwrite m_vfs_fs_breadwrite;
mess_vfs_fs_chmod m_vfs_fs_chmod; mess_vfs_fs_chmod m_vfs_fs_chmod;

View file

@ -172,10 +172,10 @@ int minix_umount(const char *name, int srvflags)
int r; int r;
memset(&m, 0, sizeof(m)); memset(&m, 0, sizeof(m));
m.VFS_UMOUNT_NAME = __UNCONST(name); m.m_lc_vfs_umount.name = (vir_bytes)name;
m.VFS_UMOUNT_NAMELEN = strlen(name) + 1; m.m_lc_vfs_umount.namelen = strlen(name) + 1;
m.VFS_UMOUNT_LABEL = label; m.m_lc_vfs_umount.label = (vir_bytes)label;
m.VFS_UMOUNT_LABELLEN = sizeof(label); m.m_lc_vfs_umount.labellen = sizeof(label);
r = _syscall(VFS_PROC_NR, VFS_UMOUNT, &m); r = _syscall(VFS_PROC_NR, VFS_UMOUNT, &m);
/* don't shut down the driver when exist flag is set */ /* don't shut down the driver when exist flag is set */

View file

@ -425,10 +425,10 @@ int do_umount(void)
vir_bytes vname, label_addr; vir_bytes vname, label_addr;
size_t vname_length, label_len; size_t vname_length, label_len;
vname = (vir_bytes) job_m_in.VFS_UMOUNT_NAME; vname = job_m_in.m_lc_vfs_umount.name;
vname_length = (size_t) job_m_in.VFS_UMOUNT_NAMELEN; vname_length = job_m_in.m_lc_vfs_umount.namelen;
label_addr = (vir_bytes) job_m_in.VFS_UMOUNT_LABEL; label_addr = job_m_in.m_lc_vfs_umount.label;
label_len = (size_t) job_m_in.VFS_UMOUNT_LABELLEN; label_len = job_m_in.m_lc_vfs_umount.labellen;
/* Only the super-user may do umount. */ /* Only the super-user may do umount. */
if (!super_user) return(EPERM); if (!super_user) return(EPERM);