Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346259
b: refs/heads/master
c: 19fffd7
h: refs/heads/master
i:
  346257: 767e741
  346255: 113e3df
v: v3
  • Loading branch information
Philipp Reisner committed Nov 9, 2012
1 parent e7481cf commit fdb9361
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d76440181d0e05826f228189b74b4dbf64b68981
refs/heads/master: 19fffd7b0303e8843aa2decfd43fa57c9d511409
1 change: 1 addition & 0 deletions trunk/drivers/block/drbd/drbd_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,7 @@ extern void drbd_free_bc(struct drbd_backing_dev *ldev);
extern void drbd_mdev_cleanup(struct drbd_conf *mdev);
void drbd_print_uuids(struct drbd_conf *mdev, const char *text);

extern void conn_md_sync(struct drbd_tconn *tconn);
extern void drbd_md_sync(struct drbd_conf *mdev);
extern int drbd_md_read(struct drbd_conf *mdev, struct drbd_backing_dev *bdev);
extern void drbd_uuid_set(struct drbd_conf *mdev, int idx, u64 val) __must_hold(local);
Expand Down
16 changes: 16 additions & 0 deletions trunk/drivers/block/drbd/drbd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2820,6 +2820,22 @@ void drbd_free_sock(struct drbd_tconn *tconn)

/* meta data management */

void conn_md_sync(struct drbd_tconn *tconn)
{
struct drbd_conf *mdev;
int vnr;

rcu_read_lock();
idr_for_each_entry(&tconn->volumes, mdev, vnr) {
kref_get(&mdev->kref);
rcu_read_unlock();
drbd_md_sync(mdev);
kref_put(&mdev->kref, &drbd_minor_destroy);
rcu_read_lock();
}
rcu_read_unlock();
}

struct meta_data_on_disk {
u64 la_size; /* last agreed size. */
u64 uuid[UI_SIZE]; /* UUIDs. */
Expand Down
16 changes: 0 additions & 16 deletions trunk/drivers/block/drbd/drbd_nl.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,22 +363,6 @@ int drbd_khelper(struct drbd_conf *mdev, char *cmd)
return ret;
}

static void conn_md_sync(struct drbd_tconn *tconn)
{
struct drbd_conf *mdev;
int vnr;

rcu_read_lock();
idr_for_each_entry(&tconn->volumes, mdev, vnr) {
kref_get(&mdev->kref);
rcu_read_unlock();
drbd_md_sync(mdev);
kref_put(&mdev->kref, &drbd_minor_destroy);
rcu_read_lock();
}
rcu_read_unlock();
}

int conn_khelper(struct drbd_tconn *tconn, char *cmd)
{
char *envp[] = { "HOME=/",
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -5390,6 +5390,7 @@ int drbd_asender(struct drbd_thread *thi)
if (0) {
reconnect:
conn_request_state(tconn, NS(conn, C_NETWORK_FAILURE), CS_HARD);
conn_md_sync(tconn);
}
if (0) {
disconnect:
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/block/drbd/drbd_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1563,6 +1563,9 @@ static int w_after_conn_state_ch(struct drbd_work *w, int unused)
}
}
kref_put(&tconn->kref, &conn_destroy);

conn_md_sync(tconn);

return 0;
}

Expand Down

0 comments on commit fdb9361

Please sign in to comment.