lkml.org 
[lkml]   [2024]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 198/437] scsi: sg: convert to read/write iterators
    Date
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    ---
    drivers/scsi/sg.c | 6 ++++--
    1 file changed, 4 insertions(+), 2 deletions(-)

    diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
    index 386981c6976a..c8047981eb9e 100644
    --- a/drivers/scsi/sg.c
    +++ b/drivers/scsi/sg.c
    @@ -553,6 +553,7 @@ sg_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos)
    kfree(old_hdr);
    return retval;
    }
    +FOPS_READ_ITER_HELPER(sg_read);

    static ssize_t
    sg_new_read(Sg_fd * sfp, char __user *buf, size_t count, Sg_request * srp)
    @@ -707,6 +708,7 @@ sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
    k = sg_common_write(sfp, srp, cmnd, sfp->timeout, blocking);
    return (k < 0) ? k : count;
    }
    +FOPS_WRITE_ITER_HELPER(sg_write);

    static ssize_t
    sg_new_write(Sg_fd *sfp, struct file *file, const char __user *buf,
    @@ -1412,8 +1414,8 @@ sg_rq_end_io(struct request *rq, blk_status_t status)

    static const struct file_operations sg_fops = {
    .owner = THIS_MODULE,
    - .read = sg_read,
    - .write = sg_write,
    + .read_iter = sg_read_iter,
    + .write_iter = sg_write_iter,
    .poll = sg_poll,
    .unlocked_ioctl = sg_ioctl,
    .compat_ioctl = compat_ptr_ioctl,
    --
    2.43.0

    \
     
     \ /
      Last update: 2024-05-27 16:36    [W:5.972 / U:0.636 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site