Skip to content

RFC separate operations from flags in the bio/request structs

[email protected] dm-devel drbd-dev linux-fsdevel linux-raid linux-scsi lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest9 of 32 patches 6 repliesIn review

9 of 32 patches are in this archive. The cover letter announces 32.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/32block/fs: add REQ_OP definitions.include/linux/blk_types.h+7 -00 replies
2/32block/fs/mm: prepare submit_bio_wait users for bi_rw splitblock/bio.c block/blk-flush.c drivers/md/bcache/debug.c +16 more+58 -470 replies
3/32dio/btrfs: prep dio->submit_bio users for bi_rw split.fs/btrfs/inode.c fs/direct-io.c include/linux/fs.h+27 -200 replies
4/32block: prepare blkdev_issue_discard for bi_rw splitblock/blk-lib.c+4 -30 replies
5/32drbd: prepare drbd for bi_rw splitdrivers/block/drbd/drbd_actlog.c drivers/block/drbd/drbd_bitmap.c drivers/block/drbd/drbd_int.h +1 more+22 -190 replies
6/32xen blkback: prepare for bi_rw splitdrivers/block/xen-blkback/blkback.c+13 -100 replies
7/32dm: prepare for bi_rw splitdrivers/md/dm-bufio.c drivers/md/dm-io.c drivers/md/dm-kcopyd.c +5 more+64 -500 replies
8/32target: prepare for bi_rw splitdrivers/target/target_core_iblock.c+18 -140 replies
9/32btrfs: prepare for bi_rw splitfs/btrfs/check-integrity.c fs/btrfs/check-integrity.h fs/btrfs/compression.c +10 more+177 -1650 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 00/32] separate operations from flags in the bio/request structs

There are a couple new block layer commands we are trying to add support for in the near term:

compare and write
http://www.spinics.net/lists/target-devel/msg07826.html

copy offload/extended copy/xcopy
https://www.redhat.com/archives/dm-devel/2014-July/msg00070.html

The problem is if we contine to add more commands we will have to one day extend the cmd_flags/bi_rw fields again. To prevent that, this patchset separates the operation (REQ_WRITE, REQ_DISCARD, REQ_WRITE_SAME, etc) from the flags (REQ_SYNC, REQ_QUIET, etc) in the bio and request structs. In the end of this set, we will have two fields bio->bi_op/request->op and bio->bi_rw/request->cmd_flags.

The patches were made against Jens's linux-block tree's for-linus branch:
https://git.kernel.org/cgit/linux/kernel/git/axboe/linux-block.git/log/?h=for-linus
(last commit a22c4d7e34402ccdf3414f64c50365436eba7b93).

I have done some basic testing for a lot of the drivers and filesystems, but I wanted to get comments before trying to track down more hardware/ systems for testing.

Known issues:
- REQ_FLUSH is still a flag, but should probably be a operation. For lower level drivers like SCSI where we only get a flush, it makes
more sense to be a operation. However, upper layers like filesystems can send down flushes with writes, so it is more of a flag for them. I am still working on this.

- There is a regression with the dm flakey target. It currently cannot corrupt the operation values.

- The patchset is a little awkward. It touches so much code, but I wanted to maintain git bisectibility, so there is lots of compat code left around until the last patches where everyting is cleaned up.