summaryrefslogtreecommitdiff
path: root/fsdev
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2011-09-09 15:14:18 +0530
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2011-09-22 21:38:52 +0530
commit2289be19aecc290263ef1f3c1f4a0e9ea32aaad6 (patch)
treef9049e0b36dce4289995e8d3519b20255c4a4b7f /fsdev
parent02cb7f3a256517cbf3136caff2863fbafc57b540 (diff)
downloadqemu-2289be19aecc290263ef1f3c1f4a0e9ea32aaad6.tar.gz
qemu-2289be19aecc290263ef1f3c1f4a0e9ea32aaad6.tar.bz2
qemu-2289be19aecc290263ef1f3c1f4a0e9ea32aaad6.zip
hw/9pfs: Move fid pathname tracking to seperate data type.
This enables us to add handles to track fids later. The V9fsPath added is similar to V9fsString except that the size include the NULL byte also. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'fsdev')
-rw-r--r--fsdev/file-op-9p.h46
1 files changed, 28 insertions, 18 deletions
diff --git a/fsdev/file-op-9p.h b/fsdev/file-op-9p.h
index 1eda342f69..8a7dbdbea4 100644
--- a/fsdev/file-op-9p.h
+++ b/fsdev/file-op-9p.h
@@ -57,43 +57,53 @@ typedef struct FsContext
struct xattr_operations **xops;
} FsContext;
+typedef struct V9fsPath {
+ int16_t size;
+ char *data;
+} V9fsPath;
+
void cred_init(FsCred *);
typedef struct FileOperations
{
- int (*lstat)(FsContext *, const char *, struct stat *);
- ssize_t (*readlink)(FsContext *, const char *, char *, size_t);
- int (*chmod)(FsContext *, const char *, FsCred *);
- int (*chown)(FsContext *, const char *, FsCred *);
- int (*mknod)(FsContext *, const char *, FsCred *);
- int (*utimensat)(FsContext *, const char *, const struct timespec *);
+ int (*lstat)(FsContext *, V9fsPath *, struct stat *);
+ ssize_t (*readlink)(FsContext *, V9fsPath *, char *, size_t);
+ int (*chmod)(FsContext *, V9fsPath *, FsCred *);
+ int (*chown)(FsContext *, V9fsPath *, FsCred *);
+ int (*mknod)(FsContext *, V9fsPath *, const char *, FsCred *);
+ int (*utimensat)(FsContext *, V9fsPath *, const struct timespec *);
int (*remove)(FsContext *, const char *);
- int (*symlink)(FsContext *, const char *, const char *, FsCred *);
- int (*link)(FsContext *, const char *, const char *);
+ int (*symlink)(FsContext *, const char *, V9fsPath *,
+ const char *, FsCred *);
+ int (*link)(FsContext *, V9fsPath *, V9fsPath *, const char *);
int (*setuid)(FsContext *, uid_t);
int (*close)(FsContext *, int);
int (*closedir)(FsContext *, DIR *);
- DIR *(*opendir)(FsContext *, const char *);
- int (*open)(FsContext *, const char *, int);
- int (*open2)(FsContext *, const char *, int, FsCred *);
+ DIR *(*opendir)(FsContext *, V9fsPath *);
+ int (*open)(FsContext *, V9fsPath *, int);
+ int (*open2)(FsContext *, V9fsPath *, const char *, int, FsCred *);
void (*rewinddir)(FsContext *, DIR *);
off_t (*telldir)(FsContext *, DIR *);
int (*readdir_r)(FsContext *, DIR *, struct dirent *, struct dirent **);
void (*seekdir)(FsContext *, DIR *, off_t);
ssize_t (*preadv)(FsContext *, int, const struct iovec *, int, off_t);
ssize_t (*pwritev)(FsContext *, int, const struct iovec *, int, off_t);
- int (*mkdir)(FsContext *, const char *, FsCred *);
+ int (*mkdir)(FsContext *, V9fsPath *, const char *, FsCred *);
int (*fstat)(FsContext *, int, struct stat *);
int (*rename)(FsContext *, const char *, const char *);
- int (*truncate)(FsContext *, const char *, off_t);
+ int (*truncate)(FsContext *, V9fsPath *, off_t);
int (*fsync)(FsContext *, int, int);
- int (*statfs)(FsContext *s, const char *path, struct statfs *stbuf);
- ssize_t (*lgetxattr)(FsContext *, const char *,
+ int (*statfs)(FsContext *s, V9fsPath *path, struct statfs *stbuf);
+ ssize_t (*lgetxattr)(FsContext *, V9fsPath *,
const char *, void *, size_t);
- ssize_t (*llistxattr)(FsContext *, const char *, void *, size_t);
- int (*lsetxattr)(FsContext *, const char *,
+ ssize_t (*llistxattr)(FsContext *, V9fsPath *, void *, size_t);
+ int (*lsetxattr)(FsContext *, V9fsPath *,
const char *, void *, size_t, int);
- int (*lremovexattr)(FsContext *, const char *, const char *);
+ int (*lremovexattr)(FsContext *, V9fsPath *, const char *);
+ int (*name_to_path)(FsContext *, V9fsPath *, const char *, V9fsPath *);
+ int (*renameat)(FsContext *ctx, V9fsPath *olddir, const char *old_name,
+ V9fsPath *newdir, const char *new_name);
+ int (*unlinkat)(FsContext *ctx, V9fsPath *dir, const char *name, int flags);
void *opaque;
} FileOperations;