On Thu, Oct 05, 2023 at 12:40:50PM -0700, Bart Van Assche wrote: > This patch reverts a small subset of commit c75e707fe1aa ("block: remove > the per-bio/request write hint"). The following functionality has been > restored: Please explain this in terms of what you add. The fact that it restores something isn't more than a little footnote added at the end. > --- /dev/null > +++ b/include/linux/fs-lifetime.h The name seems a bit odd for something that primarily deals with bios. bio-lifetime.h would seem like a better fit. > @@ -0,0 +1,20 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +#include <linux/bio.h> > +#include <linux/fs.h> > +#include <linux/ioprio.h> > + > +static inline enum rw_hint bio_get_data_lifetime(struct bio *bio) > +{ > + /* +1 to map 0 onto WRITE_LIFE_NONE. */ > + return IOPRIO_PRIO_LIFETIME(bio->bi_ioprio) + 1; This seems a little to magic. Why not a lookup table? > +} > + > +static inline void bio_set_data_lifetime(struct bio *bio, enum rw_hint lifetime) Please avoid the overly long line. > + /* -1 to map WRITE_LIFE_NONE onto 0. */ > + if (lifetime != 0) > + lifetime--; > + WARN_ON_ONCE(lifetime & ~IOPRIO_LIFETIME_MASK); I'd return here instead of propagating the bogus value.