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

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


  • To: Vlad-Andrei BĂDOIU (78692) <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>, "minios-devel@xxxxxxxxxxxxx" <minios-devel@xxxxxxxxxxxxx>
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Tue, 3 Sep 2019 20:06:30 +0300
  • Delivery-date: Tue, 03 Sep 2019 17:06:41 +0000
  • Ironport-phdr: 9a23:CDX4Ih0lSuOT+mg7smDT+DRfVm0co7zxezQtwd8ZseMeK/ad9pjvdHbS+e9qxAeQG9mCsbQd1LGd7PGocFdDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZrKeTpAI7SiNm82/yv95HJbAhEmSSxbalvIBi0owjducsbjI9/Iast1xXFpWdFdf5Lzm1yP1KTmBj85sa0/JF99ilbpuws+c1dX6jkZqo0VbNXAigoPGAz/83rqALMTRCT6XsGU2UZiQRHDg7Y5xznRJjxsy/6tu1g2CmGOMD9UL45VSi+46ptVRTlkzkMOSIn/27Li8xwlKNbrwynpxxj2I7ffYWZOONjcq/BYd8WQGxMVdtTWSNcGIOxd5YBAfQPPehYrIfzqVUBohS8CgawC+3i0SNIhmbs0KEmz+gsHwPL0Qo9FNwOqnTUq9D1Ob8MXOCy16nI0TTDb/VL0jn79YjIag0hquyLUL1sdsrR0lUvFwLDjlmKrYzlIiuV1vkWvmeH9OpsT/qvi3M8pA1ruDivwd4hh4/UjYwW0lDJ7Th1zYkoKdGiS0N2YcSoHIVOuyyYLYd7TNsuT3xrtSs50LEKp5+2cDIUxJkowxPTceGLfoqO7xn+TuieOy14i2hgeL+nghay9lWvxfPkW8mv1VZKsjJFkt7RtnARzxDT6taISv96/kq5xzaP0hrc6uBAIUwuiaXbMIQtwqYtlpUIq0jDBCj2lF33jK+QaEok5vCl5/nob7n7vJORNI95hhvgPqgwmMGzG+o1PhALX2eB+OS80LPj/Vf+QLVPlvA5jq7ZsIvGJcQaoK61GQtV0ps76xaiFDqpzM8YkWMfLFJYYx2LlZLpO1bWLPDiEfi/m0iskCtsx/3eO73hA5PNLnnEkLf6ZLpy9lBTyBQtwtBb/J9UDrABIOnvWk/qrtDZAQE2Mwquz+bgEtV92ZsUWXiTDa+BLKPSrViI6/oxI+mIfoAapS7yJOIj5/Hzl382h14dcbOy0pQNdX+4GfVmI1iCbHr3ntcBDHoFshAkQ+P2k12OSyNTZ26pUK4m/DE7D9HuMYCWeISkjPmo2iuhE5xhTMtqLXGxJje3J9vVAbZEPDyWK8NWmzoIT7WgDYUo2RavqSfh16draOPf4WsFrZilzt8jo6WZkBA09DtvSsiQzWyJZ2V1hX8TAS872uZ4u0M3ggOG0K55hOcdGdFN6vdhVgYhKYWa3+F8TdfoVVSSUM2OTQONRc66ADd5as8p3pdaaEFmB9SkyBTexzeCCKRTj6GBQoYzpPGPl0PtLtpwni6VnJIqiEMrF44WbTWr
  • Ironport-sdr: I+fHX3bLUuWRAxA/4j3zEnZ15WQGM7IGNzt6uRB1iroj42AvYW/2odOSKGyc57qnSNQRBS7Qg1 C9VWUOcPP2wA==
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

Thanks, Vlad!

Reviewed-by: Costin Lupu <costin.lupu@xxxxxxxxx>

On 9/3/19 2:49 PM, Vlad-Andrei BĂDOIU (78692) wrote:
> 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 = {
> 

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