[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT PATCH v4 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> Reviewed-by: Simon Kuenzer <simon.kuenzer@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 e3c08a75..9881ab5b 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 5438a64c..10fed806 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,8 +27,8 @@ dup dup2 dup3 vfscore_uiomove -sys_sync +sync vfscore_mount_dump -sys_umount -sys_umount2 +umount +umount2 unlink diff --git a/lib/vfscore/mount.c b/lib/vfscore/mount.c index d67326d3..5d1af503 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. @@ -252,7 +252,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; @@ -305,9 +305,9 @@ found: } int -sys_umount(const char *path) +umount(const char *path) { - return sys_umount2(path, 0); + return umount2(path, 0); } #if 0 @@ -360,8 +360,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); @@ -374,7 +373,6 @@ sys_sync(void) bio_sync(); #endif uk_mutex_unlock(&mount_lock); - return 0; } /* diff --git a/lib/vfscore/vfs.h b/lib/vfscore/vfs.h index 4a1cfa9f..81a61d75 100644 --- a/lib/vfscore/vfs.h +++ b/lib/vfscore/vfs.h @@ -111,11 +111,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 |