aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_int.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-25 12:15:35 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-25 12:15:35 -0400
commit929cfdd5d3bdc772aff32e5a3fb4e3894394aa75 (patch)
treef67202d079eaf1f8d65b2e1bfac70b768ae34bc4 /drivers/block/drbd/drbd_int.h
parent798ce8f1cca29dcc3f4b55947f611f4ffb32ac2b (diff)
parenta1c15c59feee36267c43142a41152fbf7402afb6 (diff)
Merge branch 'for-2.6.40/drivers' of git://git.kernel.dk/linux-2.6-block
* 'for-2.6.40/drivers' of git://git.kernel.dk/linux-2.6-block: (110 commits) loop: handle on-demand devices correctly loop: limit 'max_part' module param to DISK_MAX_PARTS drbd: fix warning drbd: fix warning drbd: Fix spelling drbd: fix schedule in atomic drbd: Take a more conservative approach when deciding max_bio_size drbd: Fixed state transitions after async outdate-peer-handler returned drbd: Disallow the peer_disk_state to be D_OUTDATED while connected drbd: Fix for the connection problems on high latency links drbd: fix potential activity log refcount imbalance in error path drbd: Only downgrade the disk state in case of disk failures drbd: fix disconnect/reconnect loop, if ping-timeout == ping-int drbd: fix potential distributed deadlock lru_cache.h: fix comments referring to ts_ instead of lc_ drbd: Fix for application IO with the on-io-error=pass-on policy xen/p2m: Add EXPORT_SYMBOL_GPL to the M2P override functions. xen/p2m/m2p/gnttab: Support GNTMAP_host_map in the M2P override. xen/blkback: don't fail empty barrier requests xen/blkback: fix xenbus_transaction_start() hang caused by double xenbus_transaction_end() ...
Diffstat (limited to 'drivers/block/drbd/drbd_int.h')
-rw-r--r--drivers/block/drbd/drbd_int.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index d871b14ed5a1..ef2ceed3be4b 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -700,7 +700,7 @@ struct drbd_request {
700 * see drbd_endio_pri(). */ 700 * see drbd_endio_pri(). */
701 struct bio *private_bio; 701 struct bio *private_bio;
702 702
703 struct hlist_node colision; 703 struct hlist_node collision;
704 sector_t sector; 704 sector_t sector;
705 unsigned int size; 705 unsigned int size;
706 unsigned int epoch; /* barrier_nr */ 706 unsigned int epoch; /* barrier_nr */
@@ -766,7 +766,7 @@ struct digest_info {
766 766
767struct drbd_epoch_entry { 767struct drbd_epoch_entry {
768 struct drbd_work w; 768 struct drbd_work w;
769 struct hlist_node colision; 769 struct hlist_node collision;
770 struct drbd_epoch *epoch; /* for writes */ 770 struct drbd_epoch *epoch; /* for writes */
771 struct drbd_conf *mdev; 771 struct drbd_conf *mdev;
772 struct page *pages; 772 struct page *pages;
@@ -1129,6 +1129,8 @@ struct drbd_conf {
1129 int rs_in_flight; /* resync sectors in flight (to proxy, in proxy and from proxy) */ 1129 int rs_in_flight; /* resync sectors in flight (to proxy, in proxy and from proxy) */
1130 int rs_planed; /* resync sectors already planned */ 1130 int rs_planed; /* resync sectors already planned */
1131 atomic_t ap_in_flight; /* App sectors in flight (waiting for ack) */ 1131 atomic_t ap_in_flight; /* App sectors in flight (waiting for ack) */
1132 int peer_max_bio_size;
1133 int local_max_bio_size;
1132}; 1134};
1133 1135
1134static inline struct drbd_conf *minor_to_mdev(unsigned int minor) 1136static inline struct drbd_conf *minor_to_mdev(unsigned int minor)
@@ -1218,8 +1220,6 @@ extern void drbd_free_resources(struct drbd_conf *mdev);
1218extern void tl_release(struct drbd_conf *mdev, unsigned int barrier_nr, 1220extern void tl_release(struct drbd_conf *mdev, unsigned int barrier_nr,
1219 unsigned int set_size); 1221 unsigned int set_size);
1220extern void tl_clear(struct drbd_conf *mdev); 1222extern void tl_clear(struct drbd_conf *mdev);
1221enum drbd_req_event;
1222extern void tl_restart(struct drbd_conf *mdev, enum drbd_req_event what);
1223extern void _tl_add_barrier(struct drbd_conf *, struct drbd_tl_epoch *); 1223extern void _tl_add_barrier(struct drbd_conf *, struct drbd_tl_epoch *);
1224extern void drbd_free_sock(struct drbd_conf *mdev); 1224extern void drbd_free_sock(struct drbd_conf *mdev);
1225extern int drbd_send(struct drbd_conf *mdev, struct socket *sock, 1225extern int drbd_send(struct drbd_conf *mdev, struct socket *sock,
@@ -1434,6 +1434,7 @@ struct bm_extent {
1434 * hash table. */ 1434 * hash table. */
1435#define HT_SHIFT 8 1435#define HT_SHIFT 8
1436#define DRBD_MAX_BIO_SIZE (1U<<(9+HT_SHIFT)) 1436#define DRBD_MAX_BIO_SIZE (1U<<(9+HT_SHIFT))
1437#define DRBD_MAX_BIO_SIZE_SAFE (1 << 12) /* Works always = 4k */
1437 1438
1438#define DRBD_MAX_SIZE_H80_PACKET (1 << 15) /* The old header only allows packets up to 32Kib data */ 1439#define DRBD_MAX_SIZE_H80_PACKET (1 << 15) /* The old header only allows packets up to 32Kib data */
1439 1440
@@ -1518,9 +1519,9 @@ extern void drbd_resume_io(struct drbd_conf *mdev);
1518extern char *ppsize(char *buf, unsigned long long size); 1519extern char *ppsize(char *buf, unsigned long long size);
1519extern sector_t drbd_new_dev_size(struct drbd_conf *, struct drbd_backing_dev *, int); 1520extern sector_t drbd_new_dev_size(struct drbd_conf *, struct drbd_backing_dev *, int);
1520enum determine_dev_size { dev_size_error = -1, unchanged = 0, shrunk = 1, grew = 2 }; 1521enum determine_dev_size { dev_size_error = -1, unchanged = 0, shrunk = 1, grew = 2 };
1521extern enum determine_dev_size drbd_determin_dev_size(struct drbd_conf *, enum dds_flags) __must_hold(local); 1522extern enum determine_dev_size drbd_determine_dev_size(struct drbd_conf *, enum dds_flags) __must_hold(local);
1522extern void resync_after_online_grow(struct drbd_conf *); 1523extern void resync_after_online_grow(struct drbd_conf *);
1523extern void drbd_setup_queue_param(struct drbd_conf *mdev, unsigned int) __must_hold(local); 1524extern void drbd_reconsider_max_bio_size(struct drbd_conf *mdev);
1524extern enum drbd_state_rv drbd_set_role(struct drbd_conf *mdev, 1525extern enum drbd_state_rv drbd_set_role(struct drbd_conf *mdev,
1525 enum drbd_role new_role, 1526 enum drbd_role new_role,
1526 int force); 1527 int force);
@@ -1828,6 +1829,8 @@ static inline void __drbd_chk_io_error_(struct drbd_conf *mdev, int forcedetach,
1828 if (!forcedetach) { 1829 if (!forcedetach) {
1829 if (__ratelimit(&drbd_ratelimit_state)) 1830 if (__ratelimit(&drbd_ratelimit_state))
1830 dev_err(DEV, "Local IO failed in %s.\n", where); 1831 dev_err(DEV, "Local IO failed in %s.\n", where);
1832 if (mdev->state.disk > D_INCONSISTENT)
1833 _drbd_set_state(_NS(mdev, disk, D_INCONSISTENT), CS_HARD, NULL);
1831 break; 1834 break;
1832 } 1835 }
1833 /* NOTE fall through to detach case if forcedetach set */ 1836 /* NOTE fall through to detach case if forcedetach set */
@@ -2153,6 +2156,10 @@ static inline int get_net_conf(struct drbd_conf *mdev)
2153static inline void put_ldev(struct drbd_conf *mdev) 2156static inline void put_ldev(struct drbd_conf *mdev)
2154{ 2157{
2155 int i = atomic_dec_return(&mdev->local_cnt); 2158 int i = atomic_dec_return(&mdev->local_cnt);
2159
2160 /* This may be called from some endio handler,
2161 * so we must not sleep here. */
2162
2156 __release(local); 2163 __release(local);
2157 D_ASSERT(i >= 0); 2164 D_ASSERT(i >= 0);
2158 if (i == 0) { 2165 if (i == 0) {