From patchwork Tue May 17 19:43:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jvrao X-Patchwork-Id: 96020 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id AD83EB6EEC for ; Wed, 18 May 2011 05:48:53 +1000 (EST) Received: from localhost ([::1]:45090 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMQGB-000183-3C for incoming@patchwork.ozlabs.org; Tue, 17 May 2011 15:48:51 -0400 Received: from eggs.gnu.org ([140.186.70.92]:34511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMQBy-0002JJ-JK for qemu-devel@nongnu.org; Tue, 17 May 2011 15:44:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QMQBv-00020k-4j for qemu-devel@nongnu.org; Tue, 17 May 2011 15:44:30 -0400 Received: from e36.co.us.ibm.com ([32.97.110.154]:51889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMQBu-00020I-Vy for qemu-devel@nongnu.org; Tue, 17 May 2011 15:44:27 -0400 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by e36.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id p4HJcbGN022255 for ; Tue, 17 May 2011 13:38:37 -0600 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p4HJiJwa083946 for ; Tue, 17 May 2011 13:44:19 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p4HDhp5D018262 for ; Tue, 17 May 2011 07:43:52 -0600 Received: from oc6675851006.ibm.com (dyn9047029068.beaverton.ibm.com [9.47.29.68]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p4HDhZkQ016491; Tue, 17 May 2011 07:43:50 -0600 From: "Venkateswararao Jujjuri (JV)" To: qemu-devel@nongnu.org Date: Tue, 17 May 2011 12:43:37 -0700 Message-Id: <1305661431-21289-12-git-send-email-jvrao@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1305661431-21289-1-git-send-email-jvrao@linux.vnet.ibm.com> References: <1305661431-21289-1-git-send-email-jvrao@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 32.97.110.154 Cc: aliguori@us.ibm.com, "Venkateswararao Jujjuri \"" , stefanha@linux.vnet.ibm.com, "Aneesh Kumar K.V" Subject: [Qemu-devel] [V2 11/25] hw/9pfs: Add yield support to statfs coroutine X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Aneesh Kumar K.V Signed-off-by: Aneesh Kumar K.V Signed-off-by: Venkateswararao Jujjuri " --- hw/9pfs/cofs.c | 14 ++++++++++++++ hw/9pfs/virtio-9p-coth.h | 1 + 2 files changed, 15 insertions(+), 0 deletions(-) diff --git a/hw/9pfs/cofs.c b/hw/9pfs/cofs.c index 6d94673..f79564b 100644 --- a/hw/9pfs/cofs.c +++ b/hw/9pfs/cofs.c @@ -40,3 +40,17 @@ int v9fs_co_readlink(V9fsState *s, V9fsString *path, V9fsString *buf) buf->data = tbuf.data; return err; } + +int v9fs_co_statfs(V9fsState *s, V9fsString *path, struct statfs *stbuf) +{ + int err; + + v9fs_co_run_in_worker( + { + err = s->ops->statfs(&s->ctx, path->data, stbuf); + if (err < 0) { + err = -errno; + } + }); + return err; +} diff --git a/hw/9pfs/virtio-9p-coth.h b/hw/9pfs/virtio-9p-coth.h index 9aa5953..5d9dc0f 100644 --- a/hw/9pfs/virtio-9p-coth.h +++ b/hw/9pfs/virtio-9p-coth.h @@ -62,4 +62,5 @@ extern int v9fs_co_readdir(V9fsState *, V9fsFidState *, extern off_t v9fs_co_telldir(V9fsState *, V9fsFidState *); extern void v9fs_co_seekdir(V9fsState *, V9fsFidState *, off_t); extern void v9fs_co_rewinddir(V9fsState *, V9fsFidState *); +extern int v9fs_co_statfs(V9fsState *, V9fsString *, struct statfs *); #endif