[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH v3 08/23] lib/vfscore: use Unikraft includes



Hello Yuri,

This patch seems fine.

Reviewed-by: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>

Thanks & Regards
Sharan

On 2/7/19 2:58 PM, Yuri Volchkov wrote:
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/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/subr_uio.c               |  4 +--
  lib/vfscore/syscalls.c               | 12 ++++---
  lib/vfscore/task.c                   |  2 +-
  lib/vfscore/vfs.h                    | 23 +++----------
  lib/vfscore/vnode.c                  |  6 ++--
  15 files changed, 59 insertions(+), 104 deletions(-)

diff --git a/lib/vfscore/dentry.c b/lib/vfscore/dentry.c
index efc10bd6..ccce07d1 100644
--- a/lib/vfscore/dentry.c
+++ b/lib/vfscore/dentry.c
@@ -32,10 +32,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 f1c161e7..b4583d20 100644
--- a/lib/vfscore/fops.c
+++ b/lib/vfscore/fops.c
@@ -33,14 +33,13 @@
   * THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY.
   */

+#define _GNU_SOURCE
Do we need non-posix functions
  #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 9cfe8dac..ba1c3457 100644
--- a/lib/vfscore/include/vfscore/dentry.h
+++ b/lib/vfscore/include/vfscore/dentry.h
@@ -36,8 +36,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/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 6cbe3130..8a306d54 100644
--- a/lib/vfscore/include/vfscore/prex.h
+++ b/lib/vfscore/include/vfscore/prex.h
@@ -38,7 +38,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 d30a9411..49fd4d36 100644
--- a/lib/vfscore/include/vfscore/vnode.h
+++ b/lib/vfscore/include/vfscore/vnode.h
@@ -35,13 +35,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 f7a38c4f..9837e81f 100644
--- a/lib/vfscore/lookup.c
+++ b/lib/vfscore/lookup.c
@@ -36,8 +36,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 74876dc1..90df3d71 100644
--- a/lib/vfscore/main.c
+++ b/lib/vfscore/main.c
@@ -30,53 +30,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 10c27fad..06922ffb 100644
--- a/lib/vfscore/mount.c
+++ b/lib/vfscore/mount.c
@@ -34,27 +34,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/subr_uio.c b/lib/vfscore/subr_uio.c
index 8276d6d4..bbca3362 100644
--- a/lib/vfscore/subr_uio.c
+++ b/lib/vfscore/subr_uio.c
@@ -39,11 +39,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 4e55337f..f50fb38f 100644
--- a/lib/vfscore/syscalls.c
+++ b/lib/vfscore/syscalls.c
@@ -35,7 +35,8 @@
   *                  a VFS system call.
   */
-#include <sys/stat.h>
+#define _BSD_SOURCE
+#define _GNU_SOURCE
  #include <dirent.h>
#include <limits.h>
@@ -46,11 +47,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 4ceb123b..7635bd7a 100644
--- a/lib/vfscore/task.c
+++ b/lib/vfscore/task.c
@@ -41,7 +41,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 cd940979..2531f730 100644
--- a/lib/vfscore/vfs.h
+++ b/lib/vfscore/vfs.h
@@ -33,24 +33,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
@@ -58,7 +46,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 f564577f..81f78be8 100644
--- a/lib/vfscore/vnode.c
+++ b/lib/vfscore/vnode.c
@@ -36,14 +36,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] = {


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.