4 * Copyright IBM, Corp. 2011
7 * Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
15 * Not so fast! You might want to read the 9p developer docs first:
16 * https://wiki.qemu.org/Documentation/9p
19 #include "qemu/osdep.h"
20 #include "fsdev/qemu-fsdev.h"
21 #include "qemu/thread.h"
22 #include "qemu/coroutine.h"
23 #include "qemu/main-loop.h"
26 int coroutine_fn
v9fs_co_llistxattr(V9fsPDU
*pdu
, V9fsPath
*path
, void *value
,
30 V9fsState
*s
= pdu
->s
;
32 if (v9fs_request_cancelled(pdu
)) {
35 v9fs_path_read_lock(s
);
36 v9fs_co_run_in_worker(
38 err
= s
->ops
->llistxattr(&s
->ctx
, path
, value
, size
);
47 int coroutine_fn
v9fs_co_lgetxattr(V9fsPDU
*pdu
, V9fsPath
*path
,
48 V9fsString
*xattr_name
, void *value
,
52 V9fsState
*s
= pdu
->s
;
54 if (v9fs_request_cancelled(pdu
)) {
57 v9fs_path_read_lock(s
);
58 v9fs_co_run_in_worker(
60 err
= s
->ops
->lgetxattr(&s
->ctx
, path
,
71 int coroutine_fn
v9fs_co_lsetxattr(V9fsPDU
*pdu
, V9fsPath
*path
,
72 V9fsString
*xattr_name
, void *value
,
73 size_t size
, int flags
)
76 V9fsState
*s
= pdu
->s
;
78 if (v9fs_request_cancelled(pdu
)) {
81 v9fs_path_read_lock(s
);
82 v9fs_co_run_in_worker(
84 err
= s
->ops
->lsetxattr(&s
->ctx
, path
,
85 xattr_name
->data
, value
,
95 int coroutine_fn
v9fs_co_lremovexattr(V9fsPDU
*pdu
, V9fsPath
*path
,
96 V9fsString
*xattr_name
)
99 V9fsState
*s
= pdu
->s
;
101 if (v9fs_request_cancelled(pdu
)) {
104 v9fs_path_read_lock(s
);
105 v9fs_co_run_in_worker(
107 err
= s
->ops
->lremovexattr(&s
->ctx
, path
, xattr_name
->data
);