diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-09-29 13:32:05 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-09-29 13:32:05 -0500 |
commit | 62ec6073cd07b847c296b3a1fa19894293f8155d (patch) | |
tree | 19fc1772d9cabd7f5590e33374d58a3f4b38d0ba /fsdev/file-op-9p.h | |
parent | 0bce98df2639aef1e8af90b271aa91e16d695408 (diff) | |
parent | 5f5422258e1f50f871bafcc5bfb2b498f414a310 (diff) |
Merge remote-tracking branch 'aneesh/for-upstream-5' into staging
Diffstat (limited to 'fsdev/file-op-9p.h')
-rw-r--r-- | fsdev/file-op-9p.h | 54 |
1 files changed, 36 insertions, 18 deletions
diff --git a/fsdev/file-op-9p.h b/fsdev/file-op-9p.h index 1eda342f69..8de8abfd5b 100644 --- a/fsdev/file-op-9p.h +++ b/fsdev/file-op-9p.h @@ -19,6 +19,7 @@ #include <sys/stat.h> #include <sys/uio.h> #include <sys/vfs.h> + #define SM_LOCAL_MODE_BITS 0600 #define SM_LOCAL_DIR_MODE_BITS 0700 @@ -49,51 +50,68 @@ typedef struct FsCred struct xattr_operations; +/* FsContext flag values */ +#define PATHNAME_FSCONTEXT 0x1 + typedef struct FsContext { + int flags; char *fs_root; SecModel fs_sm; uid_t uid; struct xattr_operations **xops; + /* fs driver specific data */ + void *private; } 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 (*init)(struct FsContext *); + 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; |