提交 6e3d66b8 编写于 作者: S Stephen Hemminger 提交者: Greg Kroah-Hartman

uio_hv_generic: set size of ring buffer attribute

The original code had ring size as a module parameter, but
then it was made a fixed value.  The code to set the size of
the ring buffer binary file was lost in the transistion.
The size is needed by user mode driver to know the size of
the ring buffer.

Fixes: 37b96a49 ("uio_hv_generic: support sub-channels")
Signed-off-by: NStephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 7aa135fc
...@@ -171,12 +171,12 @@ static int hv_uio_ring_mmap(struct file *filp, struct kobject *kobj, ...@@ -171,12 +171,12 @@ static int hv_uio_ring_mmap(struct file *filp, struct kobject *kobj,
return 0; return 0;
} }
static struct bin_attribute ring_buffer_bin_attr __ro_after_init = { static const struct bin_attribute ring_buffer_bin_attr = {
.attr = { .attr = {
.name = "ring", .name = "ring",
.mode = 0600, .mode = 0600,
/* size is set at init time */
}, },
.size = 2 * HV_RING_SIZE * PAGE_SIZE,
.mmap = hv_uio_ring_mmap, .mmap = hv_uio_ring_mmap,
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册