Patchwork [5/6] hw/9pfs: Use v9fs_do_close instead of close

login
register
mail settings
Submitter Aneesh Kumar K.V
Date June 6, 2011, 5:16 p.m.
Message ID <1307380618-1963-5-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/99010/
State New
Headers show

Comments

Aneesh Kumar K.V - June 6, 2011, 5:16 p.m.
we should use the local abstraction instead of
directly calling close.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
 hw/9pfs/virtio-9p.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
jvrao - June 10, 2011, 1:32 a.m.
On 06/06/2011 10:16 AM, Aneesh Kumar K.V wrote:
> we should use the local abstraction instead of
> directly calling close.
>
Let us fold this also into our coroutine patches.

- JV

> Signed-off-by: Aneesh Kumar K.V<aneesh.kumar@linux.vnet.ibm.com>
> ---
>   hw/9pfs/virtio-9p.c |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
> index 21e07fb..d322814 100644
> --- a/hw/9pfs/virtio-9p.c
> +++ b/hw/9pfs/virtio-9p.c
> @@ -1596,7 +1596,7 @@ static void v9fs_lcreate(void *opaque)
>       if (err<  0) {
>           fidp->fid_type = P9_FID_NONE;
>           if (fidp->fs.fd>  0) {
> -            close(fidp->fs.fd);
> +            v9fs_co_close(pdu->s, fidp->fs.fd);
>           }
>           goto out;
>       }
> @@ -2164,7 +2164,7 @@ static void v9fs_create(void *opaque)
>       if (err<  0) {
>           fidp->fid_type = P9_FID_NONE;
>           if (fidp->fs.fd) {
> -            close(fidp->fs.fd);
> +            v9fs_co_close(pdu->s, fidp->fs.fd);
>           }
>           goto out;
>       }

Patch

diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
index 21e07fb..d322814 100644
--- a/hw/9pfs/virtio-9p.c
+++ b/hw/9pfs/virtio-9p.c
@@ -1596,7 +1596,7 @@  static void v9fs_lcreate(void *opaque)
     if (err < 0) {
         fidp->fid_type = P9_FID_NONE;
         if (fidp->fs.fd > 0) {
-            close(fidp->fs.fd);
+            v9fs_co_close(pdu->s, fidp->fs.fd);
         }
         goto out;
     }
@@ -2164,7 +2164,7 @@  static void v9fs_create(void *opaque)
     if (err < 0) {
         fidp->fid_type = P9_FID_NONE;
         if (fidp->fs.fd) {
-            close(fidp->fs.fd);
+            v9fs_co_close(pdu->s, fidp->fs.fd);
         }
         goto out;
     }