projects
/
xeon-phi-kernel-module
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated host/vhost/mic_blk.c, adding a `MIC_` prefix to the SECTOR_SHIFT and
[xeon-phi-kernel-module]
/
host
/
vhost
/
mic_blk.c
diff --git
a/host/vhost/mic_blk.c
b/host/vhost/mic_blk.c
index
9ac2cb8
..
1a94a46
100644
(file)
--- a/
host/vhost/mic_blk.c
+++ b/
host/vhost/mic_blk.c
@@
-41,8
+41,8
@@
#include "vhost.h"
#include "mic/mic_virtio.h"
#include "vhost.h"
#include "mic/mic_virtio.h"
-#define
SECTOR_SHIFT
9
-#define
SECTOR_SIZE (1UL <<
SECTOR_SHIFT)
+#define
MIC_SECTOR_SHIFT
9
+#define
MIC_SECTOR_SIZE (1UL << MIC_
SECTOR_SHIFT)
#define VIRTIO_BLK_QUEUE_SIZE 128
#define DISK_SEG_MAX (VIRTIO_BLK_QUEUE_SIZE - 2)
#define VIRTIO_BLK_QUEUE_SIZE 128
#define DISK_SEG_MAX (VIRTIO_BLK_QUEUE_SIZE - 2)
@@
-127,7
+127,7
@@
static void handle_io_work(struct work_struct *work)
vbio = container_of(work, struct vhost_blk_io, work);
blk = vbio->blk;
vq = &blk->dev.vqs[0];
vbio = container_of(work, struct vhost_blk_io, work);
blk = vbio->blk;
vq = &blk->dev.vqs[0];
- pos = vbio->sector << SECTOR_SHIFT;
+ pos = vbio->sector <<
MIC_
SECTOR_SHIFT;
aper_va = blk->bd_info->bi_ctx.aper.va;
vring = &((struct mic_virtblk *)blk->bd_info->bi_virtio)->vb_shared.vring;
aper_va = blk->bd_info->bi_ctx.aper.va;
vring = &((struct mic_virtblk *)blk->bd_info->bi_virtio)->vb_shared.vring;
@@
-258,7
+258,7
@@
static void start_io(struct list_head *queue)
vbio = entry;
continue;
}
vbio = entry;
continue;
}
- if (vbio->sector + (vbio->len >> SECTOR_SHIFT) == entry->sector) {
+ if (vbio->sector + (vbio->len >>
MIC_
SECTOR_SHIFT) == entry->sector) {
vbio = entry;
} else {
INIT_LIST_HEAD(&start);
vbio = entry;
} else {
INIT_LIST_HEAD(&start);
@@
-473,7
+473,7
@@
static long vhost_blk_set_backend(struct vhost_blk *vblk)
#endif
writel(virtio_blk_features, &vb_shared->host_features);
writel(DISK_SEG_MAX, &vb_shared->blk_config.seg_max);
#endif
writel(virtio_blk_features, &vb_shared->host_features);
writel(DISK_SEG_MAX, &vb_shared->blk_config.seg_max);
- writel(SECTOR_SIZE, &vb_shared->blk_config.blk_size);
+ writel(
MIC_
SECTOR_SIZE, &vb_shared->blk_config.blk_size);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
ret = vfs_getattr(&vblk->virtblk_file->f_path, &stat);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
ret = vfs_getattr(&vblk->virtblk_file->f_path, &stat);
@@
-485,10
+485,10
@@
static long vhost_blk_set_backend(struct vhost_blk *vblk)
goto _exit_;
if (S_ISBLK(stat.mode)) {
goto _exit_;
if (S_ISBLK(stat.mode)) {
- writel(i_size_read(I_BDEV(vblk->virtblk_file->f_mapping->host)->bd_inode) / SECTOR_SIZE,
+ writel(i_size_read(I_BDEV(vblk->virtblk_file->f_mapping->host)->bd_inode) /
MIC_
SECTOR_SIZE,
&vb_shared->blk_config.capacity);
} else {
&vb_shared->blk_config.capacity);
} else {
- writel(stat.size / SECTOR_SIZE, &vb_shared->blk_config.capacity);
+ writel(stat.size /
MIC_
SECTOR_SIZE, &vb_shared->blk_config.capacity);
}
ret = mic_reg_irqhandler(&bd_info->bi_ctx, MIC_IRQ_DB2, "Host DoorBell 2",
}
ret = mic_reg_irqhandler(&bd_info->bi_ctx, MIC_IRQ_DB2, "Host DoorBell 2",