5 * Copyright IBM, Corp. 2011
8 * Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
10 * This work is licensed under the terms of the GNU GPL, version 2. See
11 * the COPYING file in the top-level directory.
15 #include "fsdev/qemu-fsdev.h"
16 #include "qemu/thread.h"
17 #include "block/coroutine.h"
18 #include "virtio-9p-coth.h"
20 int v9fs_co_llistxattr(V9fsPDU
*pdu
, V9fsPath
*path
, void *value
, size_t size
)
23 V9fsState
*s
= pdu
->s
;
25 if (v9fs_request_cancelled(pdu
)) {
28 v9fs_path_read_lock(s
);
29 v9fs_co_run_in_worker(
31 err
= s
->ops
->llistxattr(&s
->ctx
, path
, value
, size
);
40 int v9fs_co_lgetxattr(V9fsPDU
*pdu
, V9fsPath
*path
,
41 V9fsString
*xattr_name
,
42 void *value
, size_t size
)
45 V9fsState
*s
= pdu
->s
;
47 if (v9fs_request_cancelled(pdu
)) {
50 v9fs_path_read_lock(s
);
51 v9fs_co_run_in_worker(
53 err
= s
->ops
->lgetxattr(&s
->ctx
, path
,
64 int v9fs_co_lsetxattr(V9fsPDU
*pdu
, V9fsPath
*path
,
65 V9fsString
*xattr_name
, void *value
,
66 size_t size
, int flags
)
69 V9fsState
*s
= pdu
->s
;
71 if (v9fs_request_cancelled(pdu
)) {
74 v9fs_path_read_lock(s
);
75 v9fs_co_run_in_worker(
77 err
= s
->ops
->lsetxattr(&s
->ctx
, path
,
78 xattr_name
->data
, value
,
88 int v9fs_co_lremovexattr(V9fsPDU
*pdu
, V9fsPath
*path
,
89 V9fsString
*xattr_name
)
92 V9fsState
*s
= pdu
->s
;
94 if (v9fs_request_cancelled(pdu
)) {
97 v9fs_path_read_lock(s
);
98 v9fs_co_run_in_worker(
100 err
= s
->ops
->lremovexattr(&s
->ctx
, path
, xattr_name
->data
);