]>
git.proxmox.com Git - mirror_qemu.git/blob - fsdev/file-op-9p.h
4 * Copyright IBM, Corp. 2010
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 #include <sys/types.h>
22 #define SM_LOCAL_MODE_BITS 0600
23 #define SM_LOCAL_DIR_MODE_BITS 0700
28 * Server will try to set uid/gid.
29 * On failure ignore the error.
33 * uid/gid set on fileserver files
37 * uid/gid part of xattr
50 struct xattr_operations
;
52 typedef struct FsContext
57 struct xattr_operations
**xops
;
60 typedef struct V9fsPath
{
65 void cred_init(FsCred
*);
67 typedef struct FileOperations
69 int (*lstat
)(FsContext
*, V9fsPath
*, struct stat
*);
70 ssize_t (*readlink
)(FsContext
*, V9fsPath
*, char *, size_t);
71 int (*chmod
)(FsContext
*, V9fsPath
*, FsCred
*);
72 int (*chown
)(FsContext
*, V9fsPath
*, FsCred
*);
73 int (*mknod
)(FsContext
*, V9fsPath
*, const char *, FsCred
*);
74 int (*utimensat
)(FsContext
*, V9fsPath
*, const struct timespec
*);
75 int (*remove
)(FsContext
*, const char *);
76 int (*symlink
)(FsContext
*, const char *, V9fsPath
*,
77 const char *, FsCred
*);
78 int (*link
)(FsContext
*, V9fsPath
*, V9fsPath
*, const char *);
79 int (*setuid
)(FsContext
*, uid_t
);
80 int (*close
)(FsContext
*, int);
81 int (*closedir
)(FsContext
*, DIR *);
82 DIR *(*opendir
)(FsContext
*, V9fsPath
*);
83 int (*open
)(FsContext
*, V9fsPath
*, int);
84 int (*open2
)(FsContext
*, V9fsPath
*, const char *, int, FsCred
*);
85 void (*rewinddir
)(FsContext
*, DIR *);
86 off_t (*telldir
)(FsContext
*, DIR *);
87 int (*readdir_r
)(FsContext
*, DIR *, struct dirent
*, struct dirent
**);
88 void (*seekdir
)(FsContext
*, DIR *, off_t
);
89 ssize_t (*preadv
)(FsContext
*, int, const struct iovec
*, int, off_t
);
90 ssize_t (*pwritev
)(FsContext
*, int, const struct iovec
*, int, off_t
);
91 int (*mkdir
)(FsContext
*, V9fsPath
*, const char *, FsCred
*);
92 int (*fstat
)(FsContext
*, int, struct stat
*);
93 int (*rename
)(FsContext
*, const char *, const char *);
94 int (*truncate
)(FsContext
*, V9fsPath
*, off_t
);
95 int (*fsync
)(FsContext
*, int, int);
96 int (*statfs
)(FsContext
*s
, V9fsPath
*path
, struct statfs
*stbuf
);
97 ssize_t (*lgetxattr
)(FsContext
*, V9fsPath
*,
98 const char *, void *, size_t);
99 ssize_t (*llistxattr
)(FsContext
*, V9fsPath
*, void *, size_t);
100 int (*lsetxattr
)(FsContext
*, V9fsPath
*,
101 const char *, void *, size_t, int);
102 int (*lremovexattr
)(FsContext
*, V9fsPath
*, const char *);
103 int (*name_to_path
)(FsContext
*, V9fsPath
*, const char *, V9fsPath
*);
104 int (*renameat
)(FsContext
*ctx
, V9fsPath
*olddir
, const char *old_name
,
105 V9fsPath
*newdir
, const char *new_name
);
106 int (*unlinkat
)(FsContext
*ctx
, V9fsPath
*dir
, const char *name
, int flags
);