Commit b81d033c authored by Alessandro Rubini's avatar Alessandro Rubini

core: remove the f_flags argument to buffer->create

The argument is a relic of original design and was used incorrectly.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
Acked-by: 's avatarFederico Vaga <federico.vaga@gmail.com>
parent 89e7e390
......@@ -42,8 +42,7 @@ of them are implemented in zio-buf-kmalloc.c, which may be used as
reference to better understand the role of each method:
struct zio_bi *(*create)(struct zio_buffer_type *zbuf,
struct zio_channel *ch,
fmode_t f_flags);
struct zio_channel *ch);
void (*destroy)(struct zio_bi *bi);
The create() operation allocates and initializes an instance of the
......@@ -52,7 +51,9 @@ first time. The operation returns a zio buffer instance (zio_bi),
which is the generic descriptor of a buffer instance. ZIO handles
only zio_bi, so complex buffer structures must contain the zio_bi
structure and use container_of() to access the private enclosing
structure.
structure. create() can use default attributes of its buffer type at
creation time; a copy for this specific instance is created by
zio-core after the function returns.
destroy() deallocates a buffer instance. ZIO calls destroy() when the
channel is unregistered from ZIO or when the user assigns a different
......
......@@ -16,7 +16,6 @@
#include <linux/fs.h>
#include <linux/spinlock.h>
#include <linux/types.h>
#include <linux/uaccess.h>
#include <linux/zio.h>
#include <linux/zio-buffer.h>
......@@ -202,7 +201,7 @@ out_unlock:
/* Create is called by zio for each channel electing to use this buffer type */
static struct zio_bi *zbk_create(struct zio_buffer_type *zbuf,
struct zio_channel *chan, fmode_t f_flags)
struct zio_channel *chan)
{
struct zbk_instance *zbki;
......
......@@ -124,8 +124,7 @@ struct zio_buffer_operations {
struct zio_block * (*retr_block) (struct zio_bi *bi);
struct zio_bi * (*create)(struct zio_buffer_type *zbuf,
struct zio_channel *chan,
fmode_t f_flags);
struct zio_channel *chan);
void (*destroy)(struct zio_bi *bi);
};
......
......@@ -124,7 +124,7 @@ static int zio_f_open(struct inode *ino, struct file *f)
/* if there is no instance, then create a new one */
if (!chan->bi)
chan->bi = zbuf->b_op->create(zbuf, chan, FMODE_READ);
chan->bi = zbuf->b_op->create(zbuf, chan);
priv->chan = chan;
/* even number is control, odd number is data */
......
......@@ -1005,7 +1005,7 @@ static struct zio_bi *__bi_create_and_init(struct zio_buffer_type *zbuf,
pr_debug("%s\n", __func__);
/* Create buffer */
bi = zbuf->b_op->create(zbuf, chan, FMODE_READ);
bi = zbuf->b_op->create(zbuf, chan);
if (IS_ERR(bi)) {
pr_err("ZIO %s: can't create buffer, error %ld\n",
__func__, PTR_ERR(bi));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment