diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-04-11 23:41:46 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-04-15 11:32:45 +0200 |
commit | 0b2d591d325cfa0fb028982cfb5b3d63c798e6a1 (patch) | |
tree | 63e21acfd2390fc6b23bf00351042cdb7fcea47b /backport/backport-include/linux/scatterlist.h | |
parent | 82a36cc4b5af7fa17db71c7495dc5d9263d4fac9 (diff) |
backports: dissolve compat-2.6.25.h
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'backport/backport-include/linux/scatterlist.h')
-rw-r--r-- | backport/backport-include/linux/scatterlist.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/backport/backport-include/linux/scatterlist.h b/backport/backport-include/linux/scatterlist.h index 66bce160..678b03c3 100644 --- a/backport/backport-include/linux/scatterlist.h +++ b/backport/backport-include/linux/scatterlist.h @@ -3,6 +3,34 @@ #include_next <linux/scatterlist.h> #include <linux/version.h> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25) +struct sg_table { + struct scatterlist *sgl; /* the list */ + unsigned int nents; /* number of mapped entries */ + unsigned int orig_nents; /* original size of list */ +}; + +#define sg_alloc_fn LINUX_BACKPORT(sg_alloc_fn) +typedef struct scatterlist *(sg_alloc_fn)(unsigned int, gfp_t); + +#define sg_free_fn LINUX_BACKPORT(sg_free_fn) +typedef void (sg_free_fn)(struct scatterlist *, unsigned int); + +#define __sg_free_table LINUX_BACKPORT(__sg_free_table) +void __sg_free_table(struct sg_table *table, unsigned int max_ents, + sg_free_fn *free_fn); +#define sg_free_table LINUX_BACKPORT(sg_free_table) +void sg_free_table(struct sg_table *); +#define __sg_alloc_table LINUX_BACKPORT(__sg_alloc_table) +int __sg_alloc_table(struct sg_table *table, unsigned int nents, + unsigned int max_ents, gfp_t gfp_mask, + sg_alloc_fn *alloc_fn); +#define sg_alloc_table LINUX_BACKPORT(sg_alloc_table) +int sg_alloc_table(struct sg_table *table, unsigned int nents, gfp_t gfp_mask); + +#define SG_MAX_SINGLE_ALLOC (PAGE_SIZE / sizeof(struct scatterlist)) +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0) /* Lets expect distributions might backport this */ |