"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "drbd/drbd-kernel-compat/cocci_cache/be48865688d5c6864de6c44d54cf9640/compat.patch" between
drbd-9.1.10.tar.gz and drbd-9.1.11.tar.gz

About: DRBD (9.x) is a block device which is designed to build high availability clusters. This is done by mirroring a whole block device via (a dedicated) network. You could see it as a "network RAID-1". The driver code got integrated into the vanilla Linux kernel.

compat.patch  (drbd-9.1.10):compat.patch  (drbd-9.1.11)
--- ./drbd_int.h --- ./drbd_int.h
+++ /tmp/cocci-output-404230-4a14a4-drbd_int.h
@@ -1763,7 +1763,7 @@ extern sector_t drbd_get_max_capacity( @@ -1763,7 +1763,7 @@ extern sector_t drbd_get_max_capacity(
* we limit us to a platform agnostic constant here for now. * we limit us to a platform agnostic constant here for now.
* A followup commit may allow even bigger BIO sizes, * A followup commit may allow even bigger BIO sizes,
* once we thought that through. */ * once we thought that through. */
-#define DRBD_BIO_MAX_PAGES (BIO_MAX_VECS << PAGE_SHIFT) -#define DRBD_BIO_MAX_PAGES (BIO_MAX_VECS << PAGE_SHIFT)
+#define DRBD_BIO_MAX_PAGES (BIO_MAX_PAGES << PAGE_SHIFT) +#define DRBD_BIO_MAX_PAGES (BIO_MAX_PAGES << PAGE_SHIFT)
#if DRBD_MAX_BIO_SIZE > DRBD_BIO_MAX_PAGES #if DRBD_MAX_BIO_SIZE > DRBD_BIO_MAX_PAGES
#error Architecture not supported: DRBD_MAX_BIO_SIZE > (BIO_MAX_VECS << PAGE_SH IFT) #error Architecture not supported: DRBD_MAX_BIO_SIZE > (BIO_MAX_VECS << PAGE_SH IFT)
#endif #endif
@@ -1886,7 +1886,7 @@ extern void do_submit(struct work_struct @@ -1886,7 +1886,7 @@ extern void do_submit(struct work_struct
skipping to change at line 31 skipping to change at line 31
@@ -2086,7 +2086,7 @@ extern void drbd_try_to_get_resynced(str @@ -2086,7 +2086,7 @@ extern void drbd_try_to_get_resynced(str
static inline sector_t drbd_get_capacity(struct block_device *bdev) static inline sector_t drbd_get_capacity(struct block_device *bdev)
{ {
- return bdev ? bdev_nr_sectors(bdev) : 0; - return bdev ? bdev_nr_sectors(bdev) : 0;
+ return bdev ? i_size_read(bdev->bd_inode) >> 9 : 0; + return bdev ? i_size_read(bdev->bd_inode) >> 9 : 0;
} }
/* sets the number of 512 byte sectors of our virtual device */ /* sets the number of 512 byte sectors of our virtual device */
--- drbd-headers/linux/genl_magic_struct.h --- drbd-headers/linux/genl_magic_struct.h
+++ /tmp/cocci-output-404230-45ed56-genl_magic_struct.h
@@ -107,7 +107,7 @@ static inline int nla_put_u64_0pad(struc @@ -107,7 +107,7 @@ static inline int nla_put_u64_0pad(struc
nla_get_u64, nla_put_u64_0pad, false) nla_get_u64, nla_put_u64_0pad, false)
#define __str_field(attr_nr, attr_flag, name, maxlen) \ #define __str_field(attr_nr, attr_flag, name, maxlen) \
__array(attr_nr, attr_flag, name, NLA_NUL_STRING, char, maxlen, \ __array(attr_nr, attr_flag, name, NLA_NUL_STRING, char, maxlen, \
- nla_strscpy, nla_put, false) - nla_strscpy, nla_put, false)
+ nla_strlcpy, nla_put, false) + nla_strlcpy, nla_put, false)
#define __bin_field(attr_nr, attr_flag, name, maxlen) \ #define __bin_field(attr_nr, attr_flag, name, maxlen) \
__array(attr_nr, attr_flag, name, NLA_BINARY, char, maxlen, \ __array(attr_nr, attr_flag, name, NLA_BINARY, char, maxlen, \
nla_memcpy, nla_put, false) nla_memcpy, nla_put, false)
--- drbd_sender.c --- drbd_sender.c
+++ /tmp/cocci-output-404230-1d5cad-drbd_sender.c
@@ -2063,7 +2063,8 @@ void drbd_rs_controller_reset(struct drb @@ -2063,7 +2063,8 @@ void drbd_rs_controller_reset(struct drb
atomic_set(&peer_device->device->rs_sect_ev, 0); /* FIXME: ??? */ atomic_set(&peer_device->device->rs_sect_ev, 0); /* FIXME: ??? */
peer_device->rs_last_mk_req_kt = ktime_get(); peer_device->rs_last_mk_req_kt = ktime_get();
peer_device->rs_in_flight = 0; peer_device->rs_in_flight = 0;
- peer_device->rs_last_events = (int)part_stat_read_accum(disk->part0, sect ors); - peer_device->rs_last_events = (int)part_stat_read_accum(disk->part0, sect ors);
+ peer_device->rs_last_events = (int)part_stat_read_accum(&disk->part0, + peer_device->rs_last_events = (int)part_stat_read_accum(&disk->part0,
+ sectors); + sectors);
/* Updating the RCU protected object in place is necessary since /* Updating the RCU protected object in place is necessary since
this function gets called from atomic context. this function gets called from atomic context.
@@ -2777,7 +2778,7 @@ static void re_init_if_first_write(struc @@ -2777,7 +2778,7 @@ static void re_init_if_first_write(struc
connection->send.current_epoch_writes = 0; connection->send.current_epoch_writes = 0;
connection->send.last_sent_barrier_jif = jiffies; connection->send.last_sent_barrier_jif = jiffies;
connection->send.current_dagtag_sector = connection->send.current_dagtag_sector =
- connection->resource->dagtag_sector - ((BIO_MAX_VECS << P AGE_SHIFT) >> 9) - 1; - connection->resource->dagtag_sector - ((BIO_MAX_VECS << P AGE_SHIFT) >> 9) - 1;
+ connection->resource->dagtag_sector - ((BIO_MAX_PAGES << PAGE_SHIFT) >> 9) - 1; + connection->resource->dagtag_sector - ((BIO_MAX_PAGES << PAGE_SHIFT) >> 9) - 1;
} }
} }
--- drbd_req.c --- drbd_req.c
+++ /tmp/cocci-output-404230-d0f8b9-drbd_req.c @@ -1276,7 +1276,7 @@ static bool remote_due_to_read_balancing
@@ -1267,7 +1267,7 @@ static bool remote_due_to_read_balancing
switch (rbm) { switch (rbm) {
case RB_CONGESTED_REMOTE: case RB_CONGESTED_REMOTE:
return bdi_read_congested( return bdi_read_congested(
- device->ldev->backing_bdev->bd_disk->bdi); - device->ldev->backing_bdev->bd_disk->bdi);
+ device->ldev->backing_bdev->bd_disk->queue->backing_dev_i nfo); + device->ldev->backing_bdev->bd_disk->queue->backing_dev_i nfo);
case RB_LEAST_PENDING: case RB_LEAST_PENDING:
return atomic_read(&device->local_cnt) > return atomic_read(&device->local_cnt) >
atomic_read(&peer_device->ap_pending_cnt) + atomic_read(& peer_device->rs_pending_cnt); atomic_read(&peer_device->ap_pending_cnt) + atomic_read(& peer_device->rs_pending_cnt);
@@ -2396,9 +2396,9 @@ static bool drbd_fail_request_early(stru @@ -2405,9 +2405,9 @@ static bool drbd_fail_request_early(stru
return false; return false;
} }
-void drbd_submit_bio(struct bio *bio) -void drbd_submit_bio(struct bio *bio)
+blk_qc_t drbd_submit_bio(struct bio *bio) +blk_qc_t drbd_submit_bio(struct bio *bio)
{ {
- struct drbd_device *device = bio->bi_bdev->bd_disk->private_data; - struct drbd_device *device = bio->bi_bdev->bd_disk->private_data;
+ struct drbd_device *device = bio->bi_disk->private_data; + struct drbd_device *device = bio->bi_disk->private_data;
#ifdef CONFIG_DRBD_TIMING_STATS #ifdef CONFIG_DRBD_TIMING_STATS
ktime_t start_kt; ktime_t start_kt;
#endif #endif
@@ -2407,7 +2407,7 @@ void drbd_submit_bio(struct bio *bio) @@ -2416,7 +2416,7 @@ void drbd_submit_bio(struct bio *bio)
if (drbd_fail_request_early(device, bio)) { if (drbd_fail_request_early(device, bio)) {
bio->bi_status = BLK_STS_IOERR; bio->bi_status = BLK_STS_IOERR;
bio_endio(bio); bio_endio(bio);
- return; - return;
+ return BLK_QC_T_NONE; + return BLK_QC_T_NONE;
} }
blk_queue_split(&bio); blk_queue_split(&bio);
@@ -2415,7 +2415,7 @@ void drbd_submit_bio(struct bio *bio) @@ -2424,7 +2424,7 @@ void drbd_submit_bio(struct bio *bio)
if (device->cached_err_io) { if (device->cached_err_io) {
bio->bi_status = BLK_STS_IOERR; bio->bi_status = BLK_STS_IOERR;
bio_endio(bio); bio_endio(bio);
- return; - return;
+ return BLK_QC_T_NONE; + return BLK_QC_T_NONE;
} }
/* This is both an optimization: READ of size 0, nothing to do /* This is both an optimization: READ of size 0, nothing to do
@@ -2427,13 +2427,14 @@ void drbd_submit_bio(struct bio *bio) @@ -2436,13 +2436,14 @@ void drbd_submit_bio(struct bio *bio)
if (bio_op(bio) == REQ_OP_READ && bio->bi_iter.bi_size == 0) { if (bio_op(bio) == REQ_OP_READ && bio->bi_iter.bi_size == 0) {
WARN_ONCE(1, "size zero read from upper layers"); WARN_ONCE(1, "size zero read from upper layers");
bio_endio(bio); bio_endio(bio);
- return; - return;
+ return BLK_QC_T_NONE; + return BLK_QC_T_NONE;
} }
ktime_get_accounting(start_kt); ktime_get_accounting(start_kt);
start_jif = jiffies; start_jif = jiffies;
__drbd_make_request(device, bio, start_kt, start_jif); __drbd_make_request(device, bio, start_kt, start_jif);
+ return BLK_QC_T_NONE; + return BLK_QC_T_NONE;
} }
static unsigned long time_min_in_future(unsigned long now, static unsigned long time_min_in_future(unsigned long now,
--- drbd_receiver.c --- drbd_receiver.c
+++ /tmp/cocci-output-404230-733599-drbd_receiver.c
@@ -1294,8 +1294,7 @@ static void one_flush_endio(struct bio * @@ -1294,8 +1294,7 @@ static void one_flush_endio(struct bio *
static void submit_one_flush(struct drbd_device *device, struct issue_flush_con text *ctx) static void submit_one_flush(struct drbd_device *device, struct issue_flush_con text *ctx)
{ {
- struct bio *bio = bio_alloc(device->ldev->backing_bdev, 0, - struct bio *bio = bio_alloc(device->ldev->backing_bdev, 0,
- REQ_OP_FLUSH | REQ_PREFLUSH, GFP_NOIO); - REQ_OP_FLUSH | REQ_PREFLUSH, GFP_NOIO);
+ struct bio *bio = bio_alloc(GFP_NOIO, 0); + struct bio *bio = bio_alloc(GFP_NOIO, 0);
struct one_flush_context *octx = kmalloc(sizeof(*octx), GFP_NOIO); struct one_flush_context *octx = kmalloc(sizeof(*octx), GFP_NOIO);
if (!octx) { if (!octx) {
skipping to change at line 181 skipping to change at line 181
@@ -3171,7 +3173,7 @@ bool drbd_rs_c_min_rate_throttle(struct @@ -3171,7 +3173,7 @@ bool drbd_rs_c_min_rate_throttle(struct
if (c_min_rate == 0) if (c_min_rate == 0)
return false; return false;
- curr_events = (int)part_stat_read_accum(disk->part0, sectors) - curr_events = (int)part_stat_read_accum(disk->part0, sectors)
+ curr_events = (int)part_stat_read_accum(&disk->part0, sectors) + curr_events = (int)part_stat_read_accum(&disk->part0, sectors)
- atomic_read(&device->rs_sect_ev); - atomic_read(&device->rs_sect_ev);
if (atomic_read(&device->ap_actlog_cnt) || curr_events - peer_device->rs_ last_events > 64) { if (atomic_read(&device->ap_actlog_cnt) || curr_events - peer_device->rs_ last_events > 64) {
--- drbd_nl.c --- drbd_nl.c
+++ /tmp/cocci-output-404230-7aed6d-drbd_nl.c
@@ -1495,7 +1495,8 @@ void drbd_set_my_capacity(struct drbd_de @@ -1495,7 +1495,8 @@ void drbd_set_my_capacity(struct drbd_de
{ {
char ppb[10]; char ppb[10];
- set_capacity_and_notify(device->vdisk, size); - set_capacity_and_notify(device->vdisk, size);
+ set_capacity(device->vdisk, size); + set_capacity(device->vdisk, size);
+ revalidate_disk_size(device->vdisk, false); + revalidate_disk_size(device->vdisk, false);
drbd_info(device, "size = %s (%llu KB)\n", drbd_info(device, "size = %s (%llu KB)\n",
ppsize(ppb, size>>1), (unsigned long long)size>>1); ppsize(ppb, size>>1), (unsigned long long)size>>1);
skipping to change at line 229 skipping to change at line 229
@@ -5513,7 +5514,7 @@ static void device_to_statistics(struct @@ -5513,7 +5514,7 @@ static void device_to_statistics(struct
s->dev_disk_flags = md->flags; s->dev_disk_flags = md->flags;
s->dev_lower_blocked = s->dev_lower_blocked =
- bdi_congested(device->ldev->backing_bdev->bd_disk->bdi, - bdi_congested(device->ldev->backing_bdev->bd_disk->bdi,
+ bdi_congested(device->ldev->backing_bdev->bd_disk->queue- >backing_dev_info, + bdi_congested(device->ldev->backing_bdev->bd_disk->queue- >backing_dev_info,
(1 << WB_async_congested) | (1 << WB_async_congested) |
(1 << WB_sync_congested)); (1 << WB_sync_congested));
put_ldev(device); put_ldev(device);
--- drbd_main.c --- drbd_main.c
+++ /tmp/cocci-output-404230-f132a0-drbd_main.c
@@ -1569,7 +1569,7 @@ int drbd_send_sizes(struct drbd_peer_dev @@ -1569,7 +1569,7 @@ int drbd_send_sizes(struct drbd_peer_dev
p->qlim->io_opt = cpu_to_be32(bdev_io_opt(bdev)); p->qlim->io_opt = cpu_to_be32(bdev_io_opt(bdev));
p->qlim->discard_enabled = blk_queue_discard(q); p->qlim->discard_enabled = blk_queue_discard(q);
p->qlim->discard_zeroes_data = discard_zeroes_if_aligned || p->qlim->discard_zeroes_data = discard_zeroes_if_aligned ||
- queue_discard_zeroes_data(q) - queue_discard_zeroes_data(q)
+ 0/* queue_discard_zeroes_data(q) */ + 0/* queue_discard_zeroes_data(q) */
/* but that is always false on recent kernels */ /* but that is always false on recent kernels */
; ;
p->qlim->write_same_capable = !disable_write_same && p->qlim->write_same_capable = !disable_write_same &&
@@ -2765,7 +2765,10 @@ void drbd_fsync_device(struct drbd_devic @@ -2765,7 +2765,10 @@ void drbd_fsync_device(struct drbd_devic
skipping to change at line 332 skipping to change at line 332
out_no_io_page: out_no_io_page:
- blk_cleanup_disk(disk); - blk_cleanup_disk(disk);
+ put_disk(disk); + put_disk(disk);
out_no_disk: out_no_disk:
+ blk_cleanup_queue(q); + blk_cleanup_queue(q);
+out_no_q: +out_no_q:
kref_put(&resource->kref, drbd_destroy_resource); kref_put(&resource->kref, drbd_destroy_resource);
kref_debug_put(&resource->kref_debug, 4); kref_debug_put(&resource->kref_debug, 4);
/* kref debugging wants an extra put, see has_refs() */ /* kref debugging wants an extra put, see has_refs() */
--- drbd_debugfs.c --- drbd_debugfs.c
+++ /tmp/cocci-output-404230-b8dee1-drbd_debugfs.c
@@ -1827,6 +1827,23 @@ static const struct file_operations drbd @@ -1827,6 +1827,23 @@ static const struct file_operations drbd
static int drbd_compat_show(struct seq_file *m, void *ignored) static int drbd_compat_show(struct seq_file *m, void *ignored)
{ {
+ seq_puts(m, "bio_alloc__no_has_4_params\n"); + seq_puts(m, "bio_alloc__no_has_4_params\n");
+ seq_puts(m, "bio_bi_bdev__no_present\n"); + seq_puts(m, "bio_bi_bdev__no_present\n");
+ seq_puts(m, "blk_alloc_disk__no_present\n"); + seq_puts(m, "blk_alloc_disk__no_present\n");
+ seq_puts(m, "submit_bio__no_returns_void\n"); + seq_puts(m, "submit_bio__no_returns_void\n");
+ seq_puts(m, "disk_update_readahead__no_present\n"); + seq_puts(m, "disk_update_readahead__no_present\n");
+ seq_puts(m, "struct_gendisk__no_has_backing_dev_info\n"); + seq_puts(m, "struct_gendisk__no_has_backing_dev_info\n");
skipping to change at line 358 skipping to change at line 358
+ seq_puts(m, "gendisk_part0__no_is_block_device\n"); + seq_puts(m, "gendisk_part0__no_is_block_device\n");
+ seq_puts(m, "bio_max_vecs__no_present\n"); + seq_puts(m, "bio_max_vecs__no_present\n");
+ seq_puts(m, "fs_dax_get_by_bdev__no_takes_start_off\n"); + seq_puts(m, "fs_dax_get_by_bdev__no_takes_start_off\n");
+ seq_puts(m, "add_disk__no_returns_int\n"); + seq_puts(m, "add_disk__no_returns_int\n");
+ seq_puts(m, "bdev_nr_sectors__no_present\n"); + seq_puts(m, "bdev_nr_sectors__no_present\n");
+ seq_puts(m, "genhd_fl_no_part__no_present\n"); + seq_puts(m, "genhd_fl_no_part__no_present\n");
return 0; return 0;
} }
--- drbd_dax_pmem.c --- drbd_dax_pmem.c
+++ /tmp/cocci-output-404230-68145b-drbd_dax_pmem.c
@@ -58,9 +58,8 @@ int drbd_dax_open(struct drbd_backing_de @@ -58,9 +58,8 @@ int drbd_dax_open(struct drbd_backing_de
{ {
struct dax_device *dax_dev; struct dax_device *dax_dev;
int err; int err;
- u64 part_off; - u64 part_off;
- dax_dev = fs_dax_get_by_bdev(bdev->md_bdev, &part_off); - dax_dev = fs_dax_get_by_bdev(bdev->md_bdev, &part_off);
+ dax_dev = fs_dax_get_by_bdev(bdev->md_bdev); + dax_dev = fs_dax_get_by_bdev(bdev->md_bdev);
if (!dax_dev) if (!dax_dev)
return -ENODEV; return -ENODEV;
--- drbd_bitmap.c --- drbd_bitmap.c
+++ /tmp/cocci-output-404230-787437-drbd_bitmap.c
@@ -1185,14 +1185,15 @@ static void bm_page_io_async(struct drbd @@ -1185,14 +1185,15 @@ static void bm_page_io_async(struct drbd
} else } else
page = b->bm_pages[page_nr]; page = b->bm_pages[page_nr];
- bio = bio_alloc_bioset(device->ldev->md_bdev, 1, op, GFP_NOIO, - bio = bio_alloc_bioset(device->ldev->md_bdev, 1, op, GFP_NOIO,
- &drbd_md_io_bio_set); - &drbd_md_io_bio_set);
+ bio = bio_alloc_bioset(GFP_NOIO, 1, &drbd_md_io_bio_set); + bio = bio_alloc_bioset(GFP_NOIO, 1, &drbd_md_io_bio_set);
+ bio_set_dev(bio, device->ldev->md_bdev); + bio_set_dev(bio, device->ldev->md_bdev);
bio->bi_iter.bi_sector = on_disk_sector; bio->bi_iter.bi_sector = on_disk_sector;
/* bio_add_page of a single page to an empty bio will always succeed, /* bio_add_page of a single page to an empty bio will always succeed,
* according to api. Do we want to assert that? */ * according to api. Do we want to assert that? */
bio_add_page(bio, page, len, 0); bio_add_page(bio, page, len, 0);
bio->bi_private = ctx; bio->bi_private = ctx;
bio->bi_end_io = drbd_bm_endio; bio->bi_end_io = drbd_bm_endio;
+ bio->bi_opf = op; + bio->bi_opf = op;
if (drbd_insert_fault(device, (op == REQ_OP_WRITE) ? DRBD_FAULT_MD_WR : D RBD_FAULT_MD_RD)) { if (drbd_insert_fault(device, (op == REQ_OP_WRITE) ? DRBD_FAULT_MD_WR : D RBD_FAULT_MD_RD)) {
bio->bi_status = BLK_STS_IOERR; bio->bi_status = BLK_STS_IOERR;
--- drbd_actlog.c --- drbd_actlog.c
+++ /tmp/cocci-output-404230-ada95f-drbd_actlog.c
@@ -94,14 +94,15 @@ static int _drbd_md_sync_page_io(struct @@ -94,14 +94,15 @@ static int _drbd_md_sync_page_io(struct
device->md_io.done = 0; device->md_io.done = 0;
device->md_io.error = -ENODEV; device->md_io.error = -ENODEV;
- bio = bio_alloc_bioset(bdev->md_bdev, 1, op | op_flags, - bio = bio_alloc_bioset(bdev->md_bdev, 1, op | op_flags,
- GFP_NOIO, &drbd_md_io_bio_set); - GFP_NOIO, &drbd_md_io_bio_set);
+ bio = bio_alloc_bioset(GFP_NOIO, 1, &drbd_md_io_bio_set); + bio = bio_alloc_bioset(GFP_NOIO, 1, &drbd_md_io_bio_set);
+ bio_set_dev(bio, bdev->md_bdev); + bio_set_dev(bio, bdev->md_bdev);
bio->bi_iter.bi_sector = sector; bio->bi_iter.bi_sector = sector;
err = -EIO; err = -EIO;
 End of changes. 15 change blocks. 
16 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)