[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT PATCH 07/22] lib/vfscore: use Unikraft includes
Signed-off-by: Yuri Volchkov <yuri.volchkov@xxxxxxxxx> --- lib/vfscore/dentry.c | 7 ++-- lib/vfscore/fops.c | 11 +++---- lib/vfscore/include/vfscore/dentry.h | 4 +-- lib/vfscore/include/vfscore/file.h | 1 + lib/vfscore/include/vfscore/mount.h | 6 ++-- lib/vfscore/include/vfscore/prex.h | 1 - lib/vfscore/include/vfscore/uio.h | 1 - lib/vfscore/include/vfscore/vnode.h | 13 ++++---- lib/vfscore/lookup.c | 4 +-- lib/vfscore/main.c | 48 ++++++---------------------- lib/vfscore/mount.c | 21 +++++------- lib/vfscore/stdio.c | 3 ++ lib/vfscore/subr_uio.c | 4 +-- lib/vfscore/syscalls.c | 12 ++++--- lib/vfscore/task.c | 2 +- lib/vfscore/vfs.h | 23 +++---------- lib/vfscore/vnode.c | 6 ++-- 17 files changed, 63 insertions(+), 104 deletions(-) diff --git a/lib/vfscore/dentry.c b/lib/vfscore/dentry.c index c2f209b2..a780203f 100644 --- a/lib/vfscore/dentry.c +++ b/lib/vfscore/dentry.c @@ -36,10 +36,11 @@ #include <string.h> #include <stdlib.h> -#include <sys/param.h> -#include <osv/dentry.h> -#include <osv/vnode.h> +#include <uk/list.h> +#include <vfscore/dentry.h> +#include <vfscore/vnode.h> +#include <uk/mutex.h> #include "vfs.h" #define DENTRY_BUCKETS 32 diff --git a/lib/vfscore/fops.c b/lib/vfscore/fops.c index a525874b..a1c07821 100644 --- a/lib/vfscore/fops.c +++ b/lib/vfscore/fops.c @@ -5,15 +5,14 @@ * BSD license as described in the LICENSE file in the top-level directory. */ +#define _GNU_SOURCE #include <fcntl.h> #include <sys/stat.h> -#include <osv/file.h> -#include <osv/poll.h> -#include <fs/vfs/vfs.h> -#include <osv/vfs_file.hh> -#include <osv/mmu.hh> -#include <osv/pagecache.hh> +#include <vfscore/file.h> +#include "vfs.h" + +#include <uk/assert.h> int vfs_close(struct vfscore_file *fp) { diff --git a/lib/vfscore/include/vfscore/dentry.h b/lib/vfscore/include/vfscore/dentry.h index c06fe8b7..f499b2bb 100644 --- a/lib/vfscore/include/vfscore/dentry.h +++ b/lib/vfscore/include/vfscore/dentry.h @@ -8,8 +8,8 @@ #ifndef _OSV_DENTRY_H #define _OSV_DENTRY_H 1 -#include <osv/mutex.h> -#include <bsd/sys/sys/queue.h> +#include <uk/mutex.h> +#include <uk/list.h> struct vnode; diff --git a/lib/vfscore/include/vfscore/file.h b/lib/vfscore/include/vfscore/file.h index 9985706f..7387265d 100644 --- a/lib/vfscore/include/vfscore/file.h +++ b/lib/vfscore/include/vfscore/file.h @@ -38,6 +38,7 @@ #include <stdint.h> #include <sys/types.h> +#include <vfscore/dentry.h> #ifdef __cplusplus extern "C" { diff --git a/lib/vfscore/include/vfscore/mount.h b/lib/vfscore/include/vfscore/mount.h index b68d3c98..e12a1039 100644 --- a/lib/vfscore/include/vfscore/mount.h +++ b/lib/vfscore/include/vfscore/mount.h @@ -32,10 +32,10 @@ #ifndef _SYS_MOUNT_H_ #define _SYS_MOUNT_H_ -#include <sys/cdefs.h> #include <sys/statfs.h> -#include <osv/vnode.h> -#include <bsd/sys/sys/queue.h> +#include <limits.h> +#include <uk/list.h> +#include <vfscore/vnode.h> #ifdef _KERNEL diff --git a/lib/vfscore/include/vfscore/prex.h b/lib/vfscore/include/vfscore/prex.h index 63760b50..38b304d3 100644 --- a/lib/vfscore/include/vfscore/prex.h +++ b/lib/vfscore/include/vfscore/prex.h @@ -10,7 +10,6 @@ #include <unistd.h> -#include <osv/fcntl.h> #define BSIZE 512 /* size of secondary block (bytes) */ diff --git a/lib/vfscore/include/vfscore/uio.h b/lib/vfscore/include/vfscore/uio.h index d7f7fce9..8ad1e3fb 100644 --- a/lib/vfscore/include/vfscore/uio.h +++ b/lib/vfscore/include/vfscore/uio.h @@ -33,7 +33,6 @@ #ifndef _UIO_H_ #define _UIO_H_ -#include <sys/cdefs.h> #include <sys/types.h> #include <sys/uio.h> #include <limits.h> diff --git a/lib/vfscore/include/vfscore/vnode.h b/lib/vfscore/include/vfscore/vnode.h index bf4fca01..52de2fdf 100644 --- a/lib/vfscore/include/vfscore/vnode.h +++ b/lib/vfscore/include/vfscore/vnode.h @@ -32,13 +32,14 @@ #ifdef _KERNEL -#include <sys/cdefs.h> #include <sys/stat.h> -#include <osv/prex.h> -#include <osv/uio.h> -#include <osv/mutex.h> -#include "file.h" -#include "dirent.h" +#include <dirent.h> + +#include <uk/mutex.h> +#include <uk/list.h> +#include <time.h> +#include <vfscore/uio.h> +#include <vfscore/dentry.h> struct vfsops; struct vnops; diff --git a/lib/vfscore/lookup.c b/lib/vfscore/lookup.c index 01faaf23..45bbfe6d 100644 --- a/lib/vfscore/lookup.c +++ b/lib/vfscore/lookup.c @@ -33,8 +33,8 @@ #include <stdlib.h> #include <sys/param.h> -#include <osv/dentry.h> -#include <osv/vnode.h> +#include <vfscore/dentry.h> +#include <vfscore/vnode.h> #include "vfs.h" static ssize_t diff --git a/lib/vfscore/main.c b/lib/vfscore/main.c index c7e78cbb..2bd27736 100644 --- a/lib/vfscore/main.c +++ b/lib/vfscore/main.c @@ -34,53 +34,23 @@ * SUCH DAMAGE. */ -#include <sys/param.h> +#define _GNU_SOURCE + #include <sys/statvfs.h> #include <sys/stat.h> -#include <sys/time.h> -#include <sys/sendfile.h> - #include <limits.h> -#include <unistd.h> -#include <stdio.h> -#include <stdint.h> -#include <stdlib.h> #include <string.h> #include <errno.h> -#include <signal.h> -#define open __open_variadic -#define fcntl __fcntl_variadic #include <fcntl.h> -#undef open -#undef fcntl - -#include <osv/prex.h> -#include <osv/vnode.h> -#include <osv/stubbing.hh> -#include <osv/ioctl.h> -#include <osv/trace.hh> -#include <osv/run.hh> -#include <drivers/console.hh> - +#include <vfscore/prex.h> +#include <vfscore/vnode.h> #include "vfs.h" - -#include "libc/internal/libc.h" - -#include <algorithm> -#include <unordered_map> - #include <sys/file.h> - -#include "fs/fs.hh" -#include "libc/libc.hh" - -#include <mntent.h> -#include <sys/mman.h> - -#include <osv/clock.hh> -#include <api/utime.h> -#include <chrono> - +#include <stdarg.h> +#include <vfscore/file.h> +#include <vfscore/mount.h> +#include <vfscore/fs.h> +#include <uk/errptr.h> #ifdef DEBUG_VFS int vfs_debug = VFSDB_FLAGS; diff --git a/lib/vfscore/mount.c b/lib/vfscore/mount.c index ab05af06..f7ab711e 100644 --- a/lib/vfscore/mount.c +++ b/lib/vfscore/mount.c @@ -31,27 +31,22 @@ * vfs_mount.c - mount operations */ -#include <sys/stat.h> #include <sys/param.h> -#include <dirent.h> - #include <limits.h> #include <unistd.h> #include <stdlib.h> #include <string.h> #include <stdio.h> #include <errno.h> -#include <fcntl.h> - -#include <osv/prex.h> -#include <osv/vnode.h> -#include <osv/device.h> -#include <osv/debug.h> -#include <osv/mutex.h> #include "vfs.h" - -#include <memory> -#include <list> +#include <sys/types.h> +#include <sys/stat.h> +#include <time.h> +#include <uk/list.h> +#include <uk/mutex.h> +#include <vfscore/prex.h> +#include <vfscore/dentry.h> +#include <vfscore/vnode.h> /* * List for VFS mount points. diff --git a/lib/vfscore/stdio.c b/lib/vfscore/stdio.c index a9bdfd61..7d749442 100644 --- a/lib/vfscore/stdio.c +++ b/lib/vfscore/stdio.c @@ -34,9 +34,12 @@ */ #include <vfscore/file.h> +#include <vfscore/fs.h> #include <uk/plat/console.h> #include <uk/essentials.h> #include <termios.h> +#include <vfscore/vnode.h> +#include <unistd.h> /* One function for stderr and stdout */ static ssize_t stdout_write(struct vfscore_file *vfscore_file __unused, diff --git a/lib/vfscore/subr_uio.c b/lib/vfscore/subr_uio.c index bf138b8e..80680fb5 100644 --- a/lib/vfscore/subr_uio.c +++ b/lib/vfscore/subr_uio.c @@ -34,11 +34,11 @@ * @(#)kern_subr.c 8.3 (Berkeley) 1/21/94 */ -#include <assert.h> +#include <uk/assert.h> #include <errno.h> #include <stdlib.h> #include <string.h> -#include <osv/uio.h> +#include <vfscore/uio.h> int uiomove(void *cp, int n, struct uio *uio) diff --git a/lib/vfscore/syscalls.c b/lib/vfscore/syscalls.c index 7ee082f3..a7203cf5 100644 --- a/lib/vfscore/syscalls.c +++ b/lib/vfscore/syscalls.c @@ -39,7 +39,8 @@ * a VFS system call. */ -#include <sys/stat.h> +#define _BSD_SOURCE +#define _GNU_SOURCE #include <dirent.h> #include <limits.h> @@ -50,11 +51,12 @@ #include <errno.h> #include <fcntl.h> -#include <osv/prex.h> -#include <osv/vnode.h> -#include <osv/vfs_file.hh> +#include <vfscore/prex.h> +#include <vfscore/vnode.h> +#include <vfscore/file.h> + #include "vfs.h" -#include <fs/fs.hh> +#include <vfscore/fs.h> extern struct task *main_task; diff --git a/lib/vfscore/task.c b/lib/vfscore/task.c index b748bfb5..68b787a0 100644 --- a/lib/vfscore/task.c +++ b/lib/vfscore/task.c @@ -37,7 +37,7 @@ #include <stdio.h> #include <errno.h> -#include <osv/prex.h> +#include <vfscore/prex.h> #include "vfs.h" diff --git a/lib/vfscore/vfs.h b/lib/vfscore/vfs.h index 85bdb673..1965ae86 100644 --- a/lib/vfscore/vfs.h +++ b/lib/vfscore/vfs.h @@ -30,24 +30,12 @@ #ifndef _VFS_H #define _VFS_H -#include <sys/cdefs.h> -#include <assert.h> -#include <dirent.h> -#include <limits.h> - -#include <osv/prex.h> -#include <osv/file.h> -#include <osv/mount.h> -#include <osv/vnode.h> -#include <osv/dentry.h> -#include <osv/error.h> - -/* - * Import vnode attributes flags - */ -#include <osv/vnode_attr.h> +#define _GNU_SOURCE +#include <vfscore/mount.h> -/* #define DEBUG_VFS 1 */ +#include <limits.h> +#include <fcntl.h> +#include <sys/statfs.h> /* * Tunable parameters @@ -55,7 +43,6 @@ #define FSMAXNAMES 16 /* max length of 'file system' name */ #ifdef DEBUG_VFS -#include <osv/debug.h> extern int vfs_debug; diff --git a/lib/vfscore/vnode.c b/lib/vfscore/vnode.c index 501e087d..7eca7721 100644 --- a/lib/vfscore/vnode.c +++ b/lib/vfscore/vnode.c @@ -33,14 +33,16 @@ #include <limits.h> #include <unistd.h> +#include <stdint.h> #include <string.h> #include <stdlib.h> #include <stdio.h> #include <errno.h> #include <sys/stat.h> -#include <osv/prex.h> -#include <osv/vnode.h> +#include <vfscore/prex.h> +#include <vfscore/dentry.h> +#include <vfscore/vnode.h> #include "vfs.h" enum vtype iftovt_tab[16] = { -- 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 |