scatterlist.c (cdd38c5f1ce4398ec58fec95904b75824daab7b5) scatterlist.c (9dbbc3b9d09d6deba9f3b9e1d5b355032ed46a75)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (C) 2007 Jens Axboe <jens.axboe@oracle.com>
4 *
5 * Scatterlist handling helpers.
6 */
7#include <linux/export.h>
8#include <linux/slab.h>

--- 24 unchanged lines hidden (view full) ---

33}
34EXPORT_SYMBOL(sg_next);
35
36/**
37 * sg_nents - return total count of entries in scatterlist
38 * @sg: The scatterlist
39 *
40 * Description:
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (C) 2007 Jens Axboe <jens.axboe@oracle.com>
4 *
5 * Scatterlist handling helpers.
6 */
7#include <linux/export.h>
8#include <linux/slab.h>

--- 24 unchanged lines hidden (view full) ---

33}
34EXPORT_SYMBOL(sg_next);
35
36/**
37 * sg_nents - return total count of entries in scatterlist
38 * @sg: The scatterlist
39 *
40 * Description:
41 * Allows to know how many entries are in sg, taking into acount
41 * Allows to know how many entries are in sg, taking into account
42 * chaining as well
43 *
44 **/
45int sg_nents(struct scatterlist *sg)
46{
47 int nents;
48 for (nents = 0; sg; sg = sg_next(sg))
49 nents++;

--- 4 unchanged lines hidden (view full) ---

54/**
55 * sg_nents_for_len - return total count of entries in scatterlist
56 * needed to satisfy the supplied length
57 * @sg: The scatterlist
58 * @len: The total required length
59 *
60 * Description:
61 * Determines the number of entries in sg that are required to meet
42 * chaining as well
43 *
44 **/
45int sg_nents(struct scatterlist *sg)
46{
47 int nents;
48 for (nents = 0; sg; sg = sg_next(sg))
49 nents++;

--- 4 unchanged lines hidden (view full) ---

54/**
55 * sg_nents_for_len - return total count of entries in scatterlist
56 * needed to satisfy the supplied length
57 * @sg: The scatterlist
58 * @len: The total required length
59 *
60 * Description:
61 * Determines the number of entries in sg that are required to meet
62 * the supplied length, taking into acount chaining as well
62 * the supplied length, taking into account chaining as well
63 *
64 * Returns:
65 * the number of sg entries needed, negative error on failure
66 *
67 **/
68int sg_nents_for_len(struct scatterlist *sg, u64 len)
69{
70 int nents;

--- 990 unchanged lines hidden ---
63 *
64 * Returns:
65 * the number of sg entries needed, negative error on failure
66 *
67 **/
68int sg_nents_for_len(struct scatterlist *sg, u64 len)
69{
70 int nents;

--- 990 unchanged lines hidden ---