All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Jevon Qiao <scaleqiao@gmail.com>,
	"ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>,
	qemu-devel@nongnu.org
Cc: mst@redhat.com, gkurz@linux.vnet.ibm.com,
	Sage Weil <sage@newdream.net>,
	gfarnum@redhat.com, haomaiwang@gmail.com
Subject: Re: [PATCH] add CephFS support in VirtFS
Date: Sun, 14 Feb 2016 11:31:23 +0530	[thread overview]
Message-ID: <874mdbakzw.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <56C00B60.6000502@gmail.com>


> diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
> index f972731..385c01d 100644
> --- a/hw/9pfs/virtio-9p.c
> +++ b/hw/9pfs/virtio-9p.c
> @@ -1326,7 +1326,7 @@ out_nofid:
>   static int32_t get_iounit(V9fsPDU *pdu, V9fsPath *path)
>   {
>       struct statfs stbuf;
> -    int32_t iounit = 0;
> +    int32_t iounit = 0, unit = 0;
>       V9fsState *s = pdu->s;
>
>       /*
> @@ -1334,8 +1334,21 @@ static int32_t get_iounit(V9fsPDU *pdu, V9fsPath 
> *path)
>        * and as well as less than (client msize - P9_IOHDRSZ))
>        */
>       if (!v9fs_co_statfs(pdu, path, &stbuf)) {
> -        iounit = stbuf.f_bsize;
> -        iounit *= (s->msize - P9_IOHDRSZ)/stbuf.f_bsize;
> +    /*
> +     * If host filesystem block size is larger than client msize,
> +     * we will use AGESIZE as the unit. The reason why we choose
> +     * AGESIZE is because the data will be splitted in terms of
> +     * AGESIZE in the virtio layer. In this case, the final
> +     * iounit is equal to the value of ((msize/unit) - 1) * unit.
> +     */
> +    if (stbuf.f_bsize > s->msize) {
> +        iounit = 4096;
> +        unit = 4096;
> +    } else {
> +            iounit = stbuf.f_bsize;
> +        unit = stbuf.f_bsize;
> +    }
> +        iounit *= (s->msize - P9_IOHDRSZ)/unit;
>       }
>       if (!iounit) {
>           iounit = s->msize - P9_IOHDRSZ;
> --


Can you split this out as a separate patch ?. Also explain what is
AGESIZE.

-aneesh


WARNING: multiple messages have this Message-ID (diff)
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Jevon Qiao <scaleqiao@gmail.com>,
	"ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>,
	qemu-devel@nongnu.org
Cc: Sage Weil <sage@newdream.net>,
	haomaiwang@gmail.com, gkurz@linux.vnet.ibm.com,
	gfarnum@redhat.com, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH] add CephFS support in VirtFS
Date: Sun, 14 Feb 2016 11:31:23 +0530	[thread overview]
Message-ID: <874mdbakzw.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <56C00B60.6000502@gmail.com>


> diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
> index f972731..385c01d 100644
> --- a/hw/9pfs/virtio-9p.c
> +++ b/hw/9pfs/virtio-9p.c
> @@ -1326,7 +1326,7 @@ out_nofid:
>   static int32_t get_iounit(V9fsPDU *pdu, V9fsPath *path)
>   {
>       struct statfs stbuf;
> -    int32_t iounit = 0;
> +    int32_t iounit = 0, unit = 0;
>       V9fsState *s = pdu->s;
>
>       /*
> @@ -1334,8 +1334,21 @@ static int32_t get_iounit(V9fsPDU *pdu, V9fsPath 
> *path)
>        * and as well as less than (client msize - P9_IOHDRSZ))
>        */
>       if (!v9fs_co_statfs(pdu, path, &stbuf)) {
> -        iounit = stbuf.f_bsize;
> -        iounit *= (s->msize - P9_IOHDRSZ)/stbuf.f_bsize;
> +    /*
> +     * If host filesystem block size is larger than client msize,
> +     * we will use AGESIZE as the unit. The reason why we choose
> +     * AGESIZE is because the data will be splitted in terms of
> +     * AGESIZE in the virtio layer. In this case, the final
> +     * iounit is equal to the value of ((msize/unit) - 1) * unit.
> +     */
> +    if (stbuf.f_bsize > s->msize) {
> +        iounit = 4096;
> +        unit = 4096;
> +    } else {
> +            iounit = stbuf.f_bsize;
> +        unit = stbuf.f_bsize;
> +    }
> +        iounit *= (s->msize - P9_IOHDRSZ)/unit;
>       }
>       if (!iounit) {
>           iounit = s->msize - P9_IOHDRSZ;
> --


Can you split this out as a separate patch ?. Also explain what is
AGESIZE.

-aneesh

  reply	other threads:[~2016-02-14  6:01 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-14  5:06 [PATCH] add CephFS support in VirtFS Jevon Qiao
2016-02-14  5:06 ` [Qemu-devel] " Jevon Qiao
2016-02-14  6:01 ` Aneesh Kumar K.V [this message]
2016-02-14  6:01   ` Aneesh Kumar K.V
2016-02-14  6:41   ` Jevon Qiao
2016-02-14  6:41     ` [Qemu-devel] " Jevon Qiao
2016-02-14  7:26 ` [PATCH 1/2] " Jevon Qiao
2016-02-14  7:26   ` [Qemu-devel] " Jevon Qiao
2016-02-15  9:17 ` [Qemu-devel] [PATCH] " Daniel P. Berrange
2016-02-15  9:17   ` Daniel P. Berrange
2016-02-17  7:32   ` Jevon Qiao
2016-02-17  7:32     ` Jevon Qiao
2016-02-17  8:01     ` Greg Kurz
2016-02-17  8:01       ` Greg Kurz
2016-02-17  8:49       ` Jevon Qiao
2016-02-17  8:49         ` Jevon Qiao
2016-02-17  9:04         ` Greg Kurz
2016-02-17  9:04           ` Greg Kurz
2016-02-18  1:36           ` Jevon Qiao
2016-02-18  1:36             ` Jevon Qiao
2016-02-17  9:37     ` Daniel P. Berrange
2016-02-17  9:37       ` Daniel P. Berrange
2016-02-17 15:41       ` Eric Blake
2016-02-18  1:39       ` Jevon Qiao
2016-02-18  1:39         ` Jevon Qiao
2016-03-09  3:10         ` Gerard Braad
2016-03-09  3:10           ` Gerard Braad
2016-03-09  9:31           ` Greg Kurz
2016-03-09  9:31             ` Greg Kurz

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=874mdbakzw.fsf@linux.vnet.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=gfarnum@redhat.com \
    --cc=gkurz@linux.vnet.ibm.com \
    --cc=haomaiwang@gmail.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sage@newdream.net \
    --cc=scaleqiao@gmail.com \
    /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.