aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2010-11-17 16:25:03 -0500
committerPhilipp Reisner <philipp.reisner@linbit.com>2011-03-10 05:34:32 -0500
commit688593c5a82068aea64df0b836793dfbbaa646d7 (patch)
tree013ddc67a52c794d5e3b595bd982cb71cf9029f5
parent4896e8c1b8fb7e46a65a6676e271fc047a260a3e (diff)
drbd: Renamed write_flags_to_bio() to wire_flags_to_bio()
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
-rw-r--r--drivers/block/drbd/drbd_receiver.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index 79e7b57006b..f3052d871d3 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -1612,15 +1612,15 @@ static int drbd_wait_peer_seq(struct drbd_conf *mdev, const u32 packet_seq)
1612 return ret; 1612 return ret;
1613} 1613}
1614 1614
1615static unsigned long write_flags_to_bio(struct drbd_conf *mdev, u32 dpf) 1615/* see also bio_flags_to_wire()
1616 * DRBD_REQ_*, because we need to semantically map the flags to data packet
1617 * flags and back. We may replicate to other kernel versions. */
1618static unsigned long wire_flags_to_bio(struct drbd_conf *mdev, u32 dpf)
1616{ 1619{
1617 if (mdev->agreed_pro_version >= 95) 1620 return (dpf & DP_RW_SYNC ? REQ_SYNC : 0) |
1618 return (dpf & DP_RW_SYNC ? REQ_SYNC : 0) | 1621 (dpf & DP_FUA ? REQ_FUA : 0) |
1619 (dpf & DP_FUA ? REQ_FUA : 0) | 1622 (dpf & DP_FLUSH ? REQ_FLUSH : 0) |
1620 (dpf & DP_FLUSH ? REQ_FUA : 0) | 1623 (dpf & DP_DISCARD ? REQ_DISCARD : 0);
1621 (dpf & DP_DISCARD ? REQ_DISCARD : 0);
1622 else
1623 return dpf & DP_RW_SYNC ? REQ_SYNC : 0;
1624} 1624}
1625 1625
1626/* mirrored write */ 1626/* mirrored write */
@@ -1660,18 +1660,18 @@ static int receive_Data(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned
1660 1660
1661 e->w.cb = e_end_block; 1661 e->w.cb = e_end_block;
1662 1662
1663 dp_flags = be32_to_cpu(p->dp_flags);
1664 rw |= wire_flags_to_bio(mdev, dp_flags);
1665
1666 if (dp_flags & DP_MAY_SET_IN_SYNC)
1667 e->flags |= EE_MAY_SET_IN_SYNC;
1668
1663 spin_lock(&mdev->epoch_lock); 1669 spin_lock(&mdev->epoch_lock);
1664 e->epoch = mdev->current_epoch; 1670 e->epoch = mdev->current_epoch;
1665 atomic_inc(&e->epoch->epoch_size); 1671 atomic_inc(&e->epoch->epoch_size);
1666 atomic_inc(&e->epoch->active); 1672 atomic_inc(&e->epoch->active);
1667 spin_unlock(&mdev->epoch_lock); 1673 spin_unlock(&mdev->epoch_lock);
1668 1674
1669 dp_flags = be32_to_cpu(p->dp_flags);
1670 rw |= write_flags_to_bio(mdev, dp_flags);
1671
1672 if (dp_flags & DP_MAY_SET_IN_SYNC)
1673 e->flags |= EE_MAY_SET_IN_SYNC;
1674
1675 /* I'm the receiver, I do hold a net_cnt reference. */ 1675 /* I'm the receiver, I do hold a net_cnt reference. */
1676 if (!mdev->net_conf->two_primaries) { 1676 if (!mdev->net_conf->two_primaries) {
1677 spin_lock_irq(&mdev->req_lock); 1677 spin_lock_irq(&mdev->req_lock);