9pfs: fix some type definitions
To comply with the QEMU coding style. Signed-off-by: Greg Kurz <groug@kaod.org>
This commit is contained in:
parent
1a8d0bb31a
commit
8e71b96c62
|
@ -99,10 +99,10 @@ static int omode_to_uflags(int8_t mode)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct dotl_openflag_map {
|
typedef struct DotlOpenflagMap {
|
||||||
int dotl_flag;
|
int dotl_flag;
|
||||||
int open_flag;
|
int open_flag;
|
||||||
};
|
} DotlOpenflagMap;
|
||||||
|
|
||||||
static int dotl_to_open_flags(int flags)
|
static int dotl_to_open_flags(int flags)
|
||||||
{
|
{
|
||||||
|
@ -113,7 +113,7 @@ static int dotl_to_open_flags(int flags)
|
||||||
*/
|
*/
|
||||||
int oflags = flags & O_ACCMODE;
|
int oflags = flags & O_ACCMODE;
|
||||||
|
|
||||||
struct dotl_openflag_map dotl_oflag_map[] = {
|
DotlOpenflagMap dotl_oflag_map[] = {
|
||||||
{ P9_DOTL_CREATE, O_CREAT },
|
{ P9_DOTL_CREATE, O_CREAT },
|
||||||
{ P9_DOTL_EXCL, O_EXCL },
|
{ P9_DOTL_EXCL, O_EXCL },
|
||||||
{ P9_DOTL_NOCTTY , O_NOCTTY },
|
{ P9_DOTL_NOCTTY , O_NOCTTY },
|
||||||
|
|
12
hw/9pfs/9p.h
12
hw/9pfs/9p.h
|
@ -94,10 +94,10 @@ enum {
|
||||||
P9_QTFILE = 0x00,
|
P9_QTFILE = 0x00,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum p9_proto_version {
|
typedef enum P9ProtoVersion {
|
||||||
V9FS_PROTO_2000U = 0x01,
|
V9FS_PROTO_2000U = 0x01,
|
||||||
V9FS_PROTO_2000L = 0x02,
|
V9FS_PROTO_2000L = 0x02,
|
||||||
};
|
} P9ProtoVersion;
|
||||||
|
|
||||||
#define P9_NOTAG UINT16_MAX
|
#define P9_NOTAG UINT16_MAX
|
||||||
#define P9_NOFID UINT32_MAX
|
#define P9_NOFID UINT32_MAX
|
||||||
|
@ -118,6 +118,7 @@ static inline char *rpath(FsContext *ctx, const char *path)
|
||||||
|
|
||||||
typedef struct V9fsPDU V9fsPDU;
|
typedef struct V9fsPDU V9fsPDU;
|
||||||
typedef struct V9fsState V9fsState;
|
typedef struct V9fsState V9fsState;
|
||||||
|
typedef struct V9fsTransport V9fsTransport;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t size_le;
|
uint32_t size_le;
|
||||||
|
@ -238,10 +239,10 @@ struct V9fsState
|
||||||
FileOperations *ops;
|
FileOperations *ops;
|
||||||
FsContext ctx;
|
FsContext ctx;
|
||||||
char *tag;
|
char *tag;
|
||||||
enum p9_proto_version proto_version;
|
P9ProtoVersion proto_version;
|
||||||
int32_t msize;
|
int32_t msize;
|
||||||
V9fsPDU pdus[MAX_REQ];
|
V9fsPDU pdus[MAX_REQ];
|
||||||
const struct V9fsTransport *transport;
|
const V9fsTransport *transport;
|
||||||
/*
|
/*
|
||||||
* lock ensuring atomic path update
|
* lock ensuring atomic path update
|
||||||
* on rename.
|
* on rename.
|
||||||
|
@ -367,8 +368,7 @@ struct V9fsTransport {
|
||||||
void (*push_and_notify)(V9fsPDU *pdu);
|
void (*push_and_notify)(V9fsPDU *pdu);
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline int v9fs_register_transport(V9fsState *s,
|
static inline int v9fs_register_transport(V9fsState *s, const V9fsTransport *t)
|
||||||
const struct V9fsTransport *t)
|
|
||||||
{
|
{
|
||||||
assert(!s->transport);
|
assert(!s->transport);
|
||||||
s->transport = t;
|
s->transport = t;
|
||||||
|
|
|
@ -184,7 +184,7 @@ static void virtio_init_out_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
|
||||||
*pniov = elem->out_num;
|
*pniov = elem->out_num;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct V9fsTransport virtio_9p_transport = {
|
static const V9fsTransport virtio_9p_transport = {
|
||||||
.pdu_vmarshal = virtio_pdu_vmarshal,
|
.pdu_vmarshal = virtio_pdu_vmarshal,
|
||||||
.pdu_vunmarshal = virtio_pdu_vunmarshal,
|
.pdu_vunmarshal = virtio_pdu_vunmarshal,
|
||||||
.init_in_iov_from_pdu = virtio_init_in_iov_from_pdu,
|
.init_in_iov_from_pdu = virtio_init_in_iov_from_pdu,
|
||||||
|
|
|
@ -233,7 +233,7 @@ static void xen_9pfs_push_and_notify(V9fsPDU *pdu)
|
||||||
qemu_bh_schedule(ring->bh);
|
qemu_bh_schedule(ring->bh);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct V9fsTransport xen_9p_transport = {
|
static const V9fsTransport xen_9p_transport = {
|
||||||
.pdu_vmarshal = xen_9pfs_pdu_vmarshal,
|
.pdu_vmarshal = xen_9pfs_pdu_vmarshal,
|
||||||
.pdu_vunmarshal = xen_9pfs_pdu_vunmarshal,
|
.pdu_vunmarshal = xen_9pfs_pdu_vunmarshal,
|
||||||
.init_in_iov_from_pdu = xen_9pfs_init_in_iov_from_pdu,
|
.init_in_iov_from_pdu = xen_9pfs_init_in_iov_from_pdu,
|
||||||
|
|
Loading…
Reference in New Issue