Message type for VFS_{,F}STATVFS1
Change-Id: Iaf71cdddb48f64d84773029da2c0666f5462f198
This commit is contained in:
parent
ccdf11c7cf
commit
ad7e3e56c8
5 changed files with 26 additions and 21 deletions
|
@ -232,13 +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 statvfs1(2) and fstatvfs1(2) calls. */
|
|
||||||
#define VFS_STATVFS1_LEN m1_i1 /* size_t */
|
|
||||||
#define VFS_STATVFS1_NAME m1_p1 /* const char * */
|
|
||||||
#define VFS_STATVFS1_FD m1_i1 /* int */
|
|
||||||
#define VFS_STATVFS1_BUF m1_p2 /* struct statvfs * */
|
|
||||||
#define VFS_STATVFS1_FLAGS m1_i2 /* int */
|
|
||||||
|
|
||||||
/* Field names for the mount(2) call. */
|
/* Field names for the mount(2) call. */
|
||||||
#define VFS_MOUNT_FLAGS m11_i1 /* int */
|
#define VFS_MOUNT_FLAGS m11_i1 /* int */
|
||||||
#define VFS_MOUNT_DEVLEN m11_s1 /* size_t */
|
#define VFS_MOUNT_DEVLEN m11_s1 /* size_t */
|
||||||
|
|
|
@ -166,6 +166,17 @@ typedef struct {
|
||||||
} mess_lc_vfs_select;
|
} mess_lc_vfs_select;
|
||||||
_ASSERT_MSG_SIZE(mess_lc_vfs_select);
|
_ASSERT_MSG_SIZE(mess_lc_vfs_select);
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
int fd;
|
||||||
|
int flags;
|
||||||
|
size_t len;
|
||||||
|
vir_bytes name;
|
||||||
|
vir_bytes buf;
|
||||||
|
|
||||||
|
uint8_t padding[36];
|
||||||
|
} mess_lc_vfs_statvfs1;
|
||||||
|
_ASSERT_MSG_SIZE(mess_lc_vfs_statvfs1);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
dev_t device;
|
dev_t device;
|
||||||
off_t seek_pos;
|
off_t seek_pos;
|
||||||
|
@ -619,6 +630,7 @@ typedef struct {
|
||||||
|
|
||||||
mess_lc_vfs_getvfsstat m_lc_vfs_getvfsstat;
|
mess_lc_vfs_getvfsstat m_lc_vfs_getvfsstat;
|
||||||
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_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;
|
||||||
|
|
|
@ -14,9 +14,9 @@ int fstatvfs1(int fd, struct statvfs *buffer, int flags)
|
||||||
message m;
|
message m;
|
||||||
|
|
||||||
memset(&m, 0, sizeof(m));
|
memset(&m, 0, sizeof(m));
|
||||||
m.VFS_STATVFS1_FD = fd;
|
m.m_lc_vfs_statvfs1.fd = fd;
|
||||||
m.VFS_STATVFS1_BUF = (char *) buffer;
|
m.m_lc_vfs_statvfs1.buf = (vir_bytes)buffer;
|
||||||
m.VFS_STATVFS1_FLAGS = flags;
|
m.m_lc_vfs_statvfs1.flags = flags;
|
||||||
return(_syscall(VFS_PROC_NR, VFS_FSTATVFS1, &m));
|
return(_syscall(VFS_PROC_NR, VFS_FSTATVFS1, &m));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,10 +15,10 @@ int statvfs1(const char *name, struct statvfs *buffer, int flags)
|
||||||
message m;
|
message m;
|
||||||
|
|
||||||
memset(&m, 0, sizeof(m));
|
memset(&m, 0, sizeof(m));
|
||||||
m.VFS_STATVFS1_LEN = strlen(name) + 1;
|
m.m_lc_vfs_statvfs1.len = strlen(name) + 1;
|
||||||
m.VFS_STATVFS1_NAME = (char *) __UNCONST(name);
|
m.m_lc_vfs_statvfs1.name = (vir_bytes)name;
|
||||||
m.VFS_STATVFS1_BUF = (char *) buffer;
|
m.m_lc_vfs_statvfs1.buf = (vir_bytes)buffer;
|
||||||
m.VFS_STATVFS1_FLAGS = flags;
|
m.m_lc_vfs_statvfs1.flags = flags;
|
||||||
return(_syscall(VFS_PROC_NR, VFS_STATVFS1, &m));
|
return(_syscall(VFS_PROC_NR, VFS_STATVFS1, &m));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -302,10 +302,10 @@ int do_statvfs(void)
|
||||||
vir_bytes vname1, statbuf;
|
vir_bytes vname1, statbuf;
|
||||||
size_t vname1_length;
|
size_t vname1_length;
|
||||||
|
|
||||||
vname1 = (vir_bytes) job_m_in.VFS_STATVFS1_NAME;
|
vname1 = job_m_in.m_lc_vfs_statvfs1.name;
|
||||||
vname1_length = (size_t) job_m_in.VFS_STATVFS1_LEN;
|
vname1_length = job_m_in.m_lc_vfs_statvfs1.len;
|
||||||
statbuf = (vir_bytes) job_m_in.VFS_STATVFS1_BUF;
|
statbuf = job_m_in.m_lc_vfs_statvfs1.buf;
|
||||||
flags = job_m_in.VFS_STATVFS1_FLAGS;
|
flags = job_m_in.m_lc_vfs_statvfs1.flags;
|
||||||
|
|
||||||
lookup_init(&resolve, fullpath, PATH_NOFLAGS, &vmp, &vp);
|
lookup_init(&resolve, fullpath, PATH_NOFLAGS, &vmp, &vp);
|
||||||
resolve.l_vmnt_lock = VMNT_READ;
|
resolve.l_vmnt_lock = VMNT_READ;
|
||||||
|
@ -332,9 +332,9 @@ int do_fstatvfs(void)
|
||||||
int r, rfd, flags;
|
int r, rfd, flags;
|
||||||
vir_bytes statbuf;
|
vir_bytes statbuf;
|
||||||
|
|
||||||
rfd = job_m_in.VFS_STATVFS1_FD;
|
rfd = job_m_in.m_lc_vfs_statvfs1.fd;
|
||||||
statbuf = (vir_bytes) job_m_in.VFS_STATVFS1_BUF;
|
statbuf = job_m_in.m_lc_vfs_statvfs1.buf;
|
||||||
flags = job_m_in.VFS_STATVFS1_FLAGS;
|
flags = job_m_in.m_lc_vfs_statvfs1.flags;
|
||||||
|
|
||||||
/* Is the file descriptor valid? */
|
/* Is the file descriptor valid? */
|
||||||
if ((rfilp = get_filp(rfd, VNODE_READ)) == NULL) return(err_code);
|
if ((rfilp = get_filp(rfd, VNODE_READ)) == NULL) return(err_code);
|
||||||
|
|
Loading…
Reference in a new issue