Commit 10f36b1e authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'for-5.7/block-2020-03-29' of git://git.kernel.dk/linux-block

Pull block updates from Jens Axboe:

 - Online capacity resizing (Balbir)

 - Number of hardware queue change fixes (Bart)

 - null_blk fault injection addition (Bart)

 - Cleanup of queue allocation, unifying the node/no-node API
   (Christoph)

 - Cleanup of genhd, moving code to where it makes sense (Christoph)

 - Cleanup of the partition handling code (Christoph)

 - disk stat fixes/improvements (Konstantin)

 - BFQ improvements (Paolo)

 - Various fixes and improvements

* tag 'for-5.7/block-2020-03-29' of git://git.kernel.dk/linux-block: (72 commits)
  block: return NULL in blk_alloc_queue() on error
  block: move bio_map_* to blk-map.c
  Revert "blkdev: check for valid request queue before issuing flush"
  block: simplify queue allocation
  bcache: pass the make_request methods to blk_queue_make_request
  null_blk: use blk_mq_init_queue_data
  block: add a blk_mq_init_queue_data helper
  block: move the ->devnode callback to struct block_device_operations
  block: move the part_stat* helpers from genhd.h to a new header
  block: move block layer internals out of include/linux/genhd.h
  block: move guard_bio_eod to bio.c
  block: unexport get_gendisk
  block: unexport disk_map_sector_rcu
  block: unexport disk_get_part
  block: mark part_in_flight and part_in_flight_rw static
  block: mark block_depr static
  block: factor out requeue handling from dispatch code
  block/diskstats: replace time_in_queue with sum of request times
  block/diskstats: accumulate all per-cpu counters in one pass
  block/diskstats: more accurate approximation of io_ticks for slow disks
  ...
parents 3a0eb192 654a3667
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ Field 10 -- # of milliseconds spent doing I/Os (unsigned int)

    Since 5.0 this field counts jiffies when at least one request was
    started or completed. If request runs more than 2 jiffies then some
    I/O time will not be accounted unless there are other requests.
    I/O time might be not accounted in case of concurrent requests.

Field 11 -- weighted # of milliseconds spent doing I/Os (unsigned int)
    This field is incremented at each I/O start, I/O completion, I/O
@@ -143,6 +143,9 @@ are summed (possibly overflowing the unsigned long variable they are
summed to) and the result given to the user.  There is no convenient
user interface for accessing the per-CPU counters themselves.

Since 4.19 request times are measured with nanoseconds precision and
truncated to milliseconds before showing in this interface.

Disks vs Partitions
-------------------

+4 −12
Original line number Diff line number Diff line
@@ -2,17 +2,9 @@
Generic Block Device Capability
===============================

This file documents the sysfs file block/<disk>/capability
This file documents the sysfs file ``block/<disk>/capability``.

capability is a hex word indicating which capabilities a specific disk
supports.  For more information on bits not listed here, see
include/linux/genhd.h
``capability`` is a bitfield, printed in hexadecimal, indicating which
capabilities a specific block device supports:

GENHD_FL_MEDIA_CHANGE_NOTIFY
----------------------------

Value: 4

When this bit is set, the disk supports Asynchronous Notification
of media change events.  These events will be broadcast to user
space via kernel uevent.
.. kernel-doc:: include/linux/genhd.h
+0 −21
Original line number Diff line number Diff line
@@ -299,7 +299,6 @@ Summary:
   scsi_host_alloc - return a new scsi_host instance whose refcount==1
   scsi_host_get - increments Scsi_Host instance's refcount
   scsi_host_put - decrements Scsi_Host instance's refcount (free if 0)
   scsi_partsize - parse partition table into cylinders, heads + sectors
   scsi_register - create and register a scsi host adapter instance.
   scsi_remove_device - detach and remove a SCSI device
   scsi_remove_host - detach and remove all SCSI devices owned by host
@@ -472,26 +471,6 @@ void scsi_host_get(struct Scsi_Host *shost)
void scsi_host_put(struct Scsi_Host *shost)


/**
 * scsi_partsize - parse partition table into cylinders, heads + sectors
 * @buf: pointer to partition table
 * @capacity: size of (total) disk in 512 byte sectors
 * @cyls: outputs number of cylinders calculated via this pointer
 * @hds: outputs number of heads calculated via this pointer
 * @secs: outputs number of sectors calculated via this pointer
 *
 *      Returns 0 on success, -1 on failure
 *
 *      Might block: no
 *
 *      Notes: Caller owns memory returned (free with kfree() )
 *
 *      Defined in: drivers/scsi/scsicam.c
 **/
int scsi_partsize(unsigned char *buf, unsigned long capacity,
                  unsigned int *cyls, unsigned int *hds, unsigned int *secs)


/**
 * scsi_register - create and register a scsi host adapter instance.
 * @sht:        pointer to scsi host template
+1 −2
Original line number Diff line number Diff line
@@ -118,12 +118,11 @@ static int __init nfhd_init_one(int id, u32 blocks, u32 bsize)
	dev->bsize = bsize;
	dev->bshift = ffs(bsize) - 10;

	dev->queue = blk_alloc_queue(GFP_KERNEL);
	dev->queue = blk_alloc_queue(nfhd_make_request, NUMA_NO_NODE);
	if (dev->queue == NULL)
		goto free_dev;

	dev->queue->queuedata = dev;
	blk_queue_make_request(dev->queue, nfhd_make_request);
	blk_queue_logical_block_size(dev->queue, bsize);

	dev->disk = alloc_disk(16);
+1 −2
Original line number Diff line number Diff line
@@ -267,13 +267,12 @@ static int __init simdisk_setup(struct simdisk *dev, int which,
	spin_lock_init(&dev->lock);
	dev->users = 0;

	dev->queue = blk_alloc_queue(GFP_KERNEL);
	dev->queue = blk_alloc_queue(simdisk_make_request, NUMA_NO_NODE);
	if (dev->queue == NULL) {
		pr_err("blk_alloc_queue failed\n");
		goto out_alloc_queue;
	}

	blk_queue_make_request(dev->queue, simdisk_make_request);
	dev->queue->queuedata = dev;

	dev->gd = alloc_disk(SIMDISK_MINORS);
Loading