On Jun 13, 2017, at 11:15 AM, Jens Axboe <[email protected]> wrote:
> 
> Signed-off-by: Jens Axboe <[email protected]>
> ---
> include/linux/blk_types.h | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
> 
> diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
> index 1940876a7fa7..16c4e657807f 100644
> --- a/include/linux/blk_types.h
> +++ b/include/linux/blk_types.h
> @@ -314,6 +314,19 @@ struct blk_rq_stat {
>       u64 batch;
> };
> 
> +/*
> + * Data life time definitions for writes. These are relative within a
> + * given device, no absolute meaning is attached to them.
> + */
> +enum {
> +     WRITE_LIFE_UNKNOWN      = 0,
> +     WRITE_LIFE_SHORT,
> +     WRITE_LIFE_MEDIUM,
> +     WRITE_LIFE_LONG,
> +     WRITE_LIFE_EXTREME,
> +     WRITE_LIFE_NR,
> +};

With the exception of these enums, there is actually enough space in the
various structures to pass at least a 4-bit stream ID through the whole
stack (actually, a full 32-bit stream ID, except for the debugfs stats).

I'm not necessarily against having some pre-defined meanings for these
values, but with a few trivial changes to the code it would be possible
to make this functionality much more flexible.

Comments inline on each of the patches where this matters.

Cheers, Andreas

> +
> static inline void bio_set_streamid(struct bio *bio, unsigned int stream)
> {
>       bio->bi_stream = stream;
> --
> 2.7.4
> 


Cheers, Andreas





Attachment: signature.asc
Description: Message signed with OpenPGP

Reply via email to