Re: [PATCH v2 04/15] fs: Restore write hint support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/9/23 22:42, Kanchan Joshi wrote:
On 10/6/2023 1:10 AM, Bart Van Assche wrote:
+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;
+}
+
+static inline void bio_set_data_lifetime(struct bio *bio, enum rw_hint lifetime)
+{
+	/* -1 to map WRITE_LIFE_NONE onto 0. */
+	if (lifetime != 0)
+		lifetime--;

How the driver can figure when lifetime is not set, and when it is set
to WRITE_LIFE_NONE? If it uses IOPRIO_PRIO_LIFETIME (as patch 8 does),
it will see 0 in both cases.
F2FS fs-based whint_mode seems to expect distinct streams for
WRITE_LIFE_NOT_SET and WRITE_LIFE_NONE.

I will remove the -1 / +1 from the above code.

Thanks,

Bart.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux