Skip to content

Commit

Permalink
uio_hv_generic: set size of ring buffer attribute
Browse files Browse the repository at this point in the history
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: 37b96a4 ("uio_hv_generic: support sub-channels")
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Stephen Hemminger authored and Greg Kroah-Hartman committed Apr 23, 2018
1 parent 7aa135f commit 6e3d66b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/uio/uio_hv_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,12 @@ static int hv_uio_ring_mmap(struct file *filp, struct kobject *kobj,
return 0;
}

static struct bin_attribute ring_buffer_bin_attr __ro_after_init = {
static const struct bin_attribute ring_buffer_bin_attr = {
.attr = {
.name = "ring",
.mode = 0600,
/* size is set at init time */
},
.size = 2 * HV_RING_SIZE * PAGE_SIZE,
.mmap = hv_uio_ring_mmap,
};

Expand Down

0 comments on commit 6e3d66b

Please sign in to comment.