Revision 8b888272 hw/9pfs/virtio-9p-handle.c

b/hw/9pfs/virtio-9p-handle.c
255 255
    return ret;
256 256
}
257 257

  
258
static int handle_fstat(FsContext *fs_ctx, V9fsFidOpenState *fs,
259
                        struct stat *stbuf)
258
static int handle_fstat(FsContext *fs_ctx, int fid_type,
259
                        V9fsFidOpenState *fs, struct stat *stbuf)
260 260
{
261
    return fstat(fs->fd, stbuf);
261
    int fd;
262

  
263
    if (fid_type == P9_FID_DIR) {
264
        fd = dirfd(fs->dir);
265
    } else {
266
        fd = fs->fd;
267
    }
268
    return fstat(fd, stbuf);
262 269
}
263 270

  
264 271
static int handle_open2(FsContext *fs_ctx, V9fsPath *dir_path, const char *name,
......
395 402
    return -1;
396 403
}
397 404

  
398
static int handle_fsync(FsContext *ctx, V9fsFidOpenState *fs, int datasync)
405
static int handle_fsync(FsContext *ctx, int fid_type,
406
                        V9fsFidOpenState *fs, int datasync)
399 407
{
408
    int fd;
409

  
410
    if (fid_type == P9_FID_DIR) {
411
        fd = dirfd(fs->dir);
412
    } else {
413
        fd = fs->fd;
414
    }
415

  
400 416
    if (datasync) {
401
        return qemu_fdatasync(fs->fd);
417
        return qemu_fdatasync(fd);
402 418
    } else {
403
        return fsync(fs->fd);
419
        return fsync(fd);
404 420
    }
405 421
}
406 422

  

Also available in: Unified diff