From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jevon Qiao Subject: Re: [PATCH] add CephFS support in VirtFS Date: Sun, 14 Feb 2016 14:41:56 +0800 Message-ID: <56C021B4.4040705@gmail.com> References: <56C00B60.6000502@gmail.com> <874mdbakzw.fsf@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <874mdbakzw.fsf@linux.vnet.ibm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org To: "Aneesh Kumar K.V" , "ceph-devel@vger.kernel.org" , qemu-devel@nongnu.org Cc: Sage Weil , haomaiwang@gmail.com, gkurz@linux.vnet.ibm.com, gfarnum@redhat.com, mst@redhat.com List-Id: ceph-devel.vger.kernel.org On 14/2/16 14:01, Aneesh Kumar K.V wrote: >> 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. Sure thing. "AGESIZE" is supposed to be "PAGESIZE". Thanks, Jevon > -aneesh > From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUqNw-0002ht-3Y for qemu-devel@nongnu.org; Sun, 14 Feb 2016 01:42:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aUqNs-00085i-4J for qemu-devel@nongnu.org; Sun, 14 Feb 2016 01:42:20 -0500 Received: from mail-pa0-x22f.google.com ([2607:f8b0:400e:c03::22f]:33299) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUqNr-00085c-S7 for qemu-devel@nongnu.org; Sun, 14 Feb 2016 01:42:16 -0500 Received: by mail-pa0-x22f.google.com with SMTP id fl4so56725572pad.0 for ; Sat, 13 Feb 2016 22:42:15 -0800 (PST) References: <56C00B60.6000502@gmail.com> <874mdbakzw.fsf@linux.vnet.ibm.com> From: Jevon Qiao Message-ID: <56C021B4.4040705@gmail.com> Date: Sun, 14 Feb 2016 14:41:56 +0800 MIME-Version: 1.0 In-Reply-To: <874mdbakzw.fsf@linux.vnet.ibm.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] add CephFS support in VirtFS List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Aneesh Kumar K.V" , "ceph-devel@vger.kernel.org" , qemu-devel@nongnu.org Cc: Sage Weil , haomaiwang@gmail.com, gkurz@linux.vnet.ibm.com, gfarnum@redhat.com, mst@redhat.com On 14/2/16 14:01, Aneesh Kumar K.V wrote: >> 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. Sure thing. "AGESIZE" is supposed to be "PAGESIZE". Thanks, Jevon > -aneesh >