Messages in this thread | | | Date | Thu, 02 Apr 2009 18:02:55 +0900 | From | Tejun Heo <> | Subject | Re: [PATCH 05/17] bio: cleanup rw usage |
| |
Boaz Harrosh wrote: > On 04/01/2009 04:44 PM, Tejun Heo wrote: >> Impact: cleanup >> >> bio confusingly uses @write_to_vm and @reading for data directions, >> both of which mean the opposite of the usual block/bio convention of >> using READ and WRITE w.r.t. IO devices. The only place where the >> inversion is necessary is when caling get_user_pages_fast() in >> bio_copy_user_iov() as the gup uses the VM convention of read/write >> w.r.t. VM. >> >> This patch converts all bio functions to use READ/WRITE rw parameter >> and let the one place where inversion is necessary to rw == READ. >> > > Hi one more nit picking just if you are at it. If you want > I can do the work and send it to you so you can squash it into this patch. > See bellow > >> + if (rw == WRITE) >> + bio->bi_rw |= 1 << BIO_RW; > > can we pleas have an inline that does that? Like bio_set_dir()? > and change all users. You will be surprised how many there are. > > It gives me an hart attack every time I have to write yet another > one.
Things like this are actually what I'm trying to clean up. If you look at the whole series, at the end, there remains only one place which sets the flag in the blk/bio map paths and all users of blk_rq_map_*() interface couldn't care less about the flag because they provide only the necessary information through strictly defined API.
Thanks.
-- tejun
| |