Commit 376694a0 authored by Philipp Reisner's avatar Philipp Reisner

drbd: Silenced compiler warnings

Since version 4.6.1 gcc warns about variables that get
a value assigned, but which are never read later on.
Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 9bcd2521
...@@ -264,8 +264,7 @@ void drbd_al_begin_io(struct drbd_conf *mdev, struct drbd_interval *i) ...@@ -264,8 +264,7 @@ void drbd_al_begin_io(struct drbd_conf *mdev, struct drbd_interval *i)
/* Double check: it may have been committed by someone else, /* Double check: it may have been committed by someone else,
* while we have been waiting for the lock. */ * while we have been waiting for the lock. */
if (mdev->act_log->pending_changes) { if (mdev->act_log->pending_changes) {
int err; al_write_transaction(mdev);
err = al_write_transaction(mdev);
mdev->al_writ_cnt++; mdev->al_writ_cnt++;
spin_lock_irq(&mdev->al_lock); spin_lock_irq(&mdev->al_lock);
...@@ -290,7 +289,6 @@ void drbd_al_complete_io(struct drbd_conf *mdev, struct drbd_interval *i) ...@@ -290,7 +289,6 @@ void drbd_al_complete_io(struct drbd_conf *mdev, struct drbd_interval *i)
unsigned enr; unsigned enr;
struct lc_element *extent; struct lc_element *extent;
unsigned long flags; unsigned long flags;
bool wake = false;
spin_lock_irqsave(&mdev->al_lock, flags); spin_lock_irqsave(&mdev->al_lock, flags);
...@@ -300,8 +298,7 @@ void drbd_al_complete_io(struct drbd_conf *mdev, struct drbd_interval *i) ...@@ -300,8 +298,7 @@ void drbd_al_complete_io(struct drbd_conf *mdev, struct drbd_interval *i)
dev_err(DEV, "al_complete_io() called on inactive extent %u\n", enr); dev_err(DEV, "al_complete_io() called on inactive extent %u\n", enr);
continue; continue;
} }
if (lc_put(mdev->act_log, extent) == 0) lc_put(mdev->act_log, extent);
wake = true;
} }
spin_unlock_irqrestore(&mdev->al_lock, flags); spin_unlock_irqrestore(&mdev->al_lock, flags);
wake_up(&mdev->al_wait); wake_up(&mdev->al_wait);
...@@ -730,7 +727,7 @@ void __drbd_set_in_sync(struct drbd_conf *mdev, sector_t sector, int size, ...@@ -730,7 +727,7 @@ void __drbd_set_in_sync(struct drbd_conf *mdev, sector_t sector, int size,
int __drbd_set_out_of_sync(struct drbd_conf *mdev, sector_t sector, int size, int __drbd_set_out_of_sync(struct drbd_conf *mdev, sector_t sector, int size,
const char *file, const unsigned int line) const char *file, const unsigned int line)
{ {
unsigned long sbnr, ebnr, lbnr, flags; unsigned long sbnr, ebnr, flags;
sector_t esector, nr_sectors; sector_t esector, nr_sectors;
unsigned int enr, count = 0; unsigned int enr, count = 0;
struct lc_element *e; struct lc_element *e;
...@@ -752,8 +749,6 @@ int __drbd_set_out_of_sync(struct drbd_conf *mdev, sector_t sector, int size, ...@@ -752,8 +749,6 @@ int __drbd_set_out_of_sync(struct drbd_conf *mdev, sector_t sector, int size,
if (!expect(esector < nr_sectors)) if (!expect(esector < nr_sectors))
esector = nr_sectors - 1; esector = nr_sectors - 1;
lbnr = BM_SECT_TO_BIT(nr_sectors-1);
/* we set it out of sync, /* we set it out of sync,
* we do not need to round anything here */ * we do not need to round anything here */
sbnr = BM_SECT_TO_BIT(sector); sbnr = BM_SECT_TO_BIT(sector);
......
...@@ -4324,7 +4324,7 @@ static void conn_disconnect(struct drbd_tconn *tconn) ...@@ -4324,7 +4324,7 @@ static void conn_disconnect(struct drbd_tconn *tconn)
{ {
struct drbd_conf *mdev; struct drbd_conf *mdev;
enum drbd_conns oc; enum drbd_conns oc;
int vnr, rv = SS_UNKNOWN_ERROR; int vnr;
if (tconn->cstate == C_STANDALONE) if (tconn->cstate == C_STANDALONE)
return; return;
...@@ -4351,7 +4351,7 @@ static void conn_disconnect(struct drbd_tconn *tconn) ...@@ -4351,7 +4351,7 @@ static void conn_disconnect(struct drbd_tconn *tconn)
spin_lock_irq(&tconn->req_lock); spin_lock_irq(&tconn->req_lock);
oc = tconn->cstate; oc = tconn->cstate;
if (oc >= C_UNCONNECTED) if (oc >= C_UNCONNECTED)
rv = _conn_request_state(tconn, NS(conn, C_UNCONNECTED), CS_VERBOSE); _conn_request_state(tconn, NS(conn, C_UNCONNECTED), CS_VERBOSE);
spin_unlock_irq(&tconn->req_lock); spin_unlock_irq(&tconn->req_lock);
...@@ -4361,7 +4361,6 @@ static void conn_disconnect(struct drbd_tconn *tconn) ...@@ -4361,7 +4361,6 @@ static void conn_disconnect(struct drbd_tconn *tconn)
static int drbd_disconnected(struct drbd_conf *mdev) static int drbd_disconnected(struct drbd_conf *mdev)
{ {
enum drbd_fencing_p fp;
unsigned int i; unsigned int i;
/* wait for current activity to cease. */ /* wait for current activity to cease. */
...@@ -4405,14 +4404,6 @@ static int drbd_disconnected(struct drbd_conf *mdev) ...@@ -4405,14 +4404,6 @@ static int drbd_disconnected(struct drbd_conf *mdev)
drbd_md_sync(mdev); drbd_md_sync(mdev);
fp = FP_DONT_CARE;
if (get_ldev(mdev)) {
rcu_read_lock();
fp = rcu_dereference(mdev->ldev->disk_conf)->fencing;
rcu_read_unlock();
put_ldev(mdev);
}
/* serialize with bitmap writeout triggered by the state change, /* serialize with bitmap writeout triggered by the state change,
* if any. */ * if any. */
wait_event(mdev->misc_wait, !test_bit(BITMAP_IO, &mdev->flags)); wait_event(mdev->misc_wait, !test_bit(BITMAP_IO, &mdev->flags));
......
...@@ -39,6 +39,8 @@ static void _drbd_start_io_acct(struct drbd_conf *mdev, struct drbd_request *req ...@@ -39,6 +39,8 @@ static void _drbd_start_io_acct(struct drbd_conf *mdev, struct drbd_request *req
cpu = part_stat_lock(); cpu = part_stat_lock();
part_stat_inc(cpu, &mdev->vdisk->part0, ios[rw]); part_stat_inc(cpu, &mdev->vdisk->part0, ios[rw]);
part_stat_add(cpu, &mdev->vdisk->part0, sectors[rw], bio_sectors(bio)); part_stat_add(cpu, &mdev->vdisk->part0, sectors[rw], bio_sectors(bio));
(void) cpu; /* The macro invocations above want the cpu argument, I do not like
the compiler warning about cpu only assigned but never used... */
part_inc_in_flight(&mdev->vdisk->part0, rw); part_inc_in_flight(&mdev->vdisk->part0, rw);
part_stat_unlock(); part_stat_unlock();
} }
......
...@@ -1143,7 +1143,6 @@ int drbd_bitmap_io_from_worker(struct drbd_conf *mdev, ...@@ -1143,7 +1143,6 @@ int drbd_bitmap_io_from_worker(struct drbd_conf *mdev,
static void after_state_ch(struct drbd_conf *mdev, union drbd_state os, static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
union drbd_state ns, enum chg_state_flags flags) union drbd_state ns, enum chg_state_flags flags)
{ {
enum drbd_fencing_p fp;
struct sib_info sib; struct sib_info sib;
sib.sib_reason = SIB_STATE_CHANGE; sib.sib_reason = SIB_STATE_CHANGE;
...@@ -1156,14 +1155,6 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os, ...@@ -1156,14 +1155,6 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
mdev->p_uuid[UI_FLAGS] &= ~((u64)2); mdev->p_uuid[UI_FLAGS] &= ~((u64)2);
} }
fp = FP_DONT_CARE;
if (get_ldev(mdev)) {
rcu_read_lock();
fp = rcu_dereference(mdev->ldev->disk_conf)->fencing;
rcu_read_unlock();
put_ldev(mdev);
}
/* Inform userspace about the change... */ /* Inform userspace about the change... */
drbd_bcast_event(mdev, &sib); drbd_bcast_event(mdev, &sib);
......
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