Commit 81e84650 authored by Andreas Gruenbacher's avatar Andreas Gruenbacher Committed by Philipp Reisner

drbd: Use the standard bool, true, and false keywords

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 6184ea21
...@@ -338,7 +338,7 @@ w_al_write_transaction(struct drbd_conf *mdev, struct drbd_work *w, int unused) ...@@ -338,7 +338,7 @@ w_al_write_transaction(struct drbd_conf *mdev, struct drbd_work *w, int unused)
+ mdev->ldev->md.al_offset + mdev->al_tr_pos; + mdev->ldev->md.al_offset + mdev->al_tr_pos;
if (!drbd_md_sync_page_io(mdev, mdev->ldev, sector, WRITE)) if (!drbd_md_sync_page_io(mdev, mdev->ldev, sector, WRITE))
drbd_chk_io_error(mdev, 1, TRUE); drbd_chk_io_error(mdev, 1, true);
if (++mdev->al_tr_pos > if (++mdev->al_tr_pos >
div_ceil(mdev->act_log->nr_elements, AL_EXTENTS_PT)) div_ceil(mdev->act_log->nr_elements, AL_EXTENTS_PT))
...@@ -528,7 +528,7 @@ static void atodb_endio(struct bio *bio, int error) ...@@ -528,7 +528,7 @@ static void atodb_endio(struct bio *bio, int error)
if (!error && !uptodate) if (!error && !uptodate)
error = -EIO; error = -EIO;
drbd_chk_io_error(mdev, error, TRUE); drbd_chk_io_error(mdev, error, true);
if (error && wc->error == 0) if (error && wc->error == 0)
wc->error = error; wc->error = error;
...@@ -991,7 +991,7 @@ void __drbd_set_in_sync(struct drbd_conf *mdev, sector_t sector, int size, ...@@ -991,7 +991,7 @@ void __drbd_set_in_sync(struct drbd_conf *mdev, sector_t sector, int size,
if (count && get_ldev(mdev)) { if (count && get_ldev(mdev)) {
drbd_advance_rs_marks(mdev, drbd_bm_total_weight(mdev)); drbd_advance_rs_marks(mdev, drbd_bm_total_weight(mdev));
spin_lock_irqsave(&mdev->al_lock, flags); spin_lock_irqsave(&mdev->al_lock, flags);
drbd_try_clear_on_disk_bm(mdev, sector, count, TRUE); drbd_try_clear_on_disk_bm(mdev, sector, count, true);
spin_unlock_irqrestore(&mdev->al_lock, flags); spin_unlock_irqrestore(&mdev->al_lock, flags);
/* just wake_up unconditional now, various lc_chaged(), /* just wake_up unconditional now, various lc_chaged(),
...@@ -1441,7 +1441,7 @@ void drbd_rs_failed_io(struct drbd_conf *mdev, sector_t sector, int size) ...@@ -1441,7 +1441,7 @@ void drbd_rs_failed_io(struct drbd_conf *mdev, sector_t sector, int size)
mdev->rs_failed += count; mdev->rs_failed += count;
if (get_ldev(mdev)) { if (get_ldev(mdev)) {
drbd_try_clear_on_disk_bm(mdev, sector, count, FALSE); drbd_try_clear_on_disk_bm(mdev, sector, count, false);
put_ldev(mdev); put_ldev(mdev);
} }
......
...@@ -844,7 +844,7 @@ static int bm_rw(struct drbd_conf *mdev, int rw) __must_hold(local) ...@@ -844,7 +844,7 @@ static int bm_rw(struct drbd_conf *mdev, int rw) __must_hold(local)
if (test_bit(BM_MD_IO_ERROR, &b->bm_flags)) { if (test_bit(BM_MD_IO_ERROR, &b->bm_flags)) {
dev_alert(DEV, "we had at least one MD IO ERROR during bitmap IO\n"); dev_alert(DEV, "we had at least one MD IO ERROR during bitmap IO\n");
drbd_chk_io_error(mdev, 1, TRUE); drbd_chk_io_error(mdev, 1, true);
err = -EIO; err = -EIO;
} }
...@@ -916,7 +916,7 @@ int drbd_bm_write_sect(struct drbd_conf *mdev, unsigned long enr) __must_hold(lo ...@@ -916,7 +916,7 @@ int drbd_bm_write_sect(struct drbd_conf *mdev, unsigned long enr) __must_hold(lo
dev_err(DEV, "IO ERROR writing bitmap sector %lu " dev_err(DEV, "IO ERROR writing bitmap sector %lu "
"(meta-disk sector %llus)\n", "(meta-disk sector %llus)\n",
enr, (unsigned long long)on_disk_sector); enr, (unsigned long long)on_disk_sector);
drbd_chk_io_error(mdev, 1, TRUE); drbd_chk_io_error(mdev, 1, true);
for (i = 0; i < AL_EXT_PER_BM_SECT; i++) for (i = 0; i < AL_EXT_PER_BM_SECT; i++)
drbd_bm_ALe_set_all(mdev, enr*AL_EXT_PER_BM_SECT+i); drbd_bm_ALe_set_all(mdev, enr*AL_EXT_PER_BM_SECT+i);
} }
......
...@@ -72,13 +72,6 @@ extern int fault_devs; ...@@ -72,13 +72,6 @@ extern int fault_devs;
extern char usermode_helper[]; extern char usermode_helper[];
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
/* I don't remember why XCPU ... /* I don't remember why XCPU ...
* This is used to wake the asender, * This is used to wake the asender,
* and to interrupt sending the sending task * and to interrupt sending the sending task
...@@ -2002,17 +1995,17 @@ static inline int drbd_send_ping_ack(struct drbd_conf *mdev) ...@@ -2002,17 +1995,17 @@ static inline int drbd_send_ping_ack(struct drbd_conf *mdev)
static inline void drbd_thread_stop(struct drbd_thread *thi) static inline void drbd_thread_stop(struct drbd_thread *thi)
{ {
_drbd_thread_stop(thi, FALSE, TRUE); _drbd_thread_stop(thi, false, true);
} }
static inline void drbd_thread_stop_nowait(struct drbd_thread *thi) static inline void drbd_thread_stop_nowait(struct drbd_thread *thi)
{ {
_drbd_thread_stop(thi, FALSE, FALSE); _drbd_thread_stop(thi, false, false);
} }
static inline void drbd_thread_restart_nowait(struct drbd_thread *thi) static inline void drbd_thread_restart_nowait(struct drbd_thread *thi)
{ {
_drbd_thread_stop(thi, TRUE, FALSE); _drbd_thread_stop(thi, true, false);
} }
/* counts how many answer packets packets we expect from our peer, /* counts how many answer packets packets we expect from our peer,
......
...@@ -456,7 +456,7 @@ void tl_restart(struct drbd_conf *mdev, enum drbd_req_event what) ...@@ -456,7 +456,7 @@ void tl_restart(struct drbd_conf *mdev, enum drbd_req_event what)
} }
/** /**
* cl_wide_st_chg() - TRUE if the state change is a cluster wide one * cl_wide_st_chg() - true if the state change is a cluster wide one
* @mdev: DRBD device. * @mdev: DRBD device.
* @os: old (current) state. * @os: old (current) state.
* @ns: new (wanted) state. * @ns: new (wanted) state.
...@@ -1623,7 +1623,7 @@ int drbd_thread_start(struct drbd_thread *thi) ...@@ -1623,7 +1623,7 @@ int drbd_thread_start(struct drbd_thread *thi)
if (!try_module_get(THIS_MODULE)) { if (!try_module_get(THIS_MODULE)) {
dev_err(DEV, "Failed to get module reference in drbd_thread_start\n"); dev_err(DEV, "Failed to get module reference in drbd_thread_start\n");
spin_unlock_irqrestore(&thi->t_lock, flags); spin_unlock_irqrestore(&thi->t_lock, flags);
return FALSE; return false;
} }
init_completion(&thi->stop); init_completion(&thi->stop);
...@@ -1640,7 +1640,7 @@ int drbd_thread_start(struct drbd_thread *thi) ...@@ -1640,7 +1640,7 @@ int drbd_thread_start(struct drbd_thread *thi)
dev_err(DEV, "Couldn't start thread\n"); dev_err(DEV, "Couldn't start thread\n");
module_put(THIS_MODULE); module_put(THIS_MODULE);
return FALSE; return false;
} }
spin_lock_irqsave(&thi->t_lock, flags); spin_lock_irqsave(&thi->t_lock, flags);
thi->task = nt; thi->task = nt;
...@@ -1660,7 +1660,7 @@ int drbd_thread_start(struct drbd_thread *thi) ...@@ -1660,7 +1660,7 @@ int drbd_thread_start(struct drbd_thread *thi)
break; break;
} }
return TRUE; return true;
} }
...@@ -1758,8 +1758,8 @@ int _drbd_send_cmd(struct drbd_conf *mdev, struct socket *sock, ...@@ -1758,8 +1758,8 @@ int _drbd_send_cmd(struct drbd_conf *mdev, struct socket *sock,
{ {
int sent, ok; int sent, ok;
ERR_IF(!h) return FALSE; ERR_IF(!h) return false;
ERR_IF(!size) return FALSE; ERR_IF(!size) return false;
h->magic = BE_DRBD_MAGIC; h->magic = BE_DRBD_MAGIC;
h->command = cpu_to_be16(cmd); h->command = cpu_to_be16(cmd);
...@@ -2196,14 +2196,14 @@ int _drbd_send_bitmap(struct drbd_conf *mdev) ...@@ -2196,14 +2196,14 @@ int _drbd_send_bitmap(struct drbd_conf *mdev)
struct p_header80 *p; struct p_header80 *p;
int ret; int ret;
ERR_IF(!mdev->bitmap) return FALSE; ERR_IF(!mdev->bitmap) return false;
/* maybe we should use some per thread scratch page, /* maybe we should use some per thread scratch page,
* and allocate that during initial device creation? */ * and allocate that during initial device creation? */
p = (struct p_header80 *) __get_free_page(GFP_NOIO); p = (struct p_header80 *) __get_free_page(GFP_NOIO);
if (!p) { if (!p) {
dev_err(DEV, "failed to allocate one page buffer in %s\n", __func__); dev_err(DEV, "failed to allocate one page buffer in %s\n", __func__);
return FALSE; return false;
} }
if (get_ldev(mdev)) { if (get_ldev(mdev)) {
...@@ -2256,7 +2256,7 @@ int drbd_send_b_ack(struct drbd_conf *mdev, u32 barrier_nr, u32 set_size) ...@@ -2256,7 +2256,7 @@ int drbd_send_b_ack(struct drbd_conf *mdev, u32 barrier_nr, u32 set_size)
p.set_size = cpu_to_be32(set_size); p.set_size = cpu_to_be32(set_size);
if (mdev->state.conn < C_CONNECTED) if (mdev->state.conn < C_CONNECTED)
return FALSE; return false;
ok = drbd_send_cmd(mdev, USE_META_SOCKET, P_BARRIER_ACK, ok = drbd_send_cmd(mdev, USE_META_SOCKET, P_BARRIER_ACK,
(struct p_header80 *)&p, sizeof(p)); (struct p_header80 *)&p, sizeof(p));
return ok; return ok;
...@@ -2284,7 +2284,7 @@ static int _drbd_send_ack(struct drbd_conf *mdev, enum drbd_packets cmd, ...@@ -2284,7 +2284,7 @@ static int _drbd_send_ack(struct drbd_conf *mdev, enum drbd_packets cmd,
p.seq_num = cpu_to_be32(atomic_add_return(1, &mdev->packet_seq)); p.seq_num = cpu_to_be32(atomic_add_return(1, &mdev->packet_seq));
if (!mdev->meta.socket || mdev->state.conn < C_CONNECTED) if (!mdev->meta.socket || mdev->state.conn < C_CONNECTED)
return FALSE; return false;
ok = drbd_send_cmd(mdev, USE_META_SOCKET, cmd, ok = drbd_send_cmd(mdev, USE_META_SOCKET, cmd,
(struct p_header80 *)&p, sizeof(p)); (struct p_header80 *)&p, sizeof(p));
return ok; return ok;
...@@ -2390,8 +2390,8 @@ int drbd_send_ov_request(struct drbd_conf *mdev, sector_t sector, int size) ...@@ -2390,8 +2390,8 @@ int drbd_send_ov_request(struct drbd_conf *mdev, sector_t sector, int size)
} }
/* called on sndtimeo /* called on sndtimeo
* returns FALSE if we should retry, * returns false if we should retry,
* TRUE if we think connection is dead * true if we think connection is dead
*/ */
static int we_should_drop_the_connection(struct drbd_conf *mdev, struct socket *sock) static int we_should_drop_the_connection(struct drbd_conf *mdev, struct socket *sock)
{ {
...@@ -2404,7 +2404,7 @@ static int we_should_drop_the_connection(struct drbd_conf *mdev, struct socket * ...@@ -2404,7 +2404,7 @@ static int we_should_drop_the_connection(struct drbd_conf *mdev, struct socket *
|| mdev->state.conn < C_CONNECTED; || mdev->state.conn < C_CONNECTED;
if (drop_it) if (drop_it)
return TRUE; return true;
drop_it = !--mdev->ko_count; drop_it = !--mdev->ko_count;
if (!drop_it) { if (!drop_it) {
...@@ -3283,7 +3283,7 @@ struct drbd_conf *drbd_new_device(unsigned int minor) ...@@ -3283,7 +3283,7 @@ struct drbd_conf *drbd_new_device(unsigned int minor)
goto out_no_disk; goto out_no_disk;
mdev->vdisk = disk; mdev->vdisk = disk;
set_disk_ro(disk, TRUE); set_disk_ro(disk, true);
disk->queue = q; disk->queue = q;
disk->major = DRBD_MAJOR; disk->major = DRBD_MAJOR;
...@@ -3560,7 +3560,7 @@ void drbd_md_sync(struct drbd_conf *mdev) ...@@ -3560,7 +3560,7 @@ void drbd_md_sync(struct drbd_conf *mdev)
if (!drbd_md_sync_page_io(mdev, mdev->ldev, sector, WRITE)) { if (!drbd_md_sync_page_io(mdev, mdev->ldev, sector, WRITE)) {
/* this was a try anyways ... */ /* this was a try anyways ... */
dev_err(DEV, "meta data update failed!\n"); dev_err(DEV, "meta data update failed!\n");
drbd_chk_io_error(mdev, 1, TRUE); drbd_chk_io_error(mdev, 1, true);
} }
/* Update mdev->ldev->md.la_size_sect, /* Update mdev->ldev->md.la_size_sect,
......
...@@ -385,7 +385,7 @@ drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role, int force) ...@@ -385,7 +385,7 @@ drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role, int force)
wait_event(mdev->misc_wait, atomic_read(&mdev->ap_pending_cnt) == 0); wait_event(mdev->misc_wait, atomic_read(&mdev->ap_pending_cnt) == 0);
if (new_role == R_SECONDARY) { if (new_role == R_SECONDARY) {
set_disk_ro(mdev->vdisk, TRUE); set_disk_ro(mdev->vdisk, true);
if (get_ldev(mdev)) { if (get_ldev(mdev)) {
mdev->ldev->md.uuid[UI_CURRENT] &= ~(u64)1; mdev->ldev->md.uuid[UI_CURRENT] &= ~(u64)1;
put_ldev(mdev); put_ldev(mdev);
...@@ -395,7 +395,7 @@ drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role, int force) ...@@ -395,7 +395,7 @@ drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role, int force)
mdev->net_conf->want_lose = 0; mdev->net_conf->want_lose = 0;
put_net_conf(mdev); put_net_conf(mdev);
} }
set_disk_ro(mdev->vdisk, FALSE); set_disk_ro(mdev->vdisk, false);
if (get_ldev(mdev)) { if (get_ldev(mdev)) {
if (((mdev->state.conn < C_CONNECTED || if (((mdev->state.conn < C_CONNECTED ||
mdev->state.pdsk <= D_FAILED) mdev->state.pdsk <= D_FAILED)
......
...@@ -725,16 +725,16 @@ static int drbd_socket_okay(struct drbd_conf *mdev, struct socket **sock) ...@@ -725,16 +725,16 @@ static int drbd_socket_okay(struct drbd_conf *mdev, struct socket **sock)
char tb[4]; char tb[4];
if (!*sock) if (!*sock)
return FALSE; return false;
rr = drbd_recv_short(mdev, *sock, tb, 4, MSG_DONTWAIT | MSG_PEEK); rr = drbd_recv_short(mdev, *sock, tb, 4, MSG_DONTWAIT | MSG_PEEK);
if (rr > 0 || rr == -EAGAIN) { if (rr > 0 || rr == -EAGAIN) {
return TRUE; return true;
} else { } else {
sock_release(*sock); sock_release(*sock);
*sock = NULL; *sock = NULL;
return FALSE; return false;
} }
} }
...@@ -933,7 +933,7 @@ static int drbd_recv_header(struct drbd_conf *mdev, enum drbd_packets *cmd, unsi ...@@ -933,7 +933,7 @@ static int drbd_recv_header(struct drbd_conf *mdev, enum drbd_packets *cmd, unsi
r = drbd_recv(mdev, h, sizeof(*h)); r = drbd_recv(mdev, h, sizeof(*h));
if (unlikely(r != sizeof(*h))) { if (unlikely(r != sizeof(*h))) {
dev_err(DEV, "short read expecting header on sock: r=%d\n", r); dev_err(DEV, "short read expecting header on sock: r=%d\n", r);
return FALSE; return false;
} }
if (likely(h->h80.magic == BE_DRBD_MAGIC)) { if (likely(h->h80.magic == BE_DRBD_MAGIC)) {
...@@ -947,11 +947,11 @@ static int drbd_recv_header(struct drbd_conf *mdev, enum drbd_packets *cmd, unsi ...@@ -947,11 +947,11 @@ static int drbd_recv_header(struct drbd_conf *mdev, enum drbd_packets *cmd, unsi
be32_to_cpu(h->h80.magic), be32_to_cpu(h->h80.magic),
be16_to_cpu(h->h80.command), be16_to_cpu(h->h80.command),
be16_to_cpu(h->h80.length)); be16_to_cpu(h->h80.length));
return FALSE; return false;
} }
mdev->last_received = jiffies; mdev->last_received = jiffies;
return TRUE; return true;
} }
static void drbd_flush(struct drbd_conf *mdev) static void drbd_flush(struct drbd_conf *mdev)
...@@ -1160,7 +1160,7 @@ static int receive_Barrier(struct drbd_conf *mdev, enum drbd_packets cmd, unsign ...@@ -1160,7 +1160,7 @@ static int receive_Barrier(struct drbd_conf *mdev, enum drbd_packets cmd, unsign
switch (mdev->write_ordering) { switch (mdev->write_ordering) {
case WO_none: case WO_none:
if (rv == FE_RECYCLED) if (rv == FE_RECYCLED)
return TRUE; return true;
/* receiver context, in the writeout path of the other node. /* receiver context, in the writeout path of the other node.
* avoid potential distributed deadlock */ * avoid potential distributed deadlock */
...@@ -1188,10 +1188,10 @@ static int receive_Barrier(struct drbd_conf *mdev, enum drbd_packets cmd, unsign ...@@ -1188,10 +1188,10 @@ static int receive_Barrier(struct drbd_conf *mdev, enum drbd_packets cmd, unsign
D_ASSERT(atomic_read(&epoch->active) == 0); D_ASSERT(atomic_read(&epoch->active) == 0);
D_ASSERT(epoch->flags == 0); D_ASSERT(epoch->flags == 0);
return TRUE; return true;
default: default:
dev_err(DEV, "Strangeness in mdev->write_ordering %d\n", mdev->write_ordering); dev_err(DEV, "Strangeness in mdev->write_ordering %d\n", mdev->write_ordering);
return FALSE; return false;
} }
epoch->flags = 0; epoch->flags = 0;
...@@ -1209,7 +1209,7 @@ static int receive_Barrier(struct drbd_conf *mdev, enum drbd_packets cmd, unsign ...@@ -1209,7 +1209,7 @@ static int receive_Barrier(struct drbd_conf *mdev, enum drbd_packets cmd, unsign
} }
spin_unlock(&mdev->epoch_lock); spin_unlock(&mdev->epoch_lock);
return TRUE; return true;
} }
/* used from receive_RSDataReply (recv_resync_read) /* used from receive_RSDataReply (recv_resync_read)
...@@ -1303,7 +1303,7 @@ static int drbd_drain_block(struct drbd_conf *mdev, int data_size) ...@@ -1303,7 +1303,7 @@ static int drbd_drain_block(struct drbd_conf *mdev, int data_size)
void *data; void *data;
if (!data_size) if (!data_size)
return TRUE; return true;
page = drbd_pp_alloc(mdev, 1, 1); page = drbd_pp_alloc(mdev, 1, 1);
...@@ -1426,7 +1426,7 @@ static int recv_resync_read(struct drbd_conf *mdev, sector_t sector, int data_si ...@@ -1426,7 +1426,7 @@ static int recv_resync_read(struct drbd_conf *mdev, sector_t sector, int data_si
atomic_add(data_size >> 9, &mdev->rs_sect_ev); atomic_add(data_size >> 9, &mdev->rs_sect_ev);
if (drbd_submit_ee(mdev, e, WRITE, DRBD_FAULT_RS_WR) == 0) if (drbd_submit_ee(mdev, e, WRITE, DRBD_FAULT_RS_WR) == 0)
return TRUE; return true;
/* drbd_submit_ee currently fails for one reason only: /* drbd_submit_ee currently fails for one reason only:
* not being able to allocate enough bios. * not being able to allocate enough bios.
...@@ -1438,7 +1438,7 @@ static int recv_resync_read(struct drbd_conf *mdev, sector_t sector, int data_si ...@@ -1438,7 +1438,7 @@ static int recv_resync_read(struct drbd_conf *mdev, sector_t sector, int data_si
drbd_free_ee(mdev, e); drbd_free_ee(mdev, e);
fail: fail:
put_ldev(mdev); put_ldev(mdev);
return FALSE; return false;
} }
static int receive_DataReply(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned int data_size) static int receive_DataReply(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned int data_size)
...@@ -1455,7 +1455,7 @@ static int receive_DataReply(struct drbd_conf *mdev, enum drbd_packets cmd, unsi ...@@ -1455,7 +1455,7 @@ static int receive_DataReply(struct drbd_conf *mdev, enum drbd_packets cmd, unsi
spin_unlock_irq(&mdev->req_lock); spin_unlock_irq(&mdev->req_lock);
if (unlikely(!req)) { if (unlikely(!req)) {
dev_err(DEV, "Got a corrupt block_id/sector pair(1).\n"); dev_err(DEV, "Got a corrupt block_id/sector pair(1).\n");
return FALSE; return false;
} }
/* hlist_del(&req->colision) is done in _req_may_be_done, to avoid /* hlist_del(&req->colision) is done in _req_may_be_done, to avoid
...@@ -1655,7 +1655,7 @@ static int receive_Data(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned ...@@ -1655,7 +1655,7 @@ static int receive_Data(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned
e = read_in_block(mdev, p->block_id, sector, data_size); e = read_in_block(mdev, p->block_id, sector, data_size);
if (!e) { if (!e) {
put_ldev(mdev); put_ldev(mdev);
return FALSE; return false;
} }
e->w.cb = e_end_block; e->w.cb = e_end_block;
...@@ -1774,7 +1774,7 @@ static int receive_Data(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned ...@@ -1774,7 +1774,7 @@ static int receive_Data(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned
put_ldev(mdev); put_ldev(mdev);
wake_asender(mdev); wake_asender(mdev);
finish_wait(&mdev->misc_wait, &wait); finish_wait(&mdev->misc_wait, &wait);
return TRUE; return true;
} }
if (signal_pending(current)) { if (signal_pending(current)) {
...@@ -1830,7 +1830,7 @@ static int receive_Data(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned ...@@ -1830,7 +1830,7 @@ static int receive_Data(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned
} }
if (drbd_submit_ee(mdev, e, rw, DRBD_FAULT_DT_WR) == 0) if (drbd_submit_ee(mdev, e, rw, DRBD_FAULT_DT_WR) == 0)
return TRUE; return true;
/* drbd_submit_ee currently fails for one reason only: /* drbd_submit_ee currently fails for one reason only:
* not being able to allocate enough bios. * not being able to allocate enough bios.
...@@ -1848,7 +1848,7 @@ static int receive_Data(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned ...@@ -1848,7 +1848,7 @@ static int receive_Data(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned
* receive a barrier... atomic_inc(&mdev->epoch_size); */ * receive a barrier... atomic_inc(&mdev->epoch_size); */
put_ldev(mdev); put_ldev(mdev);
drbd_free_ee(mdev, e); drbd_free_ee(mdev, e);
return FALSE; return false;
} }
/* We may throttle resync, if the lower device seems to be busy, /* We may throttle resync, if the lower device seems to be busy,
...@@ -1934,12 +1934,12 @@ static int receive_DataRequest(struct drbd_conf *mdev, enum drbd_packets cmd, un ...@@ -1934,12 +1934,12 @@ static int receive_DataRequest(struct drbd_conf *mdev, enum drbd_packets cmd, un
if (size <= 0 || (size & 0x1ff) != 0 || size > DRBD_MAX_BIO_SIZE) { if (size <= 0 || (size & 0x1ff) != 0 || size > DRBD_MAX_BIO_SIZE) {
dev_err(DEV, "%s:%d: sector: %llus, size: %u\n", __FILE__, __LINE__, dev_err(DEV, "%s:%d: sector: %llus, size: %u\n", __FILE__, __LINE__,
(unsigned long long)sector, size); (unsigned long long)sector, size);
return FALSE; return false;
} }
if (sector + (size>>9) > capacity) { if (sector + (size>>9) > capacity) {
dev_err(DEV, "%s:%d: sector: %llus, size: %u\n", __FILE__, __LINE__, dev_err(DEV, "%s:%d: sector: %llus, size: %u\n", __FILE__, __LINE__,
(unsigned long long)sector, size); (unsigned long long)sector, size);
return FALSE; return false;
} }
if (!get_ldev_if_state(mdev, D_UP_TO_DATE)) { if (!get_ldev_if_state(mdev, D_UP_TO_DATE)) {
...@@ -1976,7 +1976,7 @@ static int receive_DataRequest(struct drbd_conf *mdev, enum drbd_packets cmd, un ...@@ -1976,7 +1976,7 @@ static int receive_DataRequest(struct drbd_conf *mdev, enum drbd_packets cmd, un
e = drbd_alloc_ee(mdev, p->block_id, sector, size, GFP_NOIO); e = drbd_alloc_ee(mdev, p->block_id, sector, size, GFP_NOIO);
if (!e) { if (!e) {
put_ldev(mdev); put_ldev(mdev);
return FALSE; return false;
} }
switch (cmd) { switch (cmd) {
...@@ -2089,7 +2089,7 @@ static int receive_DataRequest(struct drbd_conf *mdev, enum drbd_packets cmd, un ...@@ -2089,7 +2089,7 @@ static int receive_DataRequest(struct drbd_conf *mdev, enum drbd_packets cmd, un
spin_unlock_irq(&mdev->req_lock); spin_unlock_irq(&mdev->req_lock);
if (drbd_submit_ee(mdev, e, READ, fault_type) == 0) if (drbd_submit_ee(mdev, e, READ, fault_type) == 0)
return TRUE; return true;
/* drbd_submit_ee currently fails for one reason only: /* drbd_submit_ee currently fails for one reason only:
* not being able to allocate enough bios. * not being able to allocate enough bios.
...@@ -2102,7 +2102,7 @@ static int receive_DataRequest(struct drbd_conf *mdev, enum drbd_packets cmd, un ...@@ -2102,7 +2102,7 @@ static int receive_DataRequest(struct drbd_conf *mdev, enum drbd_packets cmd, un
out_free_e: out_free_e:
put_ldev(mdev); put_ldev(mdev);
drbd_free_ee(mdev, e); drbd_free_ee(mdev, e);
return FALSE; return false;
} }
static int drbd_asb_recover_0p(struct drbd_conf *mdev) __must_hold(local) static int drbd_asb_recover_0p(struct drbd_conf *mdev) __must_hold(local)
...@@ -2690,7 +2690,7 @@ static int receive_protocol(struct drbd_conf *mdev, enum drbd_packets cmd, unsig ...@@ -2690,7 +2690,7 @@ static int receive_protocol(struct drbd_conf *mdev, enum drbd_packets cmd, unsig
unsigned char *my_alg = mdev->net_conf->integrity_alg; unsigned char *my_alg = mdev->net_conf->integrity_alg;
if (drbd_recv(mdev, p_integrity_alg, data_size) != data_size) if (drbd_recv(mdev, p_integrity_alg, data_size) != data_size)
return FALSE; return false;
p_integrity_alg[SHARED_SECRET_MAX-1] = 0; p_integrity_alg[SHARED_SECRET_MAX-1] = 0;
if (strcmp(p_integrity_alg, my_alg)) { if (strcmp(p_integrity_alg, my_alg)) {
...@@ -2701,11 +2701,11 @@ static int receive_protocol(struct drbd_conf *mdev, enum drbd_packets cmd, unsig ...@@ -2701,11 +2701,11 @@ static int receive_protocol(struct drbd_conf *mdev, enum drbd_packets cmd, unsig
my_alg[0] ? my_alg : (unsigned char *)"<not-used>"); my_alg[0] ? my_alg : (unsigned char *)"<not-used>");
} }
return TRUE; return true;
disconnect: disconnect:
drbd_force_state(mdev, NS(conn, C_DISCONNECTING)); drbd_force_state(mdev, NS(conn, C_DISCONNECTING));
return FALSE; return false;
} }
/* helper function /* helper function
...@@ -2737,7 +2737,7 @@ struct crypto_hash *drbd_crypto_alloc_digest_safe(const struct drbd_conf *mdev, ...@@ -2737,7 +2737,7 @@ struct crypto_hash *drbd_crypto_alloc_digest_safe(const struct drbd_conf *mdev,
static int receive_SyncParam(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned int packet_size) static int receive_SyncParam(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned int packet_size)
{ {
int ok = TRUE; int ok = true;
struct p_rs_param_95 *p = &mdev->data.rbuf.rs_param_95; struct p_rs_param_95 *p = &mdev->data.rbuf.rs_param_95;
unsigned int header_size, data_size, exp_max_sz; unsigned int header_size, data_size, exp_max_sz;
struct crypto_hash *verify_tfm = NULL; struct crypto_hash *verify_tfm = NULL;
...@@ -2755,7 +2755,7 @@ static int receive_SyncParam(struct drbd_conf *mdev, enum drbd_packets cmd, unsi ...@@ -2755,7 +2755,7 @@ static int receive_SyncParam(struct drbd_conf *mdev, enum drbd_packets cmd, unsi
if (packet_size > exp_max_sz) { if (packet_size > exp_max_sz) {
dev_err(DEV, "SyncParam packet too long: received %u, expected <= %u bytes\n", dev_err(DEV, "SyncParam packet too long: received %u, expected <= %u bytes\n",
packet_size, exp_max_sz); packet_size, exp_max_sz);
return FALSE; return false;
} }
if (apv <= 88) { if (apv <= 88) {
...@@ -2775,7 +2775,7 @@ static int receive_SyncParam(struct drbd_conf *mdev, enum drbd_packets cmd, unsi ...@@ -2775,7 +2775,7 @@ static int receive_SyncParam(struct drbd_conf *mdev, enum drbd_packets cmd, unsi
memset(p->verify_alg, 0, 2 * SHARED_SECRET_MAX); memset(p->verify_alg, 0, 2 * SHARED_SECRET_MAX);
if (drbd_recv(mdev, &p->head.payload, header_size) != header_size) if (drbd_recv(mdev, &p->head.payload, header_size) != header_size)
return FALSE; return false;
mdev->sync_conf.rate = be32_to_cpu(p->rate); mdev->sync_conf.rate = be32_to_cpu(p->rate);
...@@ -2785,11 +2785,11 @@ static int receive_SyncParam(struct drbd_conf *mdev, enum drbd_packets cmd, unsi ...@@ -2785,11 +2785,11 @@ static int receive_SyncParam(struct drbd_conf *mdev, enum drbd_packets cmd, unsi
dev_err(DEV, "verify-alg too long, " dev_err(DEV, "verify-alg too long, "
"peer wants %u, accepting only %u byte\n", "peer wants %u, accepting only %u byte\n",
data_size, SHARED_SECRET_MAX); data_size, SHARED_SECRET_MAX);
return FALSE; return false;
} }
if (drbd_recv(mdev, p->verify_alg, data_size) != data_size) if (drbd_recv(mdev, p->verify_alg, data_size) != data_size)
return FALSE; return false;
/* we expect NUL terminated string */ /* we expect NUL terminated string */
/* but just in case someone tries to be evil */ /* but just in case someone tries to be evil */
...@@ -2883,7 +2883,7 @@ static int receive_SyncParam(struct drbd_conf *mdev, enum drbd_packets cmd, unsi ...@@ -2883,7 +2883,7 @@ static int receive_SyncParam(struct drbd_conf *mdev, enum drbd_packets cmd, unsi
/* but free the verify_tfm again, if csums_tfm did not work out */ /* but free the verify_tfm again, if csums_tfm did not work out */
crypto_free_hash(verify_tfm); crypto_free_hash(verify_tfm);
drbd_force_state(mdev, NS(conn, C_DISCONNECTING)); drbd_force_state(mdev, NS(conn, C_DISCONNECTING));
return FALSE; return false;
} }
static void drbd_setup_order_type(struct drbd_conf *mdev, int peer) static void drbd_setup_order_type(struct drbd_conf *mdev, int peer)
...@@ -2920,7 +2920,7 @@ static int receive_sizes(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned ...@@ -2920,7 +2920,7 @@ static int receive_sizes(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned
if (p_size == 0 && mdev->state.disk == D_DISKLESS) { if (p_size == 0 && mdev->state.disk == D_DISKLESS) {
dev_err(DEV, "some backing storage is needed\n"); dev_err(DEV, "some backing storage is needed\n");
drbd_force_state(mdev, NS(conn, C_DISCONNECTING)); drbd_force_state(mdev, NS(conn, C_DISCONNECTING));
return FALSE; return false;
} }
/* just store the peer's disk size for now. /* just store the peer's disk size for now.
...@@ -2957,7 +2957,7 @@ static int receive_sizes(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned ...@@ -2957,7 +2957,7 @@ static int receive_sizes(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned
drbd_force_state(mdev, NS(conn, C_DISCONNECTING)); drbd_force_state(mdev, NS(conn, C_DISCONNECTING));
mdev->ldev->dc.disk_size = my_usize; mdev->ldev->dc.disk_size = my_usize;
put_ldev(mdev); put_ldev(mdev);
return FALSE; return false;
} }
put_ldev(mdev); put_ldev(mdev);
} }
...@@ -2967,7 +2967,7 @@ static int receive_sizes(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned ...@@ -2967,7 +2967,7 @@ static int receive_sizes(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned
dd = drbd_determin_dev_size(mdev, ddsf); dd = drbd_determin_dev_size(mdev, ddsf);
put_ldev(mdev); put_ldev(mdev);
if (dd == dev_size_error) if (dd == dev_size_error)
return FALSE; return false;
drbd_md_sync(mdev); drbd_md_sync(mdev);
} else { } else {
/* I am diskless, need to accept the peer's size. */ /* I am diskless, need to accept the peer's size. */
...@@ -3014,7 +3014,7 @@ static int receive_sizes(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned ...@@ -3014,7 +3014,7 @@ static int receive_sizes(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned
} }
} }
return TRUE; return true;
} }
static int receive_uuids(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned int data_size) static int receive_uuids(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned int data_size)
...@@ -3038,7 +3038,7 @@ static int receive_uuids(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned ...@@ -3038,7 +3038,7 @@ static int receive_uuids(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned
dev_err(DEV, "Can only connect to data with current UUID=%016llX\n", dev_err(DEV, "Can only connect to data with current UUID=%016llX\n",
(unsigned long long)mdev->ed_uuid); (unsigned long long)mdev->ed_uuid);
drbd_force_state(mdev, NS(conn, C_DISCONNECTING)); drbd_force_state(mdev, NS(conn, C_DISCONNECTING));
return FALSE; return false;
} }
if (get_ldev(mdev)) { if (get_ldev(mdev)) {
...@@ -3073,7 +3073,7 @@ static int receive_uuids(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned ...@@ -3073,7 +3073,7 @@ static int receive_uuids(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned
if (mdev->state.conn >= C_CONNECTED && mdev->state.disk < D_INCONSISTENT) if (mdev->state.conn >= C_CONNECTED && mdev->state.disk < D_INCONSISTENT)
drbd_set_ed_uuid(mdev, p_uuid[UI_CURRENT]); drbd_set_ed_uuid(mdev, p_uuid[UI_CURRENT]);
return TRUE; return true;
} }
/** /**
...@@ -3118,7 +3118,7 @@ static int receive_req_state(struct drbd_conf *mdev, enum drbd_packets cmd, unsi ...@@ -3118,7 +3118,7 @@ static int receive_req_state(struct drbd_conf *mdev, enum drbd_packets cmd, unsi
if (test_bit(DISCARD_CONCURRENT, &mdev->flags) && if (test_bit(DISCARD_CONCURRENT, &mdev->flags) &&
test_bit(CLUSTER_ST_CHANGE, &mdev->flags)) { test_bit(CLUSTER_ST_CHANGE, &mdev->flags)) {
drbd_send_sr_reply(mdev, SS_CONCURRENT_ST_CHG); drbd_send_sr_reply(mdev, SS_CONCURRENT_ST_CHG);
return TRUE; return true;
} }
mask = convert_state(mask); mask = convert_state(mask);
...@@ -3129,7 +3129,7 @@ static int receive_req_state(struct drbd_conf *mdev, enum drbd_packets cmd, unsi ...@@ -3129,7 +3129,7 @@ static int receive_req_state(struct drbd_conf *mdev, enum drbd_packets cmd, unsi
drbd_send_sr_reply(mdev, rv); drbd_send_sr_reply(mdev, rv);
drbd_md_sync(mdev); drbd_md_sync(mdev);
return TRUE; return true;
} }
static int receive_state(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned int data_size) static int receive_state(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned int data_size)
...@@ -3174,7 +3174,7 @@ static int receive_state(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned ...@@ -3174,7 +3174,7 @@ static int receive_state(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned
peer_state.conn == C_CONNECTED) { peer_state.conn == C_CONNECTED) {
if (drbd_bm_total_weight(mdev) <= mdev->rs_failed) if (drbd_bm_total_weight(mdev) <= mdev->rs_failed)
drbd_resync_finished(mdev); drbd_resync_finished(mdev);
return TRUE; return true;
} }
} }
...@@ -3227,10 +3227,10 @@ static int receive_state(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned ...@@ -3227,10 +3227,10 @@ static int receive_state(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned
real_peer_disk = D_DISKLESS; real_peer_disk = D_DISKLESS;
} else { } else {
if (test_and_clear_bit(CONN_DRY_RUN, &mdev->flags)) if (test_and_clear_bit(CONN_DRY_RUN, &mdev->flags))
return FALSE; return false;
D_ASSERT(os.conn == C_WF_REPORT_PARAMS); D_ASSERT(os.conn == C_WF_REPORT_PARAMS);
drbd_force_state(mdev, NS(conn, C_DISCONNECTING)); drbd_force_state(mdev, NS(conn, C_DISCONNECTING));
return FALSE; return false;
} }
} }
} }
...@@ -3255,7 +3255,7 @@ static int receive_state(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned ...@@ -3255,7 +3255,7 @@ static int receive_state(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned
drbd_uuid_new_current(mdev); drbd_uuid_new_current(mdev);
clear_bit(NEW_CUR_UUID, &mdev->flags); clear_bit(NEW_CUR_UUID, &mdev->flags);
drbd_force_state(mdev, NS2(conn, C_PROTOCOL_ERROR, susp, 0)); drbd_force_state(mdev, NS2(conn, C_PROTOCOL_ERROR, susp, 0));
return FALSE; return false;
} }
rv = _drbd_set_state(mdev, ns, cs_flags, NULL); rv = _drbd_set_state(mdev, ns, cs_flags, NULL);
ns = mdev->state; ns = mdev->state;
...@@ -3263,7 +3263,7 @@ static int receive_state(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned ...@@ -3263,7 +3263,7 @@ static int receive_state(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned
if (rv < SS_SUCCESS) { if (rv < SS_SUCCESS) {
drbd_force_state(mdev, NS(conn, C_DISCONNECTING)); drbd_force_state(mdev, NS(conn, C_DISCONNECTING));
return FALSE; return false;
} }
if (os.conn > C_WF_REPORT_PARAMS) { if (os.conn > C_WF_REPORT_PARAMS) {
...@@ -3281,7 +3281,7 @@ static int receive_state(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned ...@@ -3281,7 +3281,7 @@ static int receive_state(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned
drbd_md_sync(mdev); /* update connected indicator, la_size, ... */ drbd_md_sync(mdev); /* update connected indicator, la_size, ... */
return TRUE; return true;
} }
static int receive_sync_uuid(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned int data_size) static int receive_sync_uuid(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned int data_size)
...@@ -3308,7 +3308,7 @@ static int receive_sync_uuid(struct drbd_conf *mdev, enum drbd_packets cmd, unsi ...@@ -3308,7 +3308,7 @@ static int receive_sync_uuid(struct drbd_conf *mdev, enum drbd_packets cmd, unsi
} else } else
dev_err(DEV, "Ignoring SyncUUID packet!\n"); dev_err(DEV, "Ignoring SyncUUID packet!\n");
return TRUE; return true;
} }
enum receive_bitmap_ret { OK, DONE, FAILED }; enum receive_bitmap_ret { OK, DONE, FAILED };
...@@ -3462,7 +3462,7 @@ static int receive_bitmap(struct drbd_conf *mdev, enum drbd_packets cmd, unsigne ...@@ -3462,7 +3462,7 @@ static int receive_bitmap(struct drbd_conf *mdev, enum drbd_packets cmd, unsigne
struct bm_xfer_ctx c; struct bm_xfer_ctx c;
void *buffer; void *buffer;
enum receive_bitmap_ret ret; enum receive_bitmap_ret ret;
int ok = FALSE; int ok = false;
struct p_header80 *h = &mdev->data.rbuf.header.h80; struct p_header80 *h = &mdev->data.rbuf.header.h80;
/* drbd_bm_lock(mdev, "receive bitmap"); By intention no bm_lock */ /* drbd_bm_lock(mdev, "receive bitmap"); By intention no bm_lock */
...@@ -3535,7 +3535,7 @@ static int receive_bitmap(struct drbd_conf *mdev, enum drbd_packets cmd, unsigne ...@@ -3535,7 +3535,7 @@ static int receive_bitmap(struct drbd_conf *mdev, enum drbd_packets cmd, unsigne
drbd_conn_str(mdev->state.conn)); drbd_conn_str(mdev->state.conn));
} }
ok = TRUE; ok = true;
out: out:
/* drbd_bm_unlock(mdev); by intention no lock */ /* drbd_bm_unlock(mdev); by intention no lock */
if (ok && mdev->state.conn == C_WF_BITMAP_S) if (ok && mdev->state.conn == C_WF_BITMAP_S)
...@@ -3569,7 +3569,7 @@ static int receive_UnplugRemote(struct drbd_conf *mdev, enum drbd_packets cmd, u ...@@ -3569,7 +3569,7 @@ static int receive_UnplugRemote(struct drbd_conf *mdev, enum drbd_packets cmd, u
* with the data requests being unplugged */ * with the data requests being unplugged */
drbd_tcp_quickack(mdev->data.socket); drbd_tcp_quickack(mdev->data.socket);
return TRUE; return true;
} }
static int receive_out_of_sync(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned int data_size) static int receive_out_of_sync(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned int data_size)
...@@ -3578,7 +3578,7 @@ static int receive_out_of_sync(struct drbd_conf *mdev, enum drbd_packets cmd, un ...@@ -3578,7 +3578,7 @@ static int receive_out_of_sync(struct drbd_conf *mdev, enum drbd_packets cmd, un
drbd_set_out_of_sync(mdev, be64_to_cpu(p->sector), be32_to_cpu(p->blksize)); drbd_set_out_of_sync(mdev, be64_to_cpu(p->sector), be32_to_cpu(p->blksize));
return TRUE; return true;
} }
typedef int (*drbd_cmd_handler_f)(struct drbd_conf *, enum drbd_packets cmd, unsigned int to_receive); typedef int (*drbd_cmd_handler_f)(struct drbd_conf *, enum drbd_packets cmd, unsigned int to_receive);
...@@ -4147,7 +4147,7 @@ static int got_RqSReply(struct drbd_conf *mdev, struct p_header80 *h) ...@@ -4147,7 +4147,7 @@ static int got_RqSReply(struct drbd_conf *mdev, struct p_header80 *h)
} }
wake_up(&mdev->state_wait); wake_up(&mdev->state_wait);
return TRUE; return true;
} }
static int got_Ping(struct drbd_conf *mdev, struct p_header80 *h) static int got_Ping(struct drbd_conf *mdev, struct p_header80 *h)
...@@ -4163,7 +4163,7 @@ static int got_PingAck(struct drbd_conf *mdev, struct p_header80 *h) ...@@ -4163,7 +4163,7 @@ static int got_PingAck(struct drbd_conf *mdev, struct p_header80 *h)
if (!test_and_set_bit(GOT_PING_ACK, &mdev->flags)) if (!test_and_set_bit(GOT_PING_ACK, &mdev->flags))
wake_up(&mdev->misc_wait); wake_up(&mdev->misc_wait);
return TRUE; return true;
} }
static int got_IsInSync(struct drbd_conf *mdev, struct p_header80 *h) static int got_IsInSync(struct drbd_conf *mdev, struct p_header80 *h)
...@@ -4186,7 +4186,7 @@ static int got_IsInSync(struct drbd_conf *mdev, struct p_header80 *h) ...@@ -4186,7 +4186,7 @@ static int got_IsInSync(struct drbd_conf *mdev, struct p_header80 *h)
dec_rs_pending(mdev); dec_rs_pending(mdev);
atomic_add(blksize >> 9, &mdev->rs_sect_in); atomic_add(blksize >> 9, &mdev->rs_sect_in);
return TRUE; return true;
} }
/* when we receive the ACK for a write request, /* when we receive the ACK for a write request,
...@@ -4230,14 +4230,14 @@ static int validate_req_change_req_state(struct drbd_conf *mdev, ...@@ -4230,14 +4230,14 @@ static int validate_req_change_req_state(struct drbd_conf *mdev,
if (unlikely(!req)) { if (unlikely(!req)) {
spin_unlock_irq(&mdev->req_lock); spin_unlock_irq(&mdev->req_lock);
dev_err(DEV, "%s: got a corrupt block_id/sector pair\n", func); dev_err(DEV, "%s: got a corrupt block_id/sector pair\n", func);
return FALSE; return false;
} }
__req_mod(req, what, &m); __req_mod(req, what, &m);
spin_unlock_irq(&mdev->req_lock); spin_unlock_irq(&mdev->req_lock);
if (m.bio) if (m.bio)
complete_master_bio(mdev, &m); complete_master_bio(mdev, &m);
return TRUE; return true;
} }
static int got_BlockAck(struct drbd_conf *mdev, struct p_header80 *h) static int got_BlockAck(struct drbd_conf *mdev, struct p_header80 *h)
...@@ -4252,7 +4252,7 @@ static int got_BlockAck(struct drbd_conf *mdev, struct p_header80 *h) ...@@ -4252,7 +4252,7 @@ static int got_BlockAck(struct drbd_conf *mdev, struct p_header80 *h)
if (is_syncer_block_id(p->block_id)) { if (is_syncer_block_id(p->block_id)) {
drbd_set_in_sync(mdev, sector, blksize); drbd_set_in_sync(mdev, sector, blksize);
dec_rs_pending(mdev); dec_rs_pending(mdev);
return TRUE; return true;
} }
switch (be16_to_cpu(h->command)) { switch (be16_to_cpu(h->command)) {
case P_RS_WRITE_ACK: case P_RS_WRITE_ACK:
...@@ -4273,7 +4273,7 @@ static int got_BlockAck(struct drbd_conf *mdev, struct p_header80 *h) ...@@ -4273,7 +4273,7 @@ static int got_BlockAck(struct drbd_conf *mdev, struct p_header80 *h)
break; break;
default: default:
D_ASSERT(0); D_ASSERT(0);
return FALSE; return false;
} }
return validate_req_change_req_state(mdev, p->block_id, sector, return validate_req_change_req_state(mdev, p->block_id, sector,
...@@ -4294,7 +4294,7 @@ static int got_NegAck(struct drbd_conf *mdev, struct p_header80 *h) ...@@ -4294,7 +4294,7 @@ static int got_NegAck(struct drbd_conf *mdev, struct p_header80 *h)
int size = be32_to_cpu(p->blksize); int size = be32_to_cpu(p->blksize);
dec_rs_pending(mdev); dec_rs_pending(mdev);
drbd_rs_failed_io(mdev, sector, size); drbd_rs_failed_io(mdev, sector, size);
return TRUE; return true;
} }
return validate_req_change_req_state(mdev, p->block_id, sector, return validate_req_change_req_state(mdev, p->block_id, sector,
_ack_id_to_req, __func__ , neg_acked); _ack_id_to_req, __func__ , neg_acked);
...@@ -4332,7 +4332,7 @@ static int got_NegRSDReply(struct drbd_conf *mdev, struct p_header80 *h) ...@@ -4332,7 +4332,7 @@ static int got_NegRSDReply(struct drbd_conf *mdev, struct p_header80 *h)
put_ldev(mdev); put_ldev(mdev);
} }
return TRUE; return true;
} }
static int got_BarrierAck(struct drbd_conf *mdev, struct p_header80 *h) static int got_BarrierAck(struct drbd_conf *mdev, struct p_header80 *h)
...@@ -4349,7 +4349,7 @@ static int got_BarrierAck(struct drbd_conf *mdev, struct p_header80 *h) ...@@ -4349,7 +4349,7 @@ static int got_BarrierAck(struct drbd_conf *mdev, struct p_header80 *h)
drbd_queue_work_front(&mdev->data.work, w); drbd_queue_work_front(&mdev->data.work, w);
} }
return TRUE; return true;
} }
static int got_OVResult(struct drbd_conf *mdev, struct p_header80 *h) static int got_OVResult(struct drbd_conf *mdev, struct p_header80 *h)
...@@ -4370,7 +4370,7 @@ static int got_OVResult(struct drbd_conf *mdev, struct p_header80 *h) ...@@ -4370,7 +4370,7 @@ static int got_OVResult(struct drbd_conf *mdev, struct p_header80 *h)
ov_oos_print(mdev); ov_oos_print(mdev);
if (!get_ldev(mdev)) if (!get_ldev(mdev))
return TRUE; return true;
drbd_rs_complete_io(mdev, sector); drbd_rs_complete_io(mdev, sector);
dec_rs_pending(mdev); dec_rs_pending(mdev);
...@@ -4393,12 +4393,12 @@ static int got_OVResult(struct drbd_conf *mdev, struct p_header80 *h) ...@@ -4393,12 +4393,12 @@ static int got_OVResult(struct drbd_conf *mdev, struct p_header80 *h)
} }
} }
put_ldev(mdev); put_ldev(mdev);
return TRUE; return true;
} }
static int got_skip(struct drbd_conf *mdev, struct p_header80 *h) static int got_skip(struct drbd_conf *mdev, struct p_header80 *h)
{ {
return TRUE; return true;
} }
struct asender_cmd { struct asender_cmd {
......
...@@ -445,7 +445,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what, ...@@ -445,7 +445,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
req->rq_state |= RQ_LOCAL_COMPLETED; req->rq_state |= RQ_LOCAL_COMPLETED;
req->rq_state &= ~RQ_LOCAL_PENDING; req->rq_state &= ~RQ_LOCAL_PENDING;
__drbd_chk_io_error(mdev, FALSE); __drbd_chk_io_error(mdev, false);
_req_may_be_done_not_susp(req, m); _req_may_be_done_not_susp(req, m);
put_ldev(mdev); put_ldev(mdev);
break; break;
...@@ -466,7 +466,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what, ...@@ -466,7 +466,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
D_ASSERT(!(req->rq_state & RQ_NET_MASK)); D_ASSERT(!(req->rq_state & RQ_NET_MASK));
__drbd_chk_io_error(mdev, FALSE); __drbd_chk_io_error(mdev, false);
put_ldev(mdev); put_ldev(mdev);
/* no point in retrying if there is no good remote data, /* no point in retrying if there is no good remote data,
......
...@@ -96,7 +96,7 @@ void drbd_endio_read_sec_final(struct drbd_epoch_entry *e) __releases(local) ...@@ -96,7 +96,7 @@ void drbd_endio_read_sec_final(struct drbd_epoch_entry *e) __releases(local)
if (list_empty(&mdev->read_ee)) if (list_empty(&mdev->read_ee))
wake_up(&mdev->ee_wait); wake_up(&mdev->ee_wait);
if (test_bit(__EE_WAS_ERROR, &e->flags)) if (test_bit(__EE_WAS_ERROR, &e->flags))
__drbd_chk_io_error(mdev, FALSE); __drbd_chk_io_error(mdev, false);
spin_unlock_irqrestore(&mdev->req_lock, flags); spin_unlock_irqrestore(&mdev->req_lock, flags);
drbd_queue_work(&mdev->data.work, &e->w); drbd_queue_work(&mdev->data.work, &e->w);
...@@ -139,7 +139,7 @@ static void drbd_endio_write_sec_final(struct drbd_epoch_entry *e) __releases(lo ...@@ -139,7 +139,7 @@ static void drbd_endio_write_sec_final(struct drbd_epoch_entry *e) __releases(lo
: list_empty(&mdev->active_ee); : list_empty(&mdev->active_ee);
if (test_bit(__EE_WAS_ERROR, &e->flags)) if (test_bit(__EE_WAS_ERROR, &e->flags))
__drbd_chk_io_error(mdev, FALSE); __drbd_chk_io_error(mdev, false);
spin_unlock_irqrestore(&mdev->req_lock, flags); spin_unlock_irqrestore(&mdev->req_lock, flags);
if (is_syncer_req) if (is_syncer_req)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment