lkml.org 
[lkml]   [2017]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v3 3/8] nvmet: implement namespace identify descriptor list
    What about a little helper like this: ?

    static u16 nvmet_copy_ns_identifier(struct nvmet_req *req, u8 type, u8 len,
    void *id, off_t *off)
    {
    struct nvme_ns_identifier_hdr hdr = {
    .nidt = type,
    .nidl = len,
    };
    u16 status;

    status = nvmet_copy_to_sgl(req, *off, &hdr, sizeof(hdr));
    if (status)
    return status;
    *off += sizeof(hdr);

    status = nvmet_copy_to_sgl(req, off, id, len);
    if (status)
    return status;
    *off += len;

    return 0;
    }

    \
     
     \ /
      Last update: 2017-06-05 07:31    [W:4.509 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site