|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT PATCH 22/22] lib/vfscore: remove sys prefix from vfs api functions
Fucntions sys(mount|umount|umount2|sync) are complete function
calls. User applications should use them directly anyways. Let's
rename them accordingly.
Signed-off-by: Yuri Volchkov <yuri.volchkov@xxxxxxxxx>
---
lib/nolibc/include/unistd.h | 1 +
lib/vfscore/exportsyms.uk | 8 ++++----
lib/vfscore/mount.c | 14 ++++++--------
lib/vfscore/vfs.h | 5 +----
4 files changed, 12 insertions(+), 16 deletions(-)
diff --git a/lib/nolibc/include/unistd.h b/lib/nolibc/include/unistd.h
index 8013c181..a5d99fc4 100644
--- a/lib/nolibc/include/unistd.h
+++ b/lib/nolibc/include/unistd.h
@@ -51,6 +51,7 @@ extern "C" {
int close(int fd);
ssize_t write(int fd, const void *buf, size_t count);
ssize_t read(int fd, void *buf, size_t count);
+void sync(void);
int fsync(int fd);
int dup(int oldfd);
int dup2(int oldfd, int newfd);
diff --git a/lib/vfscore/exportsyms.uk b/lib/vfscore/exportsyms.uk
index 50b62204..adbc39a8 100644
--- a/lib/vfscore/exportsyms.uk
+++ b/lib/vfscore/exportsyms.uk
@@ -5,7 +5,7 @@ vfscore_get_file
close
write
read
-sys_mount
+mount
vfscore_nullop
vfscore_release_mp_dentries
vfscore_vget
@@ -27,7 +27,7 @@ dup
dup2
dup3
vfscore_uiomove
-sys_sync
+sync
vfscore_mount_dump
-sys_umount
-sys_umount2
+umount
+umount2
diff --git a/lib/vfscore/mount.c b/lib/vfscore/mount.c
index fb18e04a..5354d92a 100644
--- a/lib/vfscore/mount.c
+++ b/lib/vfscore/mount.c
@@ -106,7 +106,7 @@ int device_close(struct device *dev)
}
int
-sys_mount(const char *dev, const char *dir, const char *fsname, int flags,
const void *data)
+mount(const char *dev, const char *dir, const char *fsname, int flags, const
void *data)
{
const struct vfscore_fs_type *fs;
struct mount *mp;
@@ -135,7 +135,7 @@ sys_mount(const char *dev, const char *dir, const char
*fsname, int flags, const
// We need to avoid the situation where after we already verified that
// the mount point is free, but before we actually add it to mount_list,
// another concurrent mount adds it. So we use a new mutex to ensure
- // that only one sys_mount() runs at a time. We cannot reuse the
existing
+ // that only one mount() runs at a time. We cannot reuse the existing
// mount_lock for this purpose: If we take mount_lock and then do
// lookups, this is lock order inversion and can result in deadlock.
@@ -251,7 +251,7 @@ vfscore_release_mp_dentries(struct mount *mp)
}
int
-sys_umount2(const char *path, int flags)
+umount2(const char *path, int flags)
{
struct mount *mp, *tmp;
int error, pathlen;
@@ -304,9 +304,9 @@ found:
}
int
-sys_umount(const char *path)
+umount(const char *path)
{
- return sys_umount2(path, 0);
+ return umount2(path, 0);
}
#if 0
@@ -359,8 +359,7 @@ sys_pivot_root(const char *new_root, const char *put_old)
}
#endif
-int
-sys_sync(void)
+void sync(void)
{
struct mount *mp;
uk_mutex_lock(&mount_lock);
@@ -372,7 +371,6 @@ sys_sync(void)
#ifdef HAVE_BUFFERS
bio_sync();
#endif
- return 0;
}
/*
diff --git a/lib/vfscore/vfs.h b/lib/vfscore/vfs.h
index 246bf8ec..43e1c044 100644
--- a/lib/vfscore/vfs.h
+++ b/lib/vfscore/vfs.h
@@ -108,11 +108,8 @@ int sys_utimensat(int dirfd, const char *pathname,
int sys_futimens(int fd, const struct timespec times[2]);
int sys_fallocate(struct vfscore_file *fp, int mode, loff_t offset, loff_t
len);
-int sys_mount(const char *dev, const char *dir, const char *fsname, int
flags, const void *data);
-int sys_umount2(const char *path, int flags);
-int sys_umount(const char *path);
int sys_pivot_root(const char *new_root, const char *old_put);
-int sys_sync(void);
+void sync(void);
int sys_chmod(const char *path, mode_t mode);
int sys_fchmod(int fd, mode_t mode);
--
2.19.2
_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |