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

[Minios-devel] [UNIKRAFT PATCH 1/1] lib/vfscore: Add missing vnop operations to stdio


  • To: "minios-devel@xxxxxxxxxxxxx" <minios-devel@xxxxxxxxxxxxx>
  • From: Vlad-Andrei BĂDOIU (78692) <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
  • Date: Tue, 3 Sep 2019 11:49:16 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=stud.acs.upb.ro; dmarc=pass action=none header.from=stud.acs.upb.ro; dkim=pass header.d=stud.acs.upb.ro; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sm3IZk6HB2u3aafRAdaPz5OAsKGBKYSlyOcfeknEeeo=; b=KiGPDPpatY1iHXk23A3pc+TN+Xhu2BB3AptBExmIqaDc5GND3SCSaxvMq1ygJXkxfD1/NdvcQiTUeOtITaMcfe4E7g7leOH5mZVjuwfYwM5UOsMHGKJp4ymquijiOMkquDjRiaMMXdEhX43QeM274M1aXOW4hnXxcUNuIDOVMGqU+uHlootu5i8CNnoWSqgQYHtkC2A6gMBXLAkO/yRxuZ5ss/M6e2NswKJ2f9/e5hSb5mZVVeToduae0rbY4vqv3p/PEWuT0RUxXTTuzzVEZ6Acfo2BTApKTdlhA0YR4yDNyY9MB1S8wsTyGjloSFcw4PMKyUsKi5fZXQs/HOUVaw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c8mXzejFRaOCCuPNh8QVd6+7MBsw23qvmdYUL74+WiGAuI4HN8jR3gqC4/q6Ymyut+Qbx30XnkRiSPuG7AC0qN/Xa9aIp+YYD4KuLWD8bhC/WFQEj2Vn37/WnbVrRrf2PKG2LU1UzkNEstVjniUCAAEEybkPJ3/CAqX0l0R3LTFiup92hbBl+81F7Gc90UhVc6czabSv4E4oqSRN6FpRC7AqhLyjxGfp4uvXtobsDHkYfsp0PjGpjXlcRLe7TapAVFGX2C1bRdOYP9RfWVka0P0ji9uO+hYwCE05MZC3YbwsJegwGFPQJ2d/91GO+T0Y5N/skgxrCbPyRrFjB8PjuA==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=vlad_andrei.badoiu@xxxxxxxxxxxxxxx;
  • Cc: Vlad-Andrei BĂDOIU (78692) <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>, "costin.lupu@xxxxxxxxx" <costin.lupu@xxxxxxxxx>
  • Delivery-date: Tue, 03 Sep 2019 11:49:24 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Thread-index: AQHVYk2da28vK+o8PEWZYBGtQguiIg==
  • Thread-topic: [UNIKRAFT PATCH 1/1] lib/vfscore: Add missing vnop operations to stdio

Most of the vnop operations are missing from the stdio. This causes a page fault
when calling function such as lseek on stdio. To solve this we register the
missing operation.

Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
---
 lib/vfscore/stdio.c | 48 ++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 45 insertions(+), 3 deletions(-)

diff --git a/lib/vfscore/stdio.c b/lib/vfscore/stdio.c
index 08335367..9536998c 100644
--- a/lib/vfscore/stdio.c
+++ b/lib/vfscore/stdio.c
@@ -41,6 +41,8 @@
 #include <vfscore/vnode.h>
 #include <unistd.h>
 #include <vfscore/uio.h>
+#include <vfscore/vnode.h>
+#include <vfscore/mount.h>
 
 static int __write_fn(void *dst __unused, void *src, size_t *cnt)
 {
@@ -127,10 +129,50 @@ stdio_getattr(struct vnode *vnode __unused, struct vattr 
*attr __unused)
        return 0;
 }
 
+#define stdio_open     ((vnop_open_t)vfscore_nullop)
+#define stdio_close    ((vnop_close_t)vfscore_nullop)
+#define stdio_seek     ((vnop_seek_t)vfscore_vop_nullop)
+#define stdio_ioctl    ((vnop_ioctl_t)vfscore_nullop)
+#define stdio_fsync    ((vnop_fsync_t)vfscore_vop_nullop)
+#define stdio_readdir  ((vnop_readdir_t)vfscore_vop_einval)
+#define stdio_lookup   ((vnop_lookup_t)vfscore_nullop)
+#define stdio_create   ((vnop_create_t)vfscore_vop_einval)
+#define stdio_remove   ((vnop_remove_t)vfscore_vop_einval)
+#define stdio_rename   ((vnop_rename_t)vfscore_vop_einval)
+#define stdio_mkdir    ((vnop_mkdir_t)vfscore_vop_einval)
+#define stdio_rmdir    ((vnop_rmdir_t)vfscore_vop_einval)
+#define stdio_setattr  ((vnop_setattr_t)vfscore_vop_eperm)
+#define stdio_inactive ((vnop_inactive_t)vfscore_vop_nullop)
+#define stdio_truncate ((vnop_truncate_t)vfscore_vop_nullop)
+#define stdio_link     ((vnop_link_t)vfscore_vop_eperm)
+#define stdio_fallocate        ((vnop_fallocate_t)vfscore_vop_nullop)
+#define stdio_readlink ((vnop_readlink_t)vfscore_vop_nullop)
+#define stdio_symlink  ((vnop_symlink_t)vfscore_vop_nullop)
+
 static struct vnops stdio_vnops = {
-       .vop_write = stdio_write,
-       .vop_read = stdio_read,
-       .vop_getattr = stdio_getattr,
+       stdio_open,             /* open */
+       stdio_close,            /* close */
+       stdio_read,             /* read */
+       stdio_write,            /* write */
+       stdio_seek,             /* seek */
+       stdio_ioctl,            /* ioctl */
+       stdio_fsync,            /* fsync */
+       stdio_readdir,          /* readdir */
+       stdio_lookup,           /* lookup */
+       stdio_create,           /* create */
+       stdio_remove,           /* remove */
+       stdio_rename,           /* remame */
+       stdio_mkdir,            /* mkdir */
+       stdio_rmdir,            /* rmdir */
+       stdio_getattr,          /* getattr */
+       stdio_setattr,          /* setattr */
+       stdio_inactive,         /* inactive */
+       stdio_truncate,         /* truncate */
+       stdio_link,             /* link */
+       (vnop_cache_t) NULL, /* arc */
+       stdio_fallocate,        /* fallocate */
+       stdio_readlink,         /* read link */
+       stdio_symlink,          /* symbolic link */
 };
 
 static struct vnode stdio_vnode = {
-- 
2.20.1


_______________________________________________
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®.