All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Juergen Gross <jgross@suse.com>
Cc: minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org, wl@xen.org
Subject: Re: [PATCH 06/15] mini-os: eliminate blkfront union member in struct file
Date: Sun, 9 Jan 2022 02:26:24 +0100	[thread overview]
Message-ID: <20220109012624.zsd2agf7hhmcyd2r@begin> (raw)
In-Reply-To: <20220106115741.3219-7-jgross@suse.com>

Juergen Gross, le jeu. 06 janv. 2022 12:57:32 +0100, a ecrit:
> Replace the blkfront specific union member in struct file with the
> common dev pointer.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> ---
>  blkfront.c    | 6 +++---
>  include/lib.h | 3 ---
>  lib/sys.c     | 2 +-
>  3 files changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/blkfront.c b/blkfront.c
> index 8137106..e3f42be 100644
> --- a/blkfront.c
> +++ b/blkfront.c
> @@ -562,13 +562,13 @@ int blkfront_open(struct blkfront_dev *dev)
>      }
>      dev->fd = alloc_fd(FTYPE_BLK);
>      printk("blk_open(%s) -> %d\n", dev->nodename, dev->fd);
> -    files[dev->fd].blk.dev = dev;
> +    files[dev->fd].dev = dev;
>      return dev->fd;
>  }
>  
>  int blkfront_posix_rwop(int fd, uint8_t* buf, size_t count, int write)
>  {
> -   struct blkfront_dev* dev = files[fd].blk.dev;
> +   struct blkfront_dev* dev = files[fd].dev;
>     off_t offset = files[fd].offset;
>     struct blkfront_aiocb aiocb;
>     unsigned long long disksize = dev->info.sectors * dev->info.sector_size;
> @@ -718,7 +718,7 @@ int blkfront_posix_rwop(int fd, uint8_t* buf, size_t count, int write)
>  
>  int blkfront_posix_fstat(int fd, struct stat* buf)
>  {
> -   struct blkfront_dev* dev = files[fd].blk.dev;
> +   struct blkfront_dev* dev = files[fd].dev;
>  
>     buf->st_mode = dev->info.mode;
>     buf->st_uid = 0;
> diff --git a/include/lib.h b/include/lib.h
> index 60aaf1c..3a40634 100644
> --- a/include/lib.h
> +++ b/include/lib.h
> @@ -196,9 +196,6 @@ struct file {
>  	struct {
>  	    struct netfront_dev *dev;
>  	} tap;
> -	struct {
> -	    struct blkfront_dev *dev;
> -	} blk;
>  	struct {
>  	    struct kbdfront_dev *dev;
>  	} kbd;
> diff --git a/lib/sys.c b/lib/sys.c
> index 1da7401..f2fdbdf 100644
> --- a/lib/sys.c
> +++ b/lib/sys.c
> @@ -456,7 +456,7 @@ int close(int fd)
>  #endif
>  #ifdef CONFIG_BLKFRONT
>  	case FTYPE_BLK:
> -            shutdown_blkfront(files[fd].blk.dev);
> +            shutdown_blkfront(files[fd].dev);
>  	    files[fd].type = FTYPE_NONE;
>  	    return 0;
>  #endif
> -- 
> 2.26.2
> 

-- 
Samuel
Accroche-toi au terminal, j'enlève le shell...
 -+- nojhan -+-


  reply	other threads:[~2022-01-09  1:26 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-06 11:57 [PATCH 00/15] mini-os: remove struct file dependency from config Juergen Gross
2022-01-06 11:57 ` [PATCH 01/15] mini-os: split struct file definition from its usage Juergen Gross
2022-01-09  1:17   ` Samuel Thibault
2022-01-06 11:57 ` [PATCH 02/15] mini-os: makes file.read bool and move it ahead of device specific part Juergen Gross
2022-01-09  1:18   ` Samuel Thibault
2022-01-09  1:21     ` Samuel Thibault
2022-01-09  6:12       ` Juergen Gross
2022-01-09 10:20         ` Samuel Thibault
2022-01-09 10:28           ` Juergen Gross
2022-01-09 10:33             ` Samuel Thibault
2022-01-06 11:57 ` [PATCH 03/15] mini-os: make offset a common struct file member for all types Juergen Gross
2022-01-09  1:23   ` Samuel Thibault
2022-01-06 11:57 ` [PATCH 04/15] mini-os: replace multiple fd elements in struct file by common one Juergen Gross
2022-01-09  1:25   ` Samuel Thibault
2022-01-06 11:57 ` [PATCH 05/15] mini-os: introduce a common dev pointer in struct file Juergen Gross
2022-01-09  1:25   ` Samuel Thibault
2022-01-06 11:57 ` [PATCH 06/15] mini-os: eliminate blkfront union member " Juergen Gross
2022-01-09  1:26   ` Samuel Thibault [this message]
2022-01-06 11:57 ` [PATCH 07/15] mini-os: eliminate consfront " Juergen Gross
2022-01-09  1:27   ` Samuel Thibault
2022-01-06 11:57 ` [PATCH 08/15] mini-os: eliminate fbfront " Juergen Gross
2022-01-09  1:27   ` Samuel Thibault
2022-01-06 11:57 ` [PATCH 09/15] mini-os: eliminate kbdfront " Juergen Gross
2022-01-09  1:28   ` Samuel Thibault
2022-01-06 11:57 ` [PATCH 10/15] mini-os: eliminate netfront " Juergen Gross
2022-01-09  1:28   ` Samuel Thibault
2022-01-06 11:57 ` [PATCH 11/15] mini-os: move tpm respgot member of struct file to device specific data Juergen Gross
2022-01-09  1:30   ` Samuel Thibault
2022-01-06 11:57 ` [PATCH 12/15] mini-os: eliminate tpmfront union member in struct file Juergen Gross
2022-01-09  1:30   ` Samuel Thibault
2022-01-06 11:57 ` [PATCH 13/15] mini-os: eliminate tpmtis " Juergen Gross
2022-01-09  1:31   ` Samuel Thibault
2022-01-06 11:57 ` [PATCH 14/15] mini-os: eliminate xenbus " Juergen Gross
2022-01-09  1:32   ` Samuel Thibault
2022-01-06 11:57 ` [PATCH 15/15] mini-os: introduce get_file_from_fd() Juergen Gross
2022-01-09  1:33   ` Samuel Thibault
2022-01-07  2:39 ` [PATCH 00/15] mini-os: remove struct file dependency from config Samuel Thibault

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220109012624.zsd2agf7hhmcyd2r@begin \
    --to=samuel.thibault@ens-lyon.org \
    --cc=jgross@suse.com \
    --cc=minios-devel@lists.xenproject.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.