You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
drbd: Started to separated connection flags (tconn) from block device flags (mdev)
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
This commit is contained in:
@@ -754,7 +754,7 @@ enum {
|
|||||||
#define EE_WAS_ERROR (1<<__EE_WAS_ERROR)
|
#define EE_WAS_ERROR (1<<__EE_WAS_ERROR)
|
||||||
#define EE_HAS_DIGEST (1<<__EE_HAS_DIGEST)
|
#define EE_HAS_DIGEST (1<<__EE_HAS_DIGEST)
|
||||||
|
|
||||||
/* global flag bits */
|
/* flag bits per mdev */
|
||||||
enum {
|
enum {
|
||||||
CREATE_BARRIER, /* next P_DATA is preceded by a P_BARRIER */
|
CREATE_BARRIER, /* next P_DATA is preceded by a P_BARRIER */
|
||||||
SIGNAL_ASENDER, /* whether asender wants to be interrupted */
|
SIGNAL_ASENDER, /* whether asender wants to be interrupted */
|
||||||
@@ -782,8 +782,6 @@ enum {
|
|||||||
GO_DISKLESS, /* Disk is being detached, on io-error or admin request. */
|
GO_DISKLESS, /* Disk is being detached, on io-error or admin request. */
|
||||||
WAS_IO_ERROR, /* Local disk failed returned IO error */
|
WAS_IO_ERROR, /* Local disk failed returned IO error */
|
||||||
RESYNC_AFTER_NEG, /* Resync after online grow after the attach&negotiate finished. */
|
RESYNC_AFTER_NEG, /* Resync after online grow after the attach&negotiate finished. */
|
||||||
NET_CONGESTED, /* The data socket is congested */
|
|
||||||
|
|
||||||
CONFIG_PENDING, /* serialization of (re)configuration requests.
|
CONFIG_PENDING, /* serialization of (re)configuration requests.
|
||||||
* if set, also prevents the device from dying */
|
* if set, also prevents the device from dying */
|
||||||
DEVICE_DYING, /* device became unconfigured,
|
DEVICE_DYING, /* device became unconfigured,
|
||||||
@@ -910,10 +908,16 @@ struct fifo_buffer {
|
|||||||
unsigned int size;
|
unsigned int size;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* flag bits per tconn */
|
||||||
|
enum {
|
||||||
|
NET_CONGESTED, /* The data socket is congested */
|
||||||
|
};
|
||||||
|
|
||||||
struct drbd_tconn { /* is a resource from the config file */
|
struct drbd_tconn { /* is a resource from the config file */
|
||||||
char *name; /* Resource name */
|
char *name; /* Resource name */
|
||||||
struct list_head all_tconn; /* List of all drbd_tconn, prot by global_state_lock */
|
struct list_head all_tconn; /* List of all drbd_tconn, prot by global_state_lock */
|
||||||
struct drbd_conf *volume0; /* TODO: Remove me again */
|
struct drbd_conf *volume0; /* TODO: Remove me again */
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
struct net_conf *net_conf; /* protected by get_net_conf() and put_net_conf() */
|
struct net_conf *net_conf; /* protected by get_net_conf() and put_net_conf() */
|
||||||
atomic_t net_cnt; /* Users of net_conf */
|
atomic_t net_cnt; /* Users of net_conf */
|
||||||
|
|||||||
@@ -1358,7 +1358,7 @@ static void drbd_update_congested(struct drbd_conf *mdev)
|
|||||||
{
|
{
|
||||||
struct sock *sk = mdev->tconn->data.socket->sk;
|
struct sock *sk = mdev->tconn->data.socket->sk;
|
||||||
if (sk->sk_wmem_queued > sk->sk_sndbuf * 4 / 5)
|
if (sk->sk_wmem_queued > sk->sk_sndbuf * 4 / 5)
|
||||||
set_bit(NET_CONGESTED, &mdev->flags);
|
set_bit(NET_CONGESTED, &mdev->tconn->flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The idea of sendpage seems to be to put some kind of reference
|
/* The idea of sendpage seems to be to put some kind of reference
|
||||||
@@ -1431,7 +1431,7 @@ static int _drbd_send_page(struct drbd_conf *mdev, struct page *page,
|
|||||||
offset += sent;
|
offset += sent;
|
||||||
} while (len > 0 /* THINK && mdev->cstate >= C_CONNECTED*/);
|
} while (len > 0 /* THINK && mdev->cstate >= C_CONNECTED*/);
|
||||||
set_fs(oldfs);
|
set_fs(oldfs);
|
||||||
clear_bit(NET_CONGESTED, &mdev->flags);
|
clear_bit(NET_CONGESTED, &mdev->tconn->flags);
|
||||||
|
|
||||||
ok = (len == 0);
|
ok = (len == 0);
|
||||||
if (likely(ok))
|
if (likely(ok))
|
||||||
@@ -1694,7 +1694,7 @@ int drbd_send(struct drbd_conf *mdev, struct socket *sock,
|
|||||||
} while (sent < size);
|
} while (sent < size);
|
||||||
|
|
||||||
if (sock == mdev->tconn->data.socket)
|
if (sock == mdev->tconn->data.socket)
|
||||||
clear_bit(NET_CONGESTED, &mdev->flags);
|
clear_bit(NET_CONGESTED, &mdev->tconn->flags);
|
||||||
|
|
||||||
if (rv <= 0) {
|
if (rv <= 0) {
|
||||||
if (rv != -EAGAIN) {
|
if (rv != -EAGAIN) {
|
||||||
@@ -2161,7 +2161,7 @@ static int drbd_congested(void *congested_data, int bdi_bits)
|
|||||||
reason = 'b';
|
reason = 'b';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bdi_bits & (1 << BDI_async_congested) && test_bit(NET_CONGESTED, &mdev->flags)) {
|
if (bdi_bits & (1 << BDI_async_congested) && test_bit(NET_CONGESTED, &mdev->tconn->flags)) {
|
||||||
r |= (1 << BDI_async_congested);
|
r |= (1 << BDI_async_congested);
|
||||||
reason = reason == 'b' ? 'a' : 'n';
|
reason = reason == 'b' ? 'a' : 'n';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user