Statistics
| Branch: | Revision:

root / hw / 9pfs / cofile.c @ 03feb1e1

History | View | Annotate | Download (924 Bytes)

1

    
2
/*
3
 * Virtio 9p backend
4
 *
5
 * Copyright IBM, Corp. 2011
6
 *
7
 * Authors:
8
 *  Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
9
 *
10
 * This work is licensed under the terms of the GNU GPL, version 2.  See
11
 * the COPYING file in the top-level directory.
12
 *
13
 */
14

    
15
#include "fsdev/qemu-fsdev.h"
16
#include "qemu-thread.h"
17
#include "qemu-coroutine.h"
18
#include "virtio-9p-coth.h"
19

    
20
int v9fs_co_lstat(V9fsState *s, V9fsString *path, struct stat *stbuf)
21
{
22
    int err;
23

    
24
    v9fs_co_run_in_worker(
25
        {
26
            err = s->ops->lstat(&s->ctx, path->data, stbuf);
27
            if (err < 0) {
28
                err = -errno;
29
            }
30
        });
31
    return err;
32
}
33

    
34
int v9fs_co_fstat(V9fsState *s, int fd, struct stat *stbuf)
35
{
36
    int err;
37

    
38
    v9fs_co_run_in_worker(
39
        {
40
            err = s->ops->fstat(&s->ctx, fd, stbuf);
41
            if (err < 0) {
42
                err = -errno;
43
            }
44
        });
45
    return err;
46
}