Commit b2f0ab62 authored by Andreas Gruenbacher's avatar Andreas Gruenbacher Committed by Philipp Reisner
Browse files

drbd: Temporarily change the return type of all worker callbacks



This helps to ensure that we don't miss one of them when changing their
return value semantics.

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent a896527c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ struct drbd_atodb_wait {
};


int w_al_write_transaction(struct drbd_work *, int);
static long w_al_write_transaction(struct drbd_work *, int);

static int _drbd_md_sync_page_io(struct drbd_conf *mdev,
				 struct drbd_backing_dev *bdev,
@@ -298,7 +298,7 @@ static unsigned int rs_extent_to_bm_page(unsigned int rs_enr)
		 (BM_EXT_SHIFT - BM_BLOCK_SHIFT));
}

int
static long
w_al_write_transaction(struct drbd_work *w, int unused)
{
	struct update_al_work *aw = container_of(w, struct update_al_work, w);
@@ -698,7 +698,7 @@ void drbd_al_shrink(struct drbd_conf *mdev)
	wake_up(&mdev->al_wait);
}

static int w_update_odbm(struct drbd_work *w, int unused)
static long w_update_odbm(struct drbd_work *w, int unused)
{
	struct update_odbm_work *udw = container_of(w, struct update_odbm_work, w);
	struct drbd_conf *mdev = w->mdev;
+19 −18
Original line number Diff line number Diff line
@@ -644,7 +644,7 @@ static inline enum drbd_thread_state get_t_state(struct drbd_thread *thi)
}

struct drbd_work;
typedef int (*drbd_work_cb)(struct drbd_work *, int cancel);
typedef long (*drbd_work_cb)(struct drbd_work *, int cancel);
struct drbd_work {
	struct list_head list;
	drbd_work_cb cb;
@@ -1546,23 +1546,24 @@ extern void drbd_csum_bio(struct drbd_conf *, struct crypto_hash *, struct bio *
extern void drbd_csum_ee(struct drbd_conf *, struct crypto_hash *,
			 struct drbd_peer_request *, void *);
/* worker callbacks */
extern int w_read_retry_remote(struct drbd_work *, int);
extern int w_e_end_data_req(struct drbd_work *, int);
extern int w_e_end_rsdata_req(struct drbd_work *, int);
extern int w_e_end_csum_rs_req(struct drbd_work *, int);
extern int w_e_end_ov_reply(struct drbd_work *, int);
extern int w_e_end_ov_req(struct drbd_work *, int);
extern int w_ov_finished(struct drbd_work *, int);
extern int w_resync_timer(struct drbd_work *, int);
extern int w_send_write_hint(struct drbd_work *, int);
extern int w_send_dblock(struct drbd_work *, int);
extern int w_send_barrier(struct drbd_work *, int);
extern int w_send_read_req(struct drbd_work *, int);
extern int w_prev_work_done(struct drbd_work *, int);
extern int w_e_reissue(struct drbd_work *, int);
extern int w_restart_disk_io(struct drbd_work *, int);
extern int w_send_oos(struct drbd_work *, int);
extern int w_start_resync(struct drbd_work *, int);
extern long w_read_retry_remote(struct drbd_work *, int);
extern long w_e_end_data_req(struct drbd_work *, int);
extern long w_e_end_rsdata_req(struct drbd_work *, int);
extern long w_e_end_csum_rs_req(struct drbd_work *, int);
extern long w_e_end_ov_reply(struct drbd_work *, int);
extern long w_e_end_ov_req(struct drbd_work *, int);
extern long w_ov_finished(struct drbd_work *, int);
extern long w_resync_timer(struct drbd_work *, int);
extern long w_send_write_hint(struct drbd_work *, int);
extern long w_make_resync_request(struct drbd_work *, int);
extern long w_send_dblock(struct drbd_work *, int);
extern long w_send_barrier(struct drbd_work *, int);
extern long w_send_read_req(struct drbd_work *, int);
extern long w_prev_work_done(struct drbd_work *, int);
extern long w_e_reissue(struct drbd_work *, int);
extern long w_restart_disk_io(struct drbd_work *, int);
extern long w_send_oos(struct drbd_work *, int);
extern long w_start_resync(struct drbd_work *, int);

extern void resync_timer_fn(unsigned long data);
extern void start_resync_timer_fn(unsigned long data);
+6 −7
Original line number Diff line number Diff line
@@ -64,10 +64,10 @@ int drbd_asender(struct drbd_thread *);
int drbd_init(void);
static int drbd_open(struct block_device *bdev, fmode_t mode);
static int drbd_release(struct gendisk *gd, fmode_t mode);
static int w_md_sync(struct drbd_work *w, int unused);
static long w_md_sync(struct drbd_work *w, int unused);
static void md_sync_timer_fn(unsigned long data);
static int w_bitmap_io(struct drbd_work *w, int unused);
static int w_go_diskless(struct drbd_work *w, int unused);
static long w_bitmap_io(struct drbd_work *w, int unused);
static long w_go_diskless(struct drbd_work *w, int unused);

MODULE_AUTHOR("Philipp Reisner <phil@linbit.com>, "
	      "Lars Ellenberg <lars@linbit.com>");
@@ -1828,7 +1828,6 @@ void drbd_init_set_defaults(struct drbd_conf *mdev)
	atomic_set(&mdev->rs_pending_cnt, 0);
	atomic_set(&mdev->unacked_cnt, 0);
	atomic_set(&mdev->local_cnt, 0);
	atomic_set(&mdev->pp_in_use, 0);
	atomic_set(&mdev->pp_in_use_by_net, 0);
	atomic_set(&mdev->rs_sect_in, 0);
	atomic_set(&mdev->rs_sect_ev, 0);
@@ -2885,7 +2884,7 @@ int drbd_bmio_clear_n_write(struct drbd_conf *mdev)
	return rv;
}

static int w_bitmap_io(struct drbd_work *w, int unused)
static long w_bitmap_io(struct drbd_work *w, int unused)
{
	struct bm_io_work *work = container_of(w, struct bm_io_work, w);
	struct drbd_conf *mdev = w->mdev;
@@ -2926,7 +2925,7 @@ void drbd_ldev_destroy(struct drbd_conf *mdev)
	clear_bit(GO_DISKLESS, &mdev->flags);
}

static int w_go_diskless(struct drbd_work *w, int unused)
static long w_go_diskless(struct drbd_work *w, int unused)
{
	struct drbd_conf *mdev = w->mdev;

@@ -3042,7 +3041,7 @@ static void md_sync_timer_fn(unsigned long data)
	drbd_queue_work_front(&mdev->tconn->data.work, &mdev->md_sync_work);
}

static int w_md_sync(struct drbd_work *w, int unused)
static long w_md_sync(struct drbd_work *w, int unused)
{
	struct drbd_conf *mdev = w->mdev;

+6 −6
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ static int drbd_do_auth(struct drbd_tconn *tconn);
static int drbd_disconnected(int vnr, void *p, void *data);

static enum finish_epoch drbd_may_finish_epoch(struct drbd_conf *, struct drbd_epoch *, enum epoch_event);
static int e_end_block(struct drbd_work *, int);
static long e_end_block(struct drbd_work *, int);


#define GFP_TRY	(__GFP_HIGHMEM | __GFP_NOWARN)
@@ -1461,7 +1461,7 @@ static int recv_dless_read(struct drbd_conf *mdev, struct drbd_request *req,

/* e_end_resync_block() is called via
 * drbd_process_done_ee() by asender only */
static int e_end_resync_block(struct drbd_work *w, int unused)
static long e_end_resync_block(struct drbd_work *w, int unused)
{
	struct drbd_peer_request *peer_req =
		container_of(w, struct drbd_peer_request, w);
@@ -1597,7 +1597,7 @@ static int receive_RSDataReply(struct drbd_conf *mdev, enum drbd_packet cmd,
	return ok;
}

static int w_restart_write(struct drbd_work *w, int cancel)
static long w_restart_write(struct drbd_work *w, int cancel)
{
	struct drbd_request *req = container_of(w, struct drbd_request, w);
	struct drbd_conf *mdev = w->mdev;
@@ -1645,7 +1645,7 @@ static void restart_conflicting_writes(struct drbd_conf *mdev,
/* e_end_block() is called via drbd_process_done_ee().
 * this means this function only runs in the asender thread
 */
static int e_end_block(struct drbd_work *w, int cancel)
static long e_end_block(struct drbd_work *w, int cancel)
{
	struct drbd_peer_request *peer_req =
		container_of(w, struct drbd_peer_request, w);
@@ -1699,12 +1699,12 @@ static int e_send_ack(struct drbd_work *w, enum drbd_packet ack)
	return ok;
}

static int e_send_discard_write(struct drbd_work *w, int unused)
static long e_send_discard_write(struct drbd_work *w, int unused)
{
	return e_send_ack(w, P_DISCARD_WRITE);
}

static int e_send_retry_write(struct drbd_work *w, int unused)
static long e_send_retry_write(struct drbd_work *w, int unused)
{
	struct drbd_tconn *tconn = w->mdev->tconn;

+3 −3
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ struct after_state_chg_work {
	struct completion *done;
};

static int w_after_state_ch(struct drbd_work *w, int unused);
static long w_after_state_ch(struct drbd_work *w, int unused);
static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
			   union drbd_state ns, enum chg_state_flags flags);
static void after_all_state_ch(struct drbd_tconn *tconn);
@@ -918,7 +918,7 @@ __drbd_set_state(struct drbd_conf *mdev, union drbd_state ns,
	return rv;
}

static int w_after_state_ch(struct drbd_work *w, int unused)
static long w_after_state_ch(struct drbd_work *w, int unused)
{
	struct after_state_chg_work *ascw =
		container_of(w, struct after_state_chg_work, w);
@@ -1289,7 +1289,7 @@ static void after_all_state_ch(struct drbd_tconn *tconn)
	}
}

static int w_after_conn_state_ch(struct drbd_work *w, int unused)
static long w_after_conn_state_ch(struct drbd_work *w, int unused)
{
	struct after_conn_state_chg_work *acscw =
		container_of(w, struct after_conn_state_chg_work, w);
Loading