diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/scatterlist.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index 556ec1ea2574..cb3c8fe6acd7 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h | |||
| @@ -286,6 +286,31 @@ size_t sg_pcopy_to_buffer(struct scatterlist *sgl, unsigned int nents, | |||
| 286 | #define SG_MAX_SINGLE_ALLOC (PAGE_SIZE / sizeof(struct scatterlist)) | 286 | #define SG_MAX_SINGLE_ALLOC (PAGE_SIZE / sizeof(struct scatterlist)) |
| 287 | 287 | ||
| 288 | /* | 288 | /* |
| 289 | * The maximum number of SG segments that we will put inside a | ||
| 290 | * scatterlist (unless chaining is used). Should ideally fit inside a | ||
| 291 | * single page, to avoid a higher order allocation. We could define this | ||
| 292 | * to SG_MAX_SINGLE_ALLOC to pack correctly at the highest order. The | ||
| 293 | * minimum value is 32 | ||
| 294 | */ | ||
| 295 | #define SG_CHUNK_SIZE 128 | ||
| 296 | |||
| 297 | /* | ||
| 298 | * Like SG_CHUNK_SIZE, but for archs that have sg chaining. This limit | ||
| 299 | * is totally arbitrary, a setting of 2048 will get you at least 8mb ios. | ||
| 300 | */ | ||
| 301 | #ifdef CONFIG_ARCH_HAS_SG_CHAIN | ||
| 302 | #define SG_MAX_SEGMENTS 2048 | ||
| 303 | #else | ||
| 304 | #define SG_MAX_SEGMENTS SG_CHUNK_SIZE | ||
| 305 | #endif | ||
| 306 | |||
| 307 | #ifdef CONFIG_SG_POOL | ||
| 308 | void sg_free_table_chained(struct sg_table *table, bool first_chunk); | ||
| 309 | int sg_alloc_table_chained(struct sg_table *table, int nents, | ||
| 310 | struct scatterlist *first_chunk); | ||
| 311 | #endif | ||
| 312 | |||
| 313 | /* | ||
| 289 | * sg page iterator | 314 | * sg page iterator |
| 290 | * | 315 | * |
| 291 | * Iterates over sg entries page-by-page. On each successful iteration, | 316 | * Iterates over sg entries page-by-page. On each successful iteration, |
