Commit-ID: 96917e6f7de0939dea1d44041945876ca1acf78a Gitweb: http://git.kernel.org/tip/96917e6f7de0939dea1d44041945876ca1acf78a Author: Asias He <asias.hejun@xxxxxxxxx> AuthorDate: Wed, 18 May 2011 16:19:13 +0800 Committer: Pekka Enberg <penberg@xxxxxxxxxx> CommitDate: Wed, 18 May 2011 21:29:02 +0300 kvm tools: Do not use 'inline' for disk_image__flush Signed-off-by: Asias He <asias.hejun@xxxxxxxxx> Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx> --- tools/kvm/disk/core.c | 8 ++++++++ tools/kvm/include/kvm/disk-image.h | 9 +-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/tools/kvm/disk/core.c b/tools/kvm/disk/core.c index 6894b17..f3dd0bb 100644 --- a/tools/kvm/disk/core.c +++ b/tools/kvm/disk/core.c @@ -59,6 +59,14 @@ struct disk_image *disk_image__open(const char *filename, bool readonly) return NULL; } +int disk_image__flush(struct disk_image *disk) +{ + if (disk->ops->flush) + return disk->ops->flush(disk); + + return fsync(disk->fd); +} + int disk_image__close(struct disk_image *disk) { /* If there was no disk image then there's nothing to do: */ diff --git a/tools/kvm/include/kvm/disk-image.h b/tools/kvm/include/kvm/disk-image.h index 82884fb..ac394e8 100644 --- a/tools/kvm/include/kvm/disk-image.h +++ b/tools/kvm/include/kvm/disk-image.h @@ -53,17 +53,10 @@ struct disk_image { struct disk_image *disk_image__open(const char *filename, bool readonly); struct disk_image *disk_image__new(int fd, u64 size, struct disk_image_operations *ops, int mmap); int disk_image__close(struct disk_image *disk); - +int disk_image__flush(struct disk_image *disk); ssize_t disk_image__read(struct disk_image *disk, u64 sector, const struct iovec *iov, int iovcount); ssize_t disk_image__write(struct disk_image *disk, u64 sector, const struct iovec *iov, int iovcount); -static inline int disk_image__flush(struct disk_image *disk) -{ - if (disk->ops->flush) - return disk->ops->flush(disk); - return fsync(disk->fd); -} - struct disk_image *raw_image__probe(int fd, struct stat *st, bool readonly); struct disk_image *blkdev__probe(const char *filename, struct stat *st); -- To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
![]() |