From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPNtZ-0008Jq-Us for qemu-devel@nongnu.org; Wed, 25 May 2011 19:53:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QPNtO-0007Ty-Ql for qemu-devel@nongnu.org; Wed, 25 May 2011 19:53:45 -0400 Received: from e32.co.us.ibm.com ([32.97.110.150]:35480) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPNtO-0007Ta-Jl for qemu-devel@nongnu.org; Wed, 25 May 2011 19:53:34 -0400 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by e32.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id p4PNg2rX024613 for ; Wed, 25 May 2011 17:42:02 -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 p4PNrTac151850 for ; Wed, 25 May 2011 17:53:30 -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 p4PHr24U018408 for ; Wed, 25 May 2011 11:53:02 -0600 From: "Venkateswararao Jujjuri (JV)" Date: Wed, 25 May 2011 16:53:01 -0700 Message-Id: <1306367597-797-14-git-send-email-jvrao@linux.vnet.ibm.com> In-Reply-To: <1306367597-797-1-git-send-email-jvrao@linux.vnet.ibm.com> References: <1306367597-797-1-git-send-email-jvrao@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 13/29] hw/9pfs: Add yeild support for clunk related coroutine List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Venkateswararao Jujjuri \"" , stefanha@linux.vnet.ibm.com, "Aneesh Kumar K.V" From: Aneesh Kumar K.V This include lsetxattr, lremovexattr, closedir and close. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Venkateswararao Jujjuri " --- hw/9pfs/codir.c | 16 ++++++++++++++++ hw/9pfs/cofile.c | 16 ++++++++++++++++ hw/9pfs/coxattr.c | 34 ++++++++++++++++++++++++++++++++++ hw/9pfs/virtio-9p-coth.h | 5 +++++ 4 files changed, 71 insertions(+), 0 deletions(-) diff --git a/hw/9pfs/codir.c b/hw/9pfs/codir.c index bc6a105..0c31db3 100644 --- a/hw/9pfs/codir.c +++ b/hw/9pfs/codir.c @@ -99,3 +99,19 @@ int v9fs_co_opendir(V9fsState *s, V9fsFidState *fidp) }); return err; } + +int v9fs_co_closedir(V9fsState *s, V9fsFidState *fidp) +{ + int err; + DIR *dir; + + dir = fidp->fs.dir; + v9fs_co_run_in_worker( + { + err = s->ops->closedir(&s->ctx, dir); + if (err < 0) { + err = -errno; + } + }); + return err; +} diff --git a/hw/9pfs/cofile.c b/hw/9pfs/cofile.c index 4b0d96c..e552999 100644 --- a/hw/9pfs/cofile.c +++ b/hw/9pfs/cofile.c @@ -81,3 +81,19 @@ int v9fs_co_open2(V9fsState *s, V9fsFidState *fidp, char *fullname, gid_t gid, }); return err; } + +int v9fs_co_close(V9fsState *s, V9fsFidState *fidp) +{ + int fd; + int err; + + fd = fidp->fs.fd; + v9fs_co_run_in_worker( + { + err = s->ops->close(&s->ctx, fd); + if (err < 0) { + err = -errno; + } + }); + return err; +} diff --git a/hw/9pfs/coxattr.c b/hw/9pfs/coxattr.c index 2fba2c9..a289389 100644 --- a/hw/9pfs/coxattr.c +++ b/hw/9pfs/coxattr.c @@ -48,3 +48,37 @@ int v9fs_co_lgetxattr(V9fsState *s, V9fsString *path, }); return err; } + +int v9fs_co_lsetxattr(V9fsState *s, V9fsString *path, + V9fsString *xattr_name, void *value, + size_t size, int flags) +{ + int err; + + v9fs_co_run_in_worker( + { + err = s->ops->lsetxattr(&s->ctx, path->data, + xattr_name->data, value, + size, flags); + if (err < 0) { + err = -errno; + } + }); + return err; +} + +int v9fs_co_lremovexattr(V9fsState *s, V9fsString *path, + V9fsString *xattr_name) +{ + int err; + + v9fs_co_run_in_worker( + { + err = s->ops->lremovexattr(&s->ctx, path->data, + xattr_name->data); + if (err < 0) { + err = -errno; + } + }); + return err; +} diff --git a/hw/9pfs/virtio-9p-coth.h b/hw/9pfs/virtio-9p-coth.h index f9610b9..5d7dfd7 100644 --- a/hw/9pfs/virtio-9p-coth.h +++ b/hw/9pfs/virtio-9p-coth.h @@ -80,4 +80,9 @@ extern int v9fs_co_fstat(V9fsState *, int, struct stat *); extern int v9fs_co_opendir(V9fsState *, V9fsFidState *); extern int v9fs_co_open(V9fsState *, V9fsFidState *, int); extern int v9fs_co_open2(V9fsState *, V9fsFidState *, char *, gid_t, int, int); +extern int v9fs_co_lsetxattr(V9fsState *, V9fsString *, V9fsString *, + void *, size_t, int); +extern int v9fs_co_lremovexattr(V9fsState *, V9fsString *, V9fsString *); +extern int v9fs_co_closedir(V9fsState *, V9fsFidState *); +extern int v9fs_co_close(V9fsState *, V9fsFidState *); #endif -- 1.7.1