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.
13 #ifndef HW_9PFS_VIRTIO9P_SYNTH_H
14 #define HW_9PFS_VIRTIO9P_SYNTH_H 1
17 #include <sys/types.h>
20 typedef struct V9fsSynthNode V9fsSynthNode
;
21 typedef ssize_t (*v9fs_synth_read
)(void *buf
, int len
, off_t offset
,
23 typedef ssize_t (*v9fs_synth_write
)(void *buf
, int len
, off_t offset
,
25 typedef struct V9fsSynthNodeAttr
{
30 v9fs_synth_write write
;
33 struct V9fsSynthNode
{
34 QLIST_HEAD(, V9fsSynthNode
) child
;
35 QLIST_ENTRY(V9fsSynthNode
) sibling
;
37 V9fsSynthNodeAttr
*attr
;
38 V9fsSynthNodeAttr actual_attr
;
43 typedef struct V9fsSynthOpenState
{
48 extern int qemu_v9fs_synth_mkdir(V9fsSynthNode
*parent
, int mode
,
49 const char *name
, V9fsSynthNode
**result
);
50 extern int qemu_v9fs_synth_add_file(V9fsSynthNode
*parent
, int mode
,
51 const char *name
, v9fs_synth_read read
,
52 v9fs_synth_write write
, void *arg
);