mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
5ed7959ede
commit
7cedb1f17f
3 changed files with 35 additions and 19 deletions
|
@ -207,9 +207,10 @@ void sg_init_one(struct scatterlist *, const void *, unsigned int);
|
|||
typedef struct scatterlist *(sg_alloc_fn)(unsigned int, gfp_t);
|
||||
typedef void (sg_free_fn)(struct scatterlist *, unsigned int);
|
||||
|
||||
void __sg_free_table(struct sg_table *, sg_free_fn *);
|
||||
void __sg_free_table(struct sg_table *, unsigned int, sg_free_fn *);
|
||||
void sg_free_table(struct sg_table *);
|
||||
int __sg_alloc_table(struct sg_table *, unsigned int, gfp_t, sg_alloc_fn *);
|
||||
int __sg_alloc_table(struct sg_table *, unsigned int, unsigned int, gfp_t,
|
||||
sg_alloc_fn *);
|
||||
int sg_alloc_table(struct sg_table *, unsigned int, gfp_t);
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue