diff options
| author | Jiri Kosina <jkosina@suse.cz> | 2021-04-29 21:45:19 +0200 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2021-04-29 21:45:19 +0200 |
| commit | e50fedec822efc7b7090f95862b782d91ca8aec0 (patch) | |
| tree | 22dd6b534d00a1f7fc3823f0d88e0d43547fc87b /include/linux/bio.h | |
| parent | cfc9bdfb6ba76de84a9ed8ee75dc56903b505a78 (diff) | |
| parent | 35a927f2848bd79586c6374ebb99e4207f3b0c7f (diff) | |
Merge branch 'for-5.13/surface-system-aggregator-intergration' into for-linus
- Surface Aggregator Module support from Maximilian Luz
Diffstat (limited to 'include/linux/bio.h')
| -rw-r--r-- | include/linux/bio.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h index 5b468f2242ff..983ed2fe7c85 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -20,7 +20,12 @@ #define BIO_BUG_ON #endif -#define BIO_MAX_PAGES 256 +#define BIO_MAX_PAGES 256U + +static inline unsigned int bio_max_segs(unsigned int nr_segs) +{ + return min(nr_segs, BIO_MAX_PAGES); +} #define bio_prio(bio) (bio)->bi_ioprio #define bio_set_prio(bio, prio) ((bio)->bi_ioprio = prio) |
