Skip to content

Commit

Permalink
Merge tag 'for-5.9/block-20200802' of git://git.kernel.dk/linux-block
Browse files Browse the repository at this point in the history
Pull core block updates from Jens Axboe:
 "Good amount of cleanups and tech debt removals in here, and as a
  result, the diffstat shows a nice net reduction in code.

   - Softirq completion cleanups (Christoph)

   - Stop using ->queuedata (Christoph)

   - Cleanup bd claiming (Christoph)

   - Use check_events, moving away from the legacy media change
     (Christoph)

   - Use inode i_blkbits consistently (Christoph)

   - Remove old unused writeback congestion bits (Christoph)

   - Cleanup/unify submission path (Christoph)

   - Use bio_uninit consistently, instead of bio_disassociate_blkg
     (Christoph)

   - sbitmap cleared bits handling (John)

   - Request merging blktrace event addition (Jan)

   - sysfs add/remove race fixes (Luis)

   - blk-mq tag fixes/optimizations (Ming)

   - Duplicate words in comments (Randy)

   - Flush deferral cleanup (Yufen)

   - IO context locking/retry fixes (John)

   - struct_size() usage (Gustavo)

   - blk-iocost fixes (Chengming)

   - blk-cgroup IO stats fixes (Boris)

   - Various little fixes"

* tag 'for-5.9/block-20200802' of git://git.kernel.dk/linux-block: (135 commits)
  block: blk-timeout: delete duplicated word
  block: blk-mq-sched: delete duplicated word
  block: blk-mq: delete duplicated word
  block: genhd: delete duplicated words
  block: elevator: delete duplicated word and fix typos
  block: bio: delete duplicated words
  block: bfq-iosched: fix duplicated word
  iocost_monitor: start from the oldest usage index
  iocost: Fix check condition of iocg abs_vdebt
  block: Remove callback typedefs for blk_mq_ops
  block: Use non _rcu version of list functions for tag_set_list
  blk-cgroup: show global disk stats in root cgroup io.stat
  blk-cgroup: make iostat functions visible to stat printing
  block: improve discard bio alignment in __blkdev_issue_discard()
  block: change REQ_OP_ZONE_RESET and REQ_OP_ZONE_RESET_ALL to be odd numbers
  block: defer flush request no matter whether we have elevator
  block: make blk_timeout_init() static
  block: remove retry loop in ioc_release_fn()
  block: remove unnecessary ioc nested locking
  block: integrate bd_start_claiming into __blkdev_get
  ...
  • Loading branch information
torvalds committed Aug 3, 2020
2 parents 99f6cf6 + d958e34 commit 382625d
Show file tree
Hide file tree
Showing 157 changed files with 1,827 additions and 2,636 deletions.
3 changes: 1 addition & 2 deletions Documentation/admin-guide/cgroup-v2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1483,8 +1483,7 @@ IO Interface Files
~~~~~~~~~~~~~~~~~~

io.stat
A read-only nested-keyed file which exists on non-root
cgroups.
A read-only nested-keyed file.

Lines are keyed by $MAJ:$MIN device numbers and not ordered.
The following nested keys are defined.
Expand Down
2 changes: 1 addition & 1 deletion Documentation/block/biodoc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ Now the generic block layer performs partition-remapping early and thus
provides drivers with a sector number relative to whole device, rather than
having to take partition number into account in order to arrive at the true
sector number. The routine blk_partition_remap() is invoked by
generic_make_request even before invoking the queue specific make_request_fn,
submit_bio_noacct even before invoking the queue specific ->submit_bio,
so the i/o scheduler also gets to operate on whole disk sector numbers. This
should typically not require changes to block drivers, it just never gets
to invoke its own partition sector offset calculations since all bios
Expand Down
2 changes: 1 addition & 1 deletion Documentation/block/writeback_cache_control.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ the Forced Unit Access is implemented. The REQ_PREFLUSH and REQ_FUA flags
may both be set on a single bio.


Implementation details for make_request_fn based block drivers
Implementation details for bio based block drivers
--------------------------------------------------------------

These drivers will always see the REQ_PREFLUSH and REQ_FUA bits as they sit
Expand Down
18 changes: 1 addition & 17 deletions Documentation/cdrom/cdrom-standard.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ with the kernel as a block device by registering the following general
cdrom_release, /∗ release ∗/
NULL, /∗ fsync ∗/
NULL, /∗ fasync ∗/
cdrom_media_changed, /∗ media change ∗/
NULL /∗ revalidate ∗/
};

Expand Down Expand Up @@ -366,19 +365,6 @@ which may or may not be in the drive). If the drive is not a changer,
CDS_DRIVE_NOT_READY /* something is wrong, tray is moving? */
CDS_DISC_OK /* a disc is loaded and everything is fine */

::

int media_changed(struct cdrom_device_info *cdi, int disc_nr)

This function is very similar to the original function in $struct
file_operations*. It returns 1 if the medium of the device *cdi->dev*
has changed since the last call, and 0 otherwise. The parameter
*disc_nr* identifies a specific slot in a juke-box, it should be
ignored for single-disc drives. Note that by `re-routing` this
function through *cdrom_media_changed()*, we can implement separate
queues for the VFS and a new *ioctl()* function that can report device
changes to software (e. g., an auto-mounting daemon).

::

int tray_move(struct cdrom_device_info *cdi, int position)
Expand Down Expand Up @@ -917,9 +903,7 @@ commands can be identified by the underscores in their names.
maximum number of discs in the juke-box found in the *cdrom_dops*.
`CDROM_MEDIA_CHANGED`
Returns 1 if a disc has been changed since the last call.
Note that calls to *cdrom_media_changed* by the VFS are treated
by an independent queue, so both mechanisms will detect a
media change once. For juke-boxes, an extra argument *arg*
For juke-boxes, an extra argument *arg*
specifies the slot for which the information is given. The special
value *CDSL_CURRENT* requests that information about the currently
selected slot be returned.
Expand Down
2 changes: 1 addition & 1 deletion Documentation/fault-injection/fault-injection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Available fault injection capabilities

injects disk IO errors on devices permitted by setting
/sys/block/<device>/make-it-fail or
/sys/block/<device>/<partition>/make-it-fail. (generic_make_request())
/sys/block/<device>/<partition>/make-it-fail. (submit_bio_noacct())

- fail_mmc_request

Expand Down
4 changes: 1 addition & 3 deletions Documentation/filesystems/locking.rst
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ prototypes::
int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long);
int (*direct_access) (struct block_device *, sector_t, void **,
unsigned long *);
int (*media_changed) (struct gendisk *);
void (*unlock_native_capacity) (struct gendisk *);
int (*revalidate_disk) (struct gendisk *);
int (*getgeo)(struct block_device *, struct hd_geometry *);
Expand All @@ -483,14 +482,13 @@ release: yes
ioctl: no
compat_ioctl: no
direct_access: no
media_changed: no
unlock_native_capacity: no
revalidate_disk: no
getgeo: no
swap_slot_free_notify: no (see below)
======================= ===================

media_changed, unlock_native_capacity and revalidate_disk are called only from
unlock_native_capacity and revalidate_disk are called only from
check_disk_change().

swap_slot_free_notify is called with swap_lock and sometimes the page lock
Expand Down
4 changes: 2 additions & 2 deletions Documentation/trace/ftrace.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1453,7 +1453,7 @@ function-trace, we get a much larger output::
=> __blk_run_queue_uncond
=> __blk_run_queue
=> blk_queue_bio
=> generic_make_request
=> submit_bio_noacct
=> submit_bio
=> submit_bh
=> __ext3_get_inode_loc
Expand Down Expand Up @@ -1738,7 +1738,7 @@ tracers.
=> __blk_run_queue_uncond
=> __blk_run_queue
=> blk_queue_bio
=> generic_make_request
=> submit_bio_noacct
=> submit_bio
=> submit_bh
=> ext3_bread
Expand Down
8 changes: 4 additions & 4 deletions arch/m68k/emu/nfblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ struct nfhd_device {
struct gendisk *disk;
};

static blk_qc_t nfhd_make_request(struct request_queue *queue, struct bio *bio)
static blk_qc_t nfhd_submit_bio(struct bio *bio)
{
struct nfhd_device *dev = queue->queuedata;
struct nfhd_device *dev = bio->bi_disk->private_data;
struct bio_vec bvec;
struct bvec_iter iter;
int dir, len, shift;
Expand Down Expand Up @@ -93,6 +93,7 @@ static int nfhd_getgeo(struct block_device *bdev, struct hd_geometry *geo)

static const struct block_device_operations nfhd_ops = {
.owner = THIS_MODULE,
.submit_bio = nfhd_submit_bio,
.getgeo = nfhd_getgeo,
};

Expand All @@ -118,11 +119,10 @@ 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(nfhd_make_request, NUMA_NO_NODE);
dev->queue = blk_alloc_queue(NUMA_NO_NODE);
if (dev->queue == NULL)
goto free_dev;

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

dev->disk = alloc_disk(16);
Expand Down
11 changes: 4 additions & 7 deletions arch/xtensa/platforms/iss/simdisk.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ static void simdisk_transfer(struct simdisk *dev, unsigned long sector,
spin_unlock(&dev->lock);
}

static blk_qc_t simdisk_make_request(struct request_queue *q, struct bio *bio)
static blk_qc_t simdisk_submit_bio(struct bio *bio)
{
struct simdisk *dev = q->queuedata;
struct simdisk *dev = bio->bi_disk->private_data;
struct bio_vec bvec;
struct bvec_iter iter;
sector_t sector = bio->bi_iter.bi_sector;
Expand All @@ -127,8 +127,6 @@ static int simdisk_open(struct block_device *bdev, fmode_t mode)
struct simdisk *dev = bdev->bd_disk->private_data;

spin_lock(&dev->lock);
if (!dev->users)
check_disk_change(bdev);
++dev->users;
spin_unlock(&dev->lock);
return 0;
Expand All @@ -144,6 +142,7 @@ static void simdisk_release(struct gendisk *disk, fmode_t mode)

static const struct block_device_operations simdisk_ops = {
.owner = THIS_MODULE,
.submit_bio = simdisk_submit_bio,
.open = simdisk_open,
.release = simdisk_release,
};
Expand Down Expand Up @@ -267,14 +266,12 @@ static int __init simdisk_setup(struct simdisk *dev, int which,
spin_lock_init(&dev->lock);
dev->users = 0;

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

dev->queue->queuedata = dev;

dev->gd = alloc_disk(SIMDISK_MINORS);
if (dev->gd == NULL) {
pr_err("alloc_disk failed\n");
Expand Down
2 changes: 1 addition & 1 deletion block/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

obj-$(CONFIG_BLOCK) := bio.o elevator.o blk-core.o blk-sysfs.o \
blk-flush.o blk-settings.o blk-ioc.o blk-map.o \
blk-exec.o blk-merge.o blk-softirq.o blk-timeout.o \
blk-exec.o blk-merge.o blk-timeout.o \
blk-lib.o blk-mq.o blk-mq-tag.o blk-stat.o \
blk-mq-sysfs.o blk-mq-cpumap.o blk-mq-sched.o ioctl.o \
genhd.o ioprio.o badblocks.o partitions/ blk-rq-qos.o
Expand Down
2 changes: 1 addition & 1 deletion block/bfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -4714,7 +4714,7 @@ static struct request *__bfq_dispatch_request(struct blk_mq_hw_ctx *hctx)
* some unlucky request wait for as long as the device
* wishes.
*
* Of course, serving one request at at time may cause loss of
* Of course, serving one request at a time may cause loss of
* throughput.
*/
if (bfqd->strict_guarantees && bfqd->rq_in_driver > 0)
Expand Down
Loading

0 comments on commit 382625d

Please sign in to comment.