]> git.proxmox.com Git - mirror_qemu.git/blame - hw/file-op-9p.h
virtio-9p: Add P9_TCREATE support
[mirror_qemu.git] / hw / file-op-9p.h
CommitLineData
74db920c
GS
1/*
2 * Virtio 9p
3 *
4 * Copyright IBM, Corp. 2010
5 *
6 * Authors:
7 * Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
8 *
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
11 *
12 */
13#ifndef _FILEOP_H
14#define _FILEOP_H
15#include <sys/types.h>
16#include <dirent.h>
17#include <sys/time.h>
18#include <utime.h>
19#include <sys/stat.h>
20#include <sys/uio.h>
21
22typedef struct FsContext
23{
24 char *fs_root;
25 uid_t uid;
26} FsContext;
27
28typedef struct FileOperations
29{
131dcb25
AL
30 int (*lstat)(FsContext *, const char *, struct stat *);
31 ssize_t (*readlink)(FsContext *, const char *, char *, size_t);
c494dd6f
AL
32 int (*chmod)(FsContext *, const char *, mode_t);
33 int (*mknod)(FsContext *, const char *, mode_t, dev_t);
34 int (*mksock)(FsContext *, const char *);
35 int (*symlink)(FsContext *, const char *, const char *);
36 int (*link)(FsContext *, const char *, const char *);
131dcb25
AL
37 int (*setuid)(FsContext *, uid_t);
38 int (*close)(FsContext *, int);
39 int (*closedir)(FsContext *, DIR *);
a6568fe2
AL
40 DIR *(*opendir)(FsContext *, const char *);
41 int (*open)(FsContext *, const char *, int);
c494dd6f 42 int (*open2)(FsContext *, const char *, int, mode_t);
a9231555
AL
43 void (*rewinddir)(FsContext *, DIR *);
44 off_t (*telldir)(FsContext *, DIR *);
45 struct dirent *(*readdir)(FsContext *, DIR *);
46 void (*seekdir)(FsContext *, DIR *, off_t);
47 ssize_t (*readv)(FsContext *, int, const struct iovec *, int);
8449360c 48 ssize_t (*writev)(FsContext *, int, const struct iovec *, int);
a9231555 49 off_t (*lseek)(FsContext *, int, off_t, int);
c494dd6f
AL
50 int (*mkdir)(FsContext *, const char *, mode_t);
51 int (*fstat)(FsContext *, int, struct stat *);
74db920c
GS
52 void *opaque;
53} FileOperations;
54#endif