Message ID | 20090829231121.144124147@bombadil.infradead.org |
---|---|
State | Not Applicable |
Delegated to: | David Miller |
Headers | show |
On Sat, 2009-08-29 at 19:03 -0400, Christoph Hellwig wrote: > > The commands are conceptually writes, and in the case of IDE and SCSI > commands actually are writes. They were only reads because we thought > that would interact better with the elevators. Now the elevators know > about discard requests, that advantage no longer exists. Can you drop the final sentence of that? It isn't true, and I never said it. s/. Now.*/, but that isn't necessary, and making them writes makes it easier for the low-level IDE and SCSI code to cope with the fact that the command has to be sent with a payload./ The elevators _still_ don't know about discards, and will still let reads and writes (and discards, which are just a special case of writes) to the same sector all cross each other on the queue unless there's some external factor to prevent it.
On Thu, Sep 03, 2009 at 06:52:20PM +0100, David Woodhouse wrote: > On Sat, 2009-08-29 at 19:03 -0400, Christoph Hellwig wrote: > > > > The commands are conceptually writes, and in the case of IDE and SCSI > > commands actually are writes. They were only reads because we thought > > that would interact better with the elevators. Now the elevators know > > about discard requests, that advantage no longer exists. > > Can you drop the final sentence of that? It isn't true, and I never said > it. No, but you wouldn't give me a changelog entry, so I had to make something up. > s/. Now.*/, but that isn't necessary, and making them writes makes it > easier for the low-level IDE and SCSI code to cope with the fact that > the command has to be sent with a payload./ Thanks.
diff --git a/include/linux/fs.h b/include/linux/fs.h index 5bed436..28f8e5d 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -161,8 +161,8 @@ struct inodes_stat_t { * These aren't really reads or writes, they pass down information about * parts of device that are now unused by the file system. */ -#define DISCARD_NOBARRIER (1 << BIO_RW_DISCARD) -#define DISCARD_BARRIER ((1 << BIO_RW_DISCARD) | (1 << BIO_RW_BARRIER)) +#define DISCARD_NOBARRIER (WRITE | (1 << BIO_RW_DISCARD)) +#define DISCARD_BARRIER (DISCARD_NOBARRIER | (1 << BIO_RW_BARRIER)) #define SEL_IN 1 #define SEL_OUT 2