aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/scatterlist.h
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-13 15:15:28 -0500
committerJens Axboe <jens.axboe@oracle.com>2008-01-28 04:54:49 -0500
commit7cedb1f17fb7f4374d11501f61656ae9d3ba47e9 (patch)
treed6257751445618b827c3e41e5b8fde2704c9d716 /include/linux/scatterlist.h
parent5ed7959ede0936c55e50421a53f153b17080e876 (diff)
SG: work with the SCSI fixed maximum allocations.
SCSI sg table allocation has a maximum size (of SCSI_MAX_SG_SEGMENTS, currently 128) and this will cause a BUG_ON() in SCSI if something tries an allocation over it. This patch adds a size limit to the chaining allocator to allow the specification of the maximum allocation size for chaining, so we always chain in units of the maximum SCSI allocation size. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include/linux/scatterlist.h')
-rw-r--r--include/linux/scatterlist.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index e9cb103417b2..a3d567a974e8 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -207,9 +207,10 @@ void sg_init_one(struct scatterlist *, const void *, unsigned int);
207typedef struct scatterlist *(sg_alloc_fn)(unsigned int, gfp_t); 207typedef struct scatterlist *(sg_alloc_fn)(unsigned int, gfp_t);
208typedef void (sg_free_fn)(struct scatterlist *, unsigned int); 208typedef void (sg_free_fn)(struct scatterlist *, unsigned int);
209 209
210void __sg_free_table(struct sg_table *, sg_free_fn *); 210void __sg_free_table(struct sg_table *, unsigned int, sg_free_fn *);
211void sg_free_table(struct sg_table *); 211void sg_free_table(struct sg_table *);
212int __sg_alloc_table(struct sg_table *, unsigned int, gfp_t, sg_alloc_fn *); 212int __sg_alloc_table(struct sg_table *, unsigned int, unsigned int, gfp_t,
213 sg_alloc_fn *);
213int sg_alloc_table(struct sg_table *, unsigned int, gfp_t); 214int sg_alloc_table(struct sg_table *, unsigned int, gfp_t);
214 215
215/* 216/*