]> git.proxmox.com Git - mirror_qemu.git/blob - hw/9pfs/coxattr.c
Merge remote-tracking branch 'qemu-kvm/memory/batch' into staging
[mirror_qemu.git] / hw / 9pfs / coxattr.c
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_llistxattr(V9fsState *s, V9fsString *path, void *value, size_t size)
21 {
22 int err;
23
24 v9fs_co_run_in_worker(
25 {
26 err = s->ops->llistxattr(&s->ctx, path->data, value, size);
27 if (err < 0) {
28 err = -errno;
29 }
30 });
31 return err;
32 }
33
34 int v9fs_co_lgetxattr(V9fsState *s, V9fsString *path,
35 V9fsString *xattr_name,
36 void *value, size_t size)
37 {
38 int err;
39
40 v9fs_co_run_in_worker(
41 {
42 err = s->ops->lgetxattr(&s->ctx, path->data,
43 xattr_name->data,
44 value, size);
45 if (err < 0) {
46 err = -errno;
47 }
48 });
49 return err;
50 }
51
52 int v9fs_co_lsetxattr(V9fsState *s, V9fsString *path,
53 V9fsString *xattr_name, void *value,
54 size_t size, int flags)
55 {
56 int err;
57
58 v9fs_co_run_in_worker(
59 {
60 err = s->ops->lsetxattr(&s->ctx, path->data,
61 xattr_name->data, value,
62 size, flags);
63 if (err < 0) {
64 err = -errno;
65 }
66 });
67 return err;
68 }
69
70 int v9fs_co_lremovexattr(V9fsState *s, V9fsString *path,
71 V9fsString *xattr_name)
72 {
73 int err;
74
75 v9fs_co_run_in_worker(
76 {
77 err = s->ops->lremovexattr(&s->ctx, path->data,
78 xattr_name->data);
79 if (err < 0) {
80 err = -errno;
81 }
82 });
83 return err;
84 }