09 Jun, 2016

2 commits

  • Instead of overloading the discard support with the REQ_SECURE flag.
    Use the opportunity to rename the queue flag as well, and remove the
    dead checks for this flag in the RAID 1 and RAID 10 drivers that don't
    claim support for secure erase.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     
  • Because we define WRITE/READ as REQ_OPs, we cannot do
    switch (rq_data_dir(request))
    case READ
    ....
    case WRITE
    ...

    without getting warnings about handling other REQ_OPs.

    This just has mq_disk do a if/else like it does in other
    places.

    Signed-off-by: Mike Christie
    Signed-off-by: Jens Axboe

    Mike Christie
     

08 Jun, 2016

38 commits

  • In case of the active namespace list scanning method, a namespace that
    is detached is not removed from the host if it was the last entry in
    the list. Fix this by adding a scan to validate namespaces greater than
    the value of prev.

    This also handles the case of removing namespaces whose value exceed
    the device's reported number of namespaces.

    Signed-off-by: Sunad Bhandary S
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Sunad Bhandary
     
  • It's more elegant to use UINT_MAX to represent the max value of
    type unsigned int. So replace the actual value by using this define.

    Signed-off-by: Minfei Huang
    Signed-off-by: Jens Axboe

    Minfei Huang
     
  • So it can be used by fabrics driver also.

    Signed-off-by: Ming Lin
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Johannes Thumshirn
    Reviewed-by: Keith Busch
    Signed-off-by: Jens Axboe

    Ming Lin
     
  • nvme_cancel_io is a bit confusing (given the distinction of io/admin),
    so rename it to nvme_cancel_request.

    And update it a bit to pass in struct nvme_ctrl, so it can be used
    by Fabrics driver also.

    Signed-off-by: Ming Lin
    Reviewed-by: Christoph Hellwig
    Suggested-by: Sagi Grimberg
    Reviewed-by: Johannes Thumshirn
    Reviewed-by: Keith Busch
    Signed-off-by: Jens Axboe

    Ming Lin
     
  • To avoid confusion between REQ_OP_FLUSH, which is handled by
    request_fn drivers, and upper layers requesting the block layer
    perform a flush sequence along with possibly a WRITE, this patch
    renames REQ_FLUSH to REQ_PREFLUSH.

    Signed-off-by: Mike Christie
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • The last patch added a REQ_OP_FLUSH for request_fn drivers
    and the next patch renames REQ_FLUSH to REQ_PREFLUSH which
    will be used by file systems and make_request_fn drivers so
    they can send a write/flush combo.

    This patch drops xen's use of REQ_FLUSH to track if it supports
    REQ_OP_FLUSH requests, so REQ_FLUSH can be deleted.

    Signed-off-by: Mike Christie
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Juergen Gross
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • This adds a REQ_OP_FLUSH operation that is sent to request_fn
    based drivers by the block layer's flush code, instead of
    sending requests with the request->cmd_flags REQ_FLUSH bit set.

    Signed-off-by: Mike Christie
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • This patch drops the compat definition of req_op where it matches
    the rq_flag_bits definitions, and drops the related old and compat
    code that allowed users to set either the op or flags for the operation.

    We also then store the operation in the bi_rw/cmd_flags field similar
    to how we used to store the bio ioprio where it sat in the upper bits
    of the field.

    Signed-off-by: Mike Christie
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • We don't need bi_rw to be so large on 64 bit archs, so
    reduce it to unsigned int.

    Signed-off-by: Mike Christie
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • In the next patch, we move drop the compat code and make
    the op a separate value that is hidden in bi_rw. To give
    the op and rq bits flags room to grow this moves prio to
    its own field.

    Signed-off-by: Mike Christie
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • The block layer will set the correct READ/WRITE operation flags/fields
    when creating a request, so there is not need for drivers to set the
    REQ_WRITE flag.

    Signed-off-by: Mike Christie
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • Have blktrace use the req/bio op accessor to get the REQ_OP.

    Signed-off-by: Mike Christie
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • The req operation REQ_OP is separated from the rq_flag_bits
    definition. This converts the block layer drivers to
    use req_op to get the op from the request struct.

    Signed-off-by: Mike Christie
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • This patch converts the is_sync helpers to use separate variables
    for the operation and flags.

    Signed-off-by: Mike Christie
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • This patch converts the block layer merging code to use separate variables
    for the operation and flags, and to check req_op for the REQ_OP.

    Signed-off-by: Mike Christie
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • The bio and request operation and flags are going to be separate
    definitions, so we cannot pass them in as a bitmap. This patch
    converts the blkg_rwstat code and its caller, cfq, to pass in the
    values separately.

    Signed-off-by: Mike Christie
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • This patch converts the elevator code to use separate variables
    for the operation and flags, and to check req_op for the REQ_OP.

    Signed-off-by: Mike Christie
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • This patch modifies the blk mq request creation code to use
    separate variables for the operation and flags, because in the
    the next patches the struct request users will be converted like
    was done for bios.

    Signed-off-by: Mike Christie
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • This patch prepares *_get_request/*_put_request and freed_request,
    to use separate variables for the operation and flags. In the
    next patches the struct request users will be converted like
    was done for bios where the op and flags are set separately.

    Signed-off-by: Mike Christie
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • The bio users should now always be setting up the bio op. This patch
    has the block layer copy that to the request.

    Signed-off-by: Mike Christie
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • Separate the op from the rq_flag_bits and have xen
    set/get the bio using bio_set_op_attrs/bio_op.

    Signed-off-by: Mike Christie
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • Separate the op from the rq_flag_bits and have the target layer
    set/get the bio using bio_set_op_attrs/bio_op.

    Signed-off-by: Mike Christie
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • Separate the op from the rq_flag_bits and have md
    set/get the bio using bio_set_op_attrs/bio_op.

    Signed-off-by: Mike Christie
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • Separate the op from the rq_flag_bits and have drbd
    set/get the bio using bio_set_op_attrs/bio_op.

    Signed-off-by: Mike Christie
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • Separate the op from the rq_flag_bits and have bcache
    set/get the bio using bio_set_op_attrs/bio_op.

    Signed-off-by: Mike Christie
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • Separate the op from the rq_flag_bits and have dm
    set/get the bio using bio_set_op_attrs/bio_op.

    Signed-off-by: Mike Christie
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • It looks like dm stats cares about the data direction
    (READ vs WRITE) and does not need the bio/request flags.
    Commands like REQ_FLUSH, REQ_DISCARD and REQ_WRITE_SAME
    are currently always set with REQ_WRITE, so the extra check for
    REQ_DISCARD in dm_stats_account_io is not needed.

    This patch has it use the bio and request data_dir helpers
    instead of accessing the bi_rw/cmd_flags directly. This makes
    the next patches that remove the operation from the cmd_flags
    and bi_rw easier, because we will no longer have the REQ_WRITE
    bit set for operations like discards.

    Signed-off-by: Mike Christie
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • Separate the op from the rq_flag_bits and have the pm code
    set/get the bio using bio_set_op_attrs/bio_op.

    Signed-off-by: Mike Christie
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • Separate the op from the rq_flag_bits and have ocfs2
    set/get the bio using bio_set_op_attrs/bio_op.

    Signed-off-by: Mike Christie
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • Separate the op from the rq_flag_bits and have nilfs
    set/get the bio using bio_set_op_attrs/bio_op.

    Signed-off-by: Mike Christie
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Acked-by: Ryusuke Konishi
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • Separate the op from the rq_flag_bits and have the mpage code
    set/get the bio using bio_set_op_attrs/bio_op.

    Signed-off-by: Mike Christie
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • Separate the op from the rq_flag_bits and have gfs2
    set/get the bio using bio_set_op_attrs/bio_op.

    Signed-off-by: Mike Christie
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • Separate the op from the rq_flag_bits and have xfs
    set/get the bio using bio_set_op_attrs/bio_op.

    Signed-off-by: Mike Christie
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • Separate the op from the rq_flag_bits and have gfs2
    set/get the bio using bio_set_op_attrs/bio_op.

    Signed-off-by: Mike Christie
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • Separate the op from the rq_flag_bits and have f2fs
    set/get the bio using bio_set_op_attrs/bio_op.

    Signed-off-by: Mike Christie
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • The bio REQ_OP and bi_rw rq_flag_bits are now always setup, so there is
    no need to pass around the rq_flag_bits bits too. btrfs users should
    should access the bio insead.

    Signed-off-by: Mike Christie
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • We no longer pass in a bitmap of rq_flag_bits bits to __btrfs_map_block.
    It will always be a REQ_OP, or the btrfs specific REQ_GET_READ_MIRRORS,
    so this drops the bit tests.

    Signed-off-by: Mike Christie
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie
     
  • This should be the easier cases to convert btrfs to
    bio_set_op_attrs/bio_op.
    They are mostly just cut and replace type of changes.

    Signed-off-by: Mike Christie
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Jens Axboe

    Mike Christie