diff options
| -rw-r--r-- | block/bio.c | 4 | ||||
| -rw-r--r-- | block/blk-cgroup.c | 23 | ||||
| -rw-r--r-- | block/bsg.c | 4 | ||||
| -rw-r--r-- | drivers/block/amiflop.c | 2 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_debugfs.c | 2 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_int.h | 19 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_main.c | 28 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_nl.c | 133 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_protocol.h | 47 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 251 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_req.c | 19 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_req.h | 2 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_state.c | 11 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_state.h | 5 | ||||
| -rw-r--r-- | drivers/block/drbd/drbd_worker.c | 2 | ||||
| -rw-r--r-- | drivers/block/loop.c | 1 | ||||
| -rw-r--r-- | drivers/block/sunvdc.c | 1 | ||||
| -rw-r--r-- | drivers/block/swim3.c | 14 | ||||
| -rw-r--r-- | drivers/cdrom/gdrom.c | 1 | ||||
| -rw-r--r-- | drivers/lightnvm/pblk-recovery.c | 1 | ||||
| -rw-r--r-- | include/linux/blk-cgroup.h | 21 | ||||
| -rw-r--r-- | include/linux/drbd.h | 2 | ||||
| -rw-r--r-- | include/linux/genl_magic_struct.h | 5 |
23 files changed, 467 insertions, 131 deletions
diff --git a/block/bio.c b/block/bio.c index 8281bfcbc265..4db1008309ed 100644 --- a/block/bio.c +++ b/block/bio.c | |||
| @@ -2097,8 +2097,12 @@ EXPORT_SYMBOL_GPL(bio_associate_blkg); | |||
| 2097 | */ | 2097 | */ |
| 2098 | void bio_clone_blkg_association(struct bio *dst, struct bio *src) | 2098 | void bio_clone_blkg_association(struct bio *dst, struct bio *src) |
| 2099 | { | 2099 | { |
| 2100 | rcu_read_lock(); | ||
| 2101 | |||
| 2100 | if (src->bi_blkg) | 2102 | if (src->bi_blkg) |
| 2101 | __bio_associate_blkg(dst, src->bi_blkg); | 2103 | __bio_associate_blkg(dst, src->bi_blkg); |
| 2104 | |||
| 2105 | rcu_read_unlock(); | ||
| 2102 | } | 2106 | } |
| 2103 | EXPORT_SYMBOL_GPL(bio_clone_blkg_association); | 2107 | EXPORT_SYMBOL_GPL(bio_clone_blkg_association); |
| 2104 | #endif /* CONFIG_BLK_CGROUP */ | 2108 | #endif /* CONFIG_BLK_CGROUP */ |
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index c8cc1cbb6370..2bed5725aa03 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c | |||
| @@ -438,29 +438,6 @@ static void blkg_destroy_all(struct request_queue *q) | |||
| 438 | spin_unlock_irq(&q->queue_lock); | 438 | spin_unlock_irq(&q->queue_lock); |
| 439 | } | 439 | } |
| 440 | 440 | ||
| 441 | /* | ||
| 442 | * A group is RCU protected, but having an rcu lock does not mean that one | ||
| 443 | * can access all the fields of blkg and assume these are valid. For | ||
| 444 | * example, don't try to follow throtl_data and request queue links. | ||
| 445 | * | ||
| 446 | * Having a reference to blkg under an rcu allows accesses to only values | ||
| 447 | * local to groups like group stats and group rate limits. | ||
| 448 | */ | ||
| 449 | void __blkg_release_rcu(struct rcu_head *rcu_head) | ||
| 450 | { | ||
| 451 | struct blkcg_gq *blkg = container_of(rcu_head, struct blkcg_gq, rcu_head); | ||
| 452 | |||
| 453 | /* release the blkcg and parent blkg refs this blkg has been holding */ | ||
| 454 | css_put(&blkg->blkcg->css); | ||
| 455 | if (blkg->parent) | ||
| 456 | blkg_put(blkg->parent); | ||
| 457 | |||
| 458 | wb_congested_put(blkg->wb_congested); | ||
| 459 | |||
| 460 | blkg_free(blkg); | ||
| 461 | } | ||
| 462 | EXPORT_SYMBOL_GPL(__blkg_release_rcu); | ||
| 463 | |||
| 464 | static int blkcg_reset_stats(struct cgroup_subsys_state *css, | 441 | static int blkcg_reset_stats(struct cgroup_subsys_state *css, |
| 465 | struct cftype *cftype, u64 val) | 442 | struct cftype *cftype, u64 val) |
| 466 | { | 443 | { |
diff --git a/block/bsg.c b/block/bsg.c index 44f6028b9567..50e5f8f666f2 100644 --- a/block/bsg.c +++ b/block/bsg.c | |||
| @@ -177,6 +177,10 @@ bsg_map_hdr(struct request_queue *q, struct sg_io_v4 *hdr, fmode_t mode) | |||
| 177 | goto out; | 177 | goto out; |
| 178 | } | 178 | } |
| 179 | 179 | ||
| 180 | pr_warn_once( | ||
| 181 | "BIDI support in bsg has been deprecated and might be removed. " | ||
| 182 | "Please report your use case to linux-scsi@vger.kernel.org\n"); | ||
| 183 | |||
| 180 | next_rq = blk_get_request(q, REQ_OP_SCSI_IN, 0); | 184 | next_rq = blk_get_request(q, REQ_OP_SCSI_IN, 0); |
| 181 | if (IS_ERR(next_rq)) { | 185 | if (IS_ERR(next_rq)) { |
| 182 | ret = PTR_ERR(next_rq); | 186 | ret = PTR_ERR(next_rq); |
diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c index bf996bd44cfc..0903e0803ec8 100644 --- a/drivers/block/amiflop.c +++ b/drivers/block/amiflop.c | |||
| @@ -1601,8 +1601,6 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, | |||
| 1601 | return p->type->read_size; | 1601 | return p->type->read_size; |
| 1602 | #endif | 1602 | #endif |
| 1603 | default: | 1603 | default: |
| 1604 | printk(KERN_DEBUG "fd_ioctl: unknown cmd %d for drive %d.", | ||
| 1605 | cmd, drive); | ||
| 1606 | return -ENOSYS; | 1604 | return -ENOSYS; |
| 1607 | } | 1605 | } |
| 1608 | return 0; | 1606 | return 0; |
diff --git a/drivers/block/drbd/drbd_debugfs.c b/drivers/block/drbd/drbd_debugfs.c index 5d5e8d6a8a56..f13b48ff5f43 100644 --- a/drivers/block/drbd/drbd_debugfs.c +++ b/drivers/block/drbd/drbd_debugfs.c | |||
| @@ -237,6 +237,8 @@ static void seq_print_peer_request_flags(struct seq_file *m, struct drbd_peer_re | |||
| 237 | seq_print_rq_state_bit(m, f & EE_CALL_AL_COMPLETE_IO, &sep, "in-AL"); | 237 | seq_print_rq_state_bit(m, f & EE_CALL_AL_COMPLETE_IO, &sep, "in-AL"); |
| 238 | seq_print_rq_state_bit(m, f & EE_SEND_WRITE_ACK, &sep, "C"); | 238 | seq_print_rq_state_bit(m, f & EE_SEND_WRITE_ACK, &sep, "C"); |
| 239 | seq_print_rq_state_bit(m, f & EE_MAY_SET_IN_SYNC, &sep, "set-in-sync"); | 239 | seq_print_rq_state_bit(m, f & EE_MAY_SET_IN_SYNC, &sep, "set-in-sync"); |
| 240 | seq_print_rq_state_bit(m, f & EE_TRIM, &sep, "trim"); | ||
| 241 | seq_print_rq_state_bit(m, f & EE_ZEROOUT, &sep, "zero-out"); | ||
| 240 | seq_print_rq_state_bit(m, f & EE_WRITE_SAME, &sep, "write-same"); | 242 | seq_print_rq_state_bit(m, f & EE_WRITE_SAME, &sep, "write-same"); |
| 241 | seq_putc(m, '\n'); | 243 | seq_putc(m, '\n'); |
| 242 | } | 244 | } |
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index 1e47db57b9d2..000a2f4c0e92 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h | |||
| @@ -430,7 +430,11 @@ enum { | |||
| 430 | __EE_MAY_SET_IN_SYNC, | 430 | __EE_MAY_SET_IN_SYNC, |
| 431 | 431 | ||
| 432 | /* is this a TRIM aka REQ_OP_DISCARD? */ | 432 | /* is this a TRIM aka REQ_OP_DISCARD? */ |
| 433 | __EE_IS_TRIM, | 433 | __EE_TRIM, |
| 434 | /* explicit zero-out requested, or | ||
| 435 | * our lower level cannot handle trim, | ||
| 436 | * and we want to fall back to zeroout instead */ | ||
| 437 | __EE_ZEROOUT, | ||
| 434 | 438 | ||
| 435 | /* In case a barrier failed, | 439 | /* In case a barrier failed, |
| 436 | * we need to resubmit without the barrier flag. */ | 440 | * we need to resubmit without the barrier flag. */ |
| @@ -472,7 +476,8 @@ enum { | |||
| 472 | }; | 476 | }; |
| 473 | #define EE_CALL_AL_COMPLETE_IO (1<<__EE_CALL_AL_COMPLETE_IO) | 477 | #define EE_CALL_AL_COMPLETE_IO (1<<__EE_CALL_AL_COMPLETE_IO) |
| 474 | #define EE_MAY_SET_IN_SYNC (1<<__EE_MAY_SET_IN_SYNC) | 478 | #define EE_MAY_SET_IN_SYNC (1<<__EE_MAY_SET_IN_SYNC) |
| 475 | #define EE_IS_TRIM (1<<__EE_IS_TRIM) | 479 | #define EE_TRIM (1<<__EE_TRIM) |
| 480 | #define EE_ZEROOUT (1<<__EE_ZEROOUT) | ||
| 476 | #define EE_RESUBMITTED (1<<__EE_RESUBMITTED) | 481 | #define EE_RESUBMITTED (1<<__EE_RESUBMITTED) |
| 477 | #define EE_WAS_ERROR (1<<__EE_WAS_ERROR) | 482 | #define EE_WAS_ERROR (1<<__EE_WAS_ERROR) |
| 478 | #define EE_HAS_DIGEST (1<<__EE_HAS_DIGEST) | 483 | #define EE_HAS_DIGEST (1<<__EE_HAS_DIGEST) |
| @@ -1556,6 +1561,8 @@ extern void start_resync_timer_fn(struct timer_list *t); | |||
| 1556 | extern void drbd_endio_write_sec_final(struct drbd_peer_request *peer_req); | 1561 | extern void drbd_endio_write_sec_final(struct drbd_peer_request *peer_req); |
| 1557 | 1562 | ||
| 1558 | /* drbd_receiver.c */ | 1563 | /* drbd_receiver.c */ |
| 1564 | extern int drbd_issue_discard_or_zero_out(struct drbd_device *device, | ||
| 1565 | sector_t start, unsigned int nr_sectors, int flags); | ||
| 1559 | extern int drbd_receiver(struct drbd_thread *thi); | 1566 | extern int drbd_receiver(struct drbd_thread *thi); |
| 1560 | extern int drbd_ack_receiver(struct drbd_thread *thi); | 1567 | extern int drbd_ack_receiver(struct drbd_thread *thi); |
| 1561 | extern void drbd_send_ping_wf(struct work_struct *ws); | 1568 | extern void drbd_send_ping_wf(struct work_struct *ws); |
| @@ -1609,13 +1616,7 @@ static inline void drbd_tcp_quickack(struct socket *sock) | |||
| 1609 | } | 1616 | } |
| 1610 | 1617 | ||
| 1611 | /* sets the number of 512 byte sectors of our virtual device */ | 1618 | /* sets the number of 512 byte sectors of our virtual device */ |
| 1612 | static inline void drbd_set_my_capacity(struct drbd_device *device, | 1619 | void drbd_set_my_capacity(struct drbd_device *device, sector_t size); |
| 1613 | sector_t size) | ||
| 1614 | { | ||
| 1615 | /* set_capacity(device->this_bdev->bd_disk, size); */ | ||
| 1616 | set_capacity(device->vdisk, size); | ||
| 1617 | device->this_bdev->bd_inode->i_size = (loff_t)size << 9; | ||
| 1618 | } | ||
| 1619 | 1620 | ||
| 1620 | /* | 1621 | /* |
| 1621 | * used to submit our private bio | 1622 | * used to submit our private bio |
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index f973a2a845c8..714eb64fabfd 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c | |||
| @@ -1668,7 +1668,11 @@ static u32 bio_flags_to_wire(struct drbd_connection *connection, | |||
| 1668 | (bio->bi_opf & REQ_PREFLUSH ? DP_FLUSH : 0) | | 1668 | (bio->bi_opf & REQ_PREFLUSH ? DP_FLUSH : 0) | |
| 1669 | (bio_op(bio) == REQ_OP_WRITE_SAME ? DP_WSAME : 0) | | 1669 | (bio_op(bio) == REQ_OP_WRITE_SAME ? DP_WSAME : 0) | |
| 1670 | (bio_op(bio) == REQ_OP_DISCARD ? DP_DISCARD : 0) | | 1670 | (bio_op(bio) == REQ_OP_DISCARD ? DP_DISCARD : 0) | |
| 1671 | (bio_op(bio) == REQ_OP_WRITE_ZEROES ? DP_DISCARD : 0); | 1671 | (bio_op(bio) == REQ_OP_WRITE_ZEROES ? |
| 1672 | ((connection->agreed_features & DRBD_FF_WZEROES) ? | ||
| 1673 | (DP_ZEROES |(!(bio->bi_opf & REQ_NOUNMAP) ? DP_DISCARD : 0)) | ||
| 1674 | : DP_DISCARD) | ||
| 1675 | : 0); | ||
| 1672 | else | 1676 | else |
| 1673 | return bio->bi_opf & REQ_SYNC ? DP_RW_SYNC : 0; | 1677 | return bio->bi_opf & REQ_SYNC ? DP_RW_SYNC : 0; |
| 1674 | } | 1678 | } |
| @@ -1712,10 +1716,11 @@ int drbd_send_dblock(struct drbd_peer_device *peer_device, struct drbd_request * | |||
| 1712 | } | 1716 | } |
| 1713 | p->dp_flags = cpu_to_be32(dp_flags); | 1717 | p->dp_flags = cpu_to_be32(dp_flags); |
| 1714 | |||
