소스 검색

9pfs: handle: fix type definition

To comply with the QEMU coding style.

Signed-off-by: Greg Kurz <groug@kaod.org>
Greg Kurz 7 년 전
부모
커밋
c4ce2c0ff3
1개의 변경된 파일24개의 추가작업 그리고 24개의 파일을 삭제
  1. 24 24
      hw/9pfs/9p-handle.c

+ 24 - 24
hw/9pfs/9p-handle.c

@@ -41,10 +41,10 @@
 #define BTRFS_SUPER_MAGIC 0x9123683E
 #define BTRFS_SUPER_MAGIC 0x9123683E
 #endif
 #endif
 
 
-struct handle_data {
+typedef struct HandleData {
     int mountfd;
     int mountfd;
     int handle_bytes;
     int handle_bytes;
-};
+} HandleData;
 
 
 static inline int name_to_handle(int dirfd, const char *name,
 static inline int name_to_handle(int dirfd, const char *name,
                                  struct file_handle *fh, int *mnt_id, int flags)
                                  struct file_handle *fh, int *mnt_id, int flags)
@@ -79,7 +79,7 @@ static int handle_lstat(FsContext *fs_ctx, V9fsPath *fs_path,
                         struct stat *stbuf)
                         struct stat *stbuf)
 {
 {
     int fd, ret;
     int fd, ret;
-    struct handle_data *data = (struct handle_data *)fs_ctx->private;
+    HandleData *data = (HandleData *) fs_ctx->private;
 
 
     fd = open_by_handle(data->mountfd, fs_path->data, O_PATH);
     fd = open_by_handle(data->mountfd, fs_path->data, O_PATH);
     if (fd < 0) {
     if (fd < 0) {
@@ -94,7 +94,7 @@ static ssize_t handle_readlink(FsContext *fs_ctx, V9fsPath *fs_path,
                                char *buf, size_t bufsz)
                                char *buf, size_t bufsz)
 {
 {
     int fd, ret;
     int fd, ret;
-    struct handle_data *data = (struct handle_data *)fs_ctx->private;
+    HandleData *data = (HandleData *) fs_ctx->private;
 
 
     fd = open_by_handle(data->mountfd, fs_path->data, O_PATH);
     fd = open_by_handle(data->mountfd, fs_path->data, O_PATH);
     if (fd < 0) {
     if (fd < 0) {
@@ -118,7 +118,7 @@ static int handle_closedir(FsContext *ctx, V9fsFidOpenState *fs)
 static int handle_open(FsContext *ctx, V9fsPath *fs_path,
 static int handle_open(FsContext *ctx, V9fsPath *fs_path,
                        int flags, V9fsFidOpenState *fs)
                        int flags, V9fsFidOpenState *fs)
 {
 {
-    struct handle_data *data = (struct handle_data *)ctx->private;
+    HandleData *data = (HandleData *) ctx->private;
 
 
     fs->fd = open_by_handle(data->mountfd, fs_path->data, flags);
     fs->fd = open_by_handle(data->mountfd, fs_path->data, flags);
     return fs->fd;
     return fs->fd;
@@ -207,7 +207,7 @@ static ssize_t handle_pwritev(FsContext *ctx, V9fsFidOpenState *fs,
 static int handle_chmod(FsContext *fs_ctx, V9fsPath *fs_path, FsCred *credp)
 static int handle_chmod(FsContext *fs_ctx, V9fsPath *fs_path, FsCred *credp)
 {
 {
     int fd, ret;
     int fd, ret;
-    struct handle_data *data = (struct handle_data *)fs_ctx->private;
+    HandleData *data = (HandleData *) fs_ctx->private;
 
 
     fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK);
     fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK);
     if (fd < 0) {
     if (fd < 0) {
@@ -222,7 +222,7 @@ static int handle_mknod(FsContext *fs_ctx, V9fsPath *dir_path,
                        const char *name, FsCred *credp)
                        const char *name, FsCred *credp)
 {
 {
     int dirfd, ret;
     int dirfd, ret;
-    struct handle_data *data = (struct handle_data *)fs_ctx->private;
+    HandleData *data = (HandleData *) fs_ctx->private;
 
 
     dirfd = open_by_handle(data->mountfd, dir_path->data, O_PATH);
     dirfd = open_by_handle(data->mountfd, dir_path->data, O_PATH);
     if (dirfd < 0) {
     if (dirfd < 0) {
@@ -240,7 +240,7 @@ static int handle_mkdir(FsContext *fs_ctx, V9fsPath *dir_path,
                        const char *name, FsCred *credp)
                        const char *name, FsCred *credp)
 {
 {
     int dirfd, ret;
     int dirfd, ret;
-    struct handle_data *data = (struct handle_data *)fs_ctx->private;
+    HandleData *data = (HandleData *) fs_ctx->private;
 
 
     dirfd = open_by_handle(data->mountfd, dir_path->data, O_PATH);
     dirfd = open_by_handle(data->mountfd, dir_path->data, O_PATH);
     if (dirfd < 0) {
     if (dirfd < 0) {
@@ -272,7 +272,7 @@ static int handle_open2(FsContext *fs_ctx, V9fsPath *dir_path, const char *name,
 {
 {
     int ret;
     int ret;
     int dirfd, fd;
     int dirfd, fd;
-    struct handle_data *data = (struct handle_data *)fs_ctx->private;
+    HandleData *data = (HandleData *) fs_ctx->private;
 
 
     dirfd = open_by_handle(data->mountfd, dir_path->data, O_PATH);
     dirfd = open_by_handle(data->mountfd, dir_path->data, O_PATH);
     if (dirfd < 0) {
     if (dirfd < 0) {
@@ -297,7 +297,7 @@ static int handle_symlink(FsContext *fs_ctx, const char *oldpath,
                           V9fsPath *dir_path, const char *name, FsCred *credp)
                           V9fsPath *dir_path, const char *name, FsCred *credp)
 {
 {
     int fd, dirfd, ret;
     int fd, dirfd, ret;
-    struct handle_data *data = (struct handle_data *)fs_ctx->private;
+    HandleData *data = (HandleData *) fs_ctx->private;
 
 
     dirfd = open_by_handle(data->mountfd, dir_path->data, O_PATH);
     dirfd = open_by_handle(data->mountfd, dir_path->data, O_PATH);
     if (dirfd < 0) {
     if (dirfd < 0) {
@@ -322,7 +322,7 @@ static int handle_link(FsContext *ctx, V9fsPath *oldpath,
                        V9fsPath *dirpath, const char *name)
                        V9fsPath *dirpath, const char *name)
 {
 {
     int oldfd, newdirfd, ret;
     int oldfd, newdirfd, ret;
-    struct handle_data *data = (struct handle_data *)ctx->private;
+    HandleData *data = (HandleData *) ctx->private;
 
 
     oldfd = open_by_handle(data->mountfd, oldpath->data, O_PATH);
     oldfd = open_by_handle(data->mountfd, oldpath->data, O_PATH);
     if (oldfd < 0) {
     if (oldfd < 0) {
@@ -342,7 +342,7 @@ static int handle_link(FsContext *ctx, V9fsPath *oldpath,
 static int handle_truncate(FsContext *ctx, V9fsPath *fs_path, off_t size)
 static int handle_truncate(FsContext *ctx, V9fsPath *fs_path, off_t size)
 {
 {
     int fd, ret;
     int fd, ret;
-    struct handle_data *data = (struct handle_data *)ctx->private;
+    HandleData *data = (HandleData *) ctx->private;
 
 
     fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK | O_WRONLY);
     fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK | O_WRONLY);
     if (fd < 0) {
     if (fd < 0) {
@@ -363,7 +363,7 @@ static int handle_rename(FsContext *ctx, const char *oldpath,
 static int handle_chown(FsContext *fs_ctx, V9fsPath *fs_path, FsCred *credp)
 static int handle_chown(FsContext *fs_ctx, V9fsPath *fs_path, FsCred *credp)
 {
 {
     int fd, ret;
     int fd, ret;
-    struct handle_data *data = (struct handle_data *)fs_ctx->private;
+    HandleData *data = (HandleData *) fs_ctx->private;
 
 
     fd = open_by_handle(data->mountfd, fs_path->data, O_PATH);
     fd = open_by_handle(data->mountfd, fs_path->data, O_PATH);
     if (fd < 0) {
     if (fd < 0) {
@@ -379,7 +379,7 @@ static int handle_utimensat(FsContext *ctx, V9fsPath *fs_path,
 {
 {
     int ret;
     int ret;
     int fd;
     int fd;
-    struct handle_data *data = (struct handle_data *)ctx->private;
+    HandleData *data = (HandleData *) ctx->private;
 
 
     fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK);
     fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK);
     if (fd < 0) {
     if (fd < 0) {
@@ -418,7 +418,7 @@ static int handle_statfs(FsContext *ctx, V9fsPath *fs_path,
                          struct statfs *stbuf)
                          struct statfs *stbuf)
 {
 {
     int fd, ret;
     int fd, ret;
-    struct handle_data *data = (struct handle_data *)ctx->private;
+    HandleData *data = (HandleData *) ctx->private;
 
 
     fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK);
     fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK);
     if (fd < 0) {
     if (fd < 0) {
@@ -433,7 +433,7 @@ static ssize_t handle_lgetxattr(FsContext *ctx, V9fsPath *fs_path,
                                 const char *name, void *value, size_t size)
                                 const char *name, void *value, size_t size)
 {
 {
     int fd, ret;
     int fd, ret;
-    struct handle_data *data = (struct handle_data *)ctx->private;
+    HandleData *data = (HandleData *) ctx->private;
 
 
     fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK);
     fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK);
     if (fd < 0) {
     if (fd < 0) {
@@ -448,7 +448,7 @@ static ssize_t handle_llistxattr(FsContext *ctx, V9fsPath *fs_path,
                                  void *value, size_t size)
                                  void *value, size_t size)
 {
 {
     int fd, ret;
     int fd, ret;
-    struct handle_data *data = (struct handle_data *)ctx->private;
+    HandleData *data = (HandleData *) ctx->private;
 
 
     fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK);
     fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK);
     if (fd < 0) {
     if (fd < 0) {
@@ -463,7 +463,7 @@ static int handle_lsetxattr(FsContext *ctx, V9fsPath *fs_path, const char *name,
                             void *value, size_t size, int flags)
                             void *value, size_t size, int flags)
 {
 {
     int fd, ret;
     int fd, ret;
-    struct handle_data *data = (struct handle_data *)ctx->private;
+    HandleData *data = (HandleData *) ctx->private;
 
 
     fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK);
     fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK);
     if (fd < 0) {
     if (fd < 0) {
@@ -478,7 +478,7 @@ static int handle_lremovexattr(FsContext *ctx, V9fsPath *fs_path,
                                const char *name)
                                const char *name)
 {
 {
     int fd, ret;
     int fd, ret;
-    struct handle_data *data = (struct handle_data *)ctx->private;
+    HandleData *data = (HandleData *) ctx->private;
 
 
     fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK);
     fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK);
     if (fd < 0) {
     if (fd < 0) {
@@ -495,7 +495,7 @@ static int handle_name_to_path(FsContext *ctx, V9fsPath *dir_path,
     char *buffer;
     char *buffer;
     struct file_handle *fh;
     struct file_handle *fh;
     int dirfd, ret, mnt_id;
     int dirfd, ret, mnt_id;
-    struct handle_data *data = (struct handle_data *)ctx->private;
+    HandleData *data = (HandleData *) ctx->private;
 
 
     /* "." and ".." are not allowed */
     /* "." and ".." are not allowed */
     if (!strcmp(name, ".") || !strcmp(name, "..")) {
     if (!strcmp(name, ".") || !strcmp(name, "..")) {
@@ -536,7 +536,7 @@ static int handle_renameat(FsContext *ctx, V9fsPath *olddir,
                            const char *new_name)
                            const char *new_name)
 {
 {
     int olddirfd, newdirfd, ret;
     int olddirfd, newdirfd, ret;
-    struct handle_data *data = (struct handle_data *)ctx->private;
+    HandleData *data = (HandleData *) ctx->private;
 
 
     olddirfd = open_by_handle(data->mountfd, olddir->data, O_PATH);
     olddirfd = open_by_handle(data->mountfd, olddir->data, O_PATH);
     if (olddirfd < 0) {
     if (olddirfd < 0) {
@@ -557,7 +557,7 @@ static int handle_unlinkat(FsContext *ctx, V9fsPath *dir,
                            const char *name, int flags)
                            const char *name, int flags)
 {
 {
     int dirfd, ret;
     int dirfd, ret;
-    struct handle_data *data = (struct handle_data *)ctx->private;
+    HandleData *data = (HandleData *) ctx->private;
     int rflags;
     int rflags;
 
 
     dirfd = open_by_handle(data->mountfd, dir->data, O_PATH);
     dirfd = open_by_handle(data->mountfd, dir->data, O_PATH);
@@ -609,7 +609,7 @@ static int handle_init(FsContext *ctx)
     int ret, mnt_id;
     int ret, mnt_id;
     struct statfs stbuf;
     struct statfs stbuf;
     struct file_handle fh;
     struct file_handle fh;
-    struct handle_data *data = g_malloc(sizeof(struct handle_data));
+    HandleData *data = g_malloc(sizeof(HandleData));
 
 
     data->mountfd = open(ctx->fs_root, O_DIRECTORY);
     data->mountfd = open(ctx->fs_root, O_DIRECTORY);
     if (data->mountfd < 0) {
     if (data->mountfd < 0) {
@@ -646,7 +646,7 @@ out:
 
 
 static void handle_cleanup(FsContext *ctx)
 static void handle_cleanup(FsContext *ctx)
 {
 {
-    struct handle_data *data = ctx->private;
+    HandleData *data = ctx->private;
 
 
     close(data->mountfd);
     close(data->mountfd);
     g_free(data);
     g_free(data);