aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-18 15:12:45 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-18 15:12:45 -0400
commite75437fb9322cf0ac707046a12d78a25f9d52ccf (patch)
tree959fbda9d606f500e5c554eb68984111a9e6b3b3 /drivers/block
parentd3dc366bbaf07c125561e90d6da4bb147741101a (diff)
parentb277da0a8a594308e17881f4926879bd5fca2a2d (diff)
Merge branch 'for-3.18/drivers' of git://git.kernel.dk/linux-block
Pull block layer driver update from Jens Axboe: "This is the block driver pull request for 3.18. Not a lot in there this round, and nothing earth shattering. - A round of drbd fixes from the linbit team, and an improvement in asender performance. - Removal of deprecated (and unused) IRQF_DISABLED flag in rsxx and hd from Michael Opdenacker. - Disable entropy collection from flash devices by default, from Mike Snitzer. - A small collection of xen blkfront/back fixes from Roger Pau Monné and Vitaly Kuznetsov" * 'for-3.18/drivers' of git://git.kernel.dk/linux-block: block: disable entropy contributions for nonrot devices xen, blkfront: factor out flush-related checks from do_blkif_request() xen-blkback: fix leak on grant map error path xen/blkback: unmap all persistent grants when frontend gets disconnected rsxx: Remove deprecated IRQF_DISABLED block: hd: remove deprecated IRQF_DISABLED drbd: use RB_DECLARE_CALLBACKS() to define augment callbacks drbd: compute the end before rb_insert_augmented() drbd: Add missing newline in resync progress display in /proc/drbd drbd: reduce lock contention in drbd_worker drbd: Improve asender performance drbd: Get rid of the WORK_PENDING macro drbd: Get rid of the __no_warn and __cond_lock macros drbd: Avoid inconsistent locking warning drbd: Remove superfluous newline from "resync_extents" debugfs entry. drbd: Use consistent names for all the bi_end_io callbacks drbd: Use better variable names
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/drbd/drbd_actlog.c4
-rw-r--r--drivers/block/drbd/drbd_bitmap.c6
-rw-r--r--drivers/block/drbd/drbd_debugfs.c2
-rw-r--r--drivers/block/drbd/drbd_int.h19
-rw-r--r--drivers/block/drbd/drbd_interval.c40
-rw-r--r--drivers/block/drbd/drbd_main.c28
-rw-r--r--drivers/block/drbd/drbd_proc.c4
-rw-r--r--drivers/block/drbd/drbd_receiver.c52
-rw-r--r--drivers/block/drbd/drbd_req.c2
-rw-r--r--drivers/block/drbd/drbd_state.c18
-rw-r--r--drivers/block/drbd/drbd_worker.c51
-rw-r--r--drivers/block/hd.c12
-rw-r--r--drivers/block/mtip32xx/mtip32xx.c1
-rw-r--r--drivers/block/nbd.c1
-rw-r--r--drivers/block/null_blk.c1
-rw-r--r--drivers/block/nvme-core.c1
-rw-r--r--drivers/block/rsxx/core.c2
-rw-r--r--drivers/block/rsxx/dev.c1
-rw-r--r--drivers/block/skd_main.c1
-rw-r--r--drivers/block/xen-blkback/blkback.c1
-rw-r--r--drivers/block/xen-blkback/xenbus.c6
-rw-r--r--drivers/block/xen-blkfront.c12
-rw-r--r--drivers/block/zram/zram_drv.c1
23 files changed, 121 insertions, 145 deletions
diff --git a/drivers/block/drbd/drbd_actlog.c b/drivers/block/drbd/drbd_actlog.c
index d26a3fa63688..a2dfa169237d 100644
--- a/drivers/block/drbd/drbd_actlog.c
+++ b/drivers/block/drbd/drbd_actlog.c
@@ -158,14 +158,14 @@ static int _drbd_md_sync_page_io(struct drbd_device *device,
158 if (bio_add_page(bio, device->md_io.page, size, 0) != size) 158 if (bio_add_page(bio, device->md_io.page, size, 0) != size)
159 goto out; 159 goto out;
160 bio->bi_private = device; 160 bio->bi_private = device;
161 bio->bi_end_io = drbd_md_io_complete; 161 bio->bi_end_io = drbd_md_endio;
162 bio->bi_rw = rw; 162 bio->bi_rw = rw;
163 163
164 if (!(rw & WRITE) && device->state.disk == D_DISKLESS && device->ldev == NULL) 164 if (!(rw & WRITE) && device->state.disk == D_DISKLESS && device->ldev == NULL)
165 /* special case, drbd_md_read() during drbd_adm_attach(): no get_ldev */ 165 /* special case, drbd_md_read() during drbd_adm_attach(): no get_ldev */
166 ; 166 ;
167 else if (!get_ldev_if_state(device, D_ATTACHING)) { 167 else if (!get_ldev_if_state(device, D_ATTACHING)) {
168 /* Corresponding put_ldev in drbd_md_io_complete() */ 168 /* Corresponding put_ldev in drbd_md_endio() */
169 drbd_err(device, "ASSERT FAILED: get_ldev_if_state() == 1 in _drbd_md_sync_page_io()\n"); 169 drbd_err(device, "ASSERT FAILED: get_ldev_if_state() == 1 in _drbd_md_sync_page_io()\n");
170 err = -ENODEV; 170 err = -ENODEV;
171 goto out; 171 goto out;
diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c
index 426c97aef900..434c77dcc99e 100644
--- a/drivers/block/drbd/drbd_bitmap.c
+++ b/drivers/block/drbd/drbd_bitmap.c
@@ -941,7 +941,7 @@ static void drbd_bm_aio_ctx_destroy(struct kref *kref)
941} 941}
942 942
943/* bv_page may be a copy, or may be the original */ 943/* bv_page may be a copy, or may be the original */
944static void bm_async_io_complete(struct bio *bio, int error) 944static void drbd_bm_endio(struct bio *bio, int error)
945{ 945{
946 struct drbd_bm_aio_ctx *ctx = bio->bi_private; 946 struct drbd_bm_aio_ctx *ctx = bio->bi_private;
947 struct drbd_device *device = ctx->device; 947 struct drbd_device *device = ctx->device;
@@ -1027,7 +1027,7 @@ static void bm_page_io_async(struct drbd_bm_aio_ctx *ctx, int page_nr) __must_ho
1027 * according to api. Do we want to assert that? */ 1027 * according to api. Do we want to assert that? */
1028 bio_add_page(bio, page, len, 0); 1028 bio_add_page(bio, page, len, 0);
1029 bio->bi_private = ctx; 1029 bio->bi_private = ctx;
1030 bio->bi_end_io = bm_async_io_complete; 1030 bio->bi_end_io = drbd_bm_endio;
1031 1031
1032 if (drbd_insert_fault(device, (rw & WRITE) ? DRBD_FAULT_MD_WR : DRBD_FAULT_MD_RD)) { 1032 if (drbd_insert_fault(device, (rw & WRITE) ? DRBD_FAULT_MD_WR : DRBD_FAULT_MD_RD)) {
1033 bio->bi_rw |= rw; 1033 bio->bi_rw |= rw;
@@ -1125,7 +1125,7 @@ static int bm_rw(struct drbd_device *device, const unsigned int flags, unsigned
1125 } 1125 }
1126 1126
1127 /* 1127 /*
1128 * We initialize ctx->in_flight to one to make sure bm_async_io_complete 1128 * We initialize ctx->in_flight to one to make sure drbd_bm_endio
1129 * will not set ctx->done early, and decrement / test it here. If there 1129 * will not set ctx->done early, and decrement / test it here. If there
1130 * are still some bios in flight, we need to wait for them here. 1130 * are still some bios in flight, we need to wait for them here.
1131 * If all IO is done already (or nothing had been submitted), there is 1131 * If all IO is done already (or nothing had been submitted), there is
diff --git a/drivers/block/drbd/drbd_debugfs.c b/drivers/block/drbd/drbd_debugfs.c
index 5c20b18540b8..900d4d3272d1 100644
--- a/drivers/block/drbd/drbd_debugfs.c
+++ b/drivers/block/drbd/drbd_debugfs.c
@@ -695,7 +695,7 @@ static void resync_dump_detail(struct seq_file *m, struct lc_element *e)
695{ 695{
696 struct bm_extent *bme = lc_entry(e, struct bm_extent, lce); 696 struct bm_extent *bme = lc_entry(e, struct bm_extent, lce);
697 697
698 seq_printf(m, "%5d %s %s %s\n", bme->rs_left, 698 seq_printf(m, "%5d %s %s %s", bme->rs_left,
699 test_bit(BME_NO_WRITES, &bme->flags) ? "NO_WRITES" : "---------", 699 test_bit(BME_NO_WRITES, &bme->flags) ? "NO_WRITES" : "---------",
700 test_bit(BME_LOCKED, &bme->flags) ? "LOCKED" : "------", 700 test_bit(BME_LOCKED, &bme->flags) ? "LOCKED" : "------",
701 test_bit(BME_PRIORITY, &bme->flags) ? "PRIORITY" : "--------" 701 test_bit(BME_PRIORITY, &bme->flags) ? "PRIORITY" : "--------"
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index 1a000016ccdf..9b22f8f01b57 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -61,8 +61,6 @@
61# define __must_hold(x) 61# define __must_hold(x)
62#endif 62#endif
63 63
64#define __no_warn(lock, stmt) do { __acquire(lock); stmt; __release(lock); } while (0)
65
66/* module parameter, defined in drbd_main.c */ 64/* module parameter, defined in drbd_main.c */
67extern unsigned int minor_count; 65extern unsigned int minor_count;
68extern bool disable_sendpage; 66extern bool disable_sendpage;
@@ -1483,7 +1481,7 @@ extern int drbd_khelper(struct drbd_device *device, char *cmd);
1483 1481
1484/* drbd_worker.c */ 1482/* drbd_worker.c */
1485/* bi_end_io handlers */ 1483/* bi_end_io handlers */
1486extern void drbd_md_io_complete(struct bio *bio, int error); 1484extern void drbd_md_endio(struct bio *bio, int error);
1487extern void drbd_peer_request_endio(struct bio *bio, int error); 1485extern void drbd_peer_request_endio(struct bio *bio, int error);
1488extern void drbd_request_endio(struct bio *bio, int error); 1486extern void drbd_request_endio(struct bio *bio, int error);
1489extern int drbd_worker(struct drbd_thread *thi); 1487extern int drbd_worker(struct drbd_thread *thi);
@@ -2100,16 +2098,19 @@ static inline bool is_sync_state(enum drbd_conns connection_state)
2100 2098
2101/** 2099/**
2102 * get_ldev() - Increase the ref count on device->ldev. Returns 0 if there is no ldev 2100 * get_ldev() - Increase the ref count on device->ldev. Returns 0 if there is no ldev
2103 * @M: DRBD device. 2101 * @_device: DRBD device.
2102 * @_min_state: Minimum device state required for success.
2104 * 2103 *
2105 * You have to call put_ldev() when finished working with device->ldev. 2104 * You have to call put_ldev() when finished working with device->ldev.
2106 */ 2105 */
2107#define get_ldev(M) __cond_lock(local, _get_ldev_if_state(M,D_INCONSISTENT)) 2106#define get_ldev_if_state(_device, _min_state) \
2108#define get_ldev_if_state(M,MINS) __cond_lock(local, _get_ldev_if_state(M,MINS)) 2107 (_get_ldev_if_state((_device), (_min_state)) ? \
2108 ({ __acquire(x); true; }) : false)
2109#define get_ldev(_device) get_ldev_if_state(_device, D_INCONSISTENT)
2109 2110
2110static inline void put_ldev(struct drbd_device *device) 2111static inline void put_ldev(struct drbd_device *device)
2111{ 2112{
2112 enum drbd_disk_state ds = device->state.disk; 2113 enum drbd_disk_state disk_state = device->state.disk;
2113 /* We must check the state *before* the atomic_dec becomes visible, 2114 /* We must check the state *before* the atomic_dec becomes visible,
2114 * or we have a theoretical race where someone hitting zero, 2115 * or we have a theoretical race where someone hitting zero,
2115 * while state still D_FAILED, will then see D_DISKLESS in the 2116 * while state still D_FAILED, will then see D_DISKLESS in the
@@ -2122,10 +2123,10 @@ static inline void put_ldev(struct drbd_device *device)
2122 __release(local); 2123 __release(local);
2123 D_ASSERT(device, i >= 0); 2124 D_ASSERT(device, i >= 0);
2124 if (i == 0) { 2125 if (i == 0) {
2125 if (ds == D_DISKLESS) 2126 if (disk_state == D_DISKLESS)
2126 /* even internal references gone, safe to destroy */ 2127 /* even internal references gone, safe to destroy */
2127 drbd_device_post_work(device, DESTROY_DISK); 2128 drbd_device_post_work(device, DESTROY_DISK);
2128 if (ds == D_FAILED) 2129