Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 163110
b: refs/heads/master
c: 063c4c9
h: refs/heads/master
v: v3
  • Loading branch information
Lars Marowsky-Bree authored and David Teigland committed Aug 24, 2009
1 parent a3c7cd9 commit 7907740
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 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: b5711b8e5a437ca7d35321d19de568b4f76a7739
refs/heads/master: 063c4c99630c0b06afad080d2a18bda64172c1a2
15 changes: 13 additions & 2 deletions trunk/fs/dlm/lowcomms.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ struct connection {
#define CF_CONNECT_PENDING 3
#define CF_INIT_PENDING 4
#define CF_IS_OTHERCON 5
#define CF_CLOSE 6
struct list_head writequeue; /* List of outgoing writequeue_entries */
spinlock_t writequeue_lock;
int (*rx_action) (struct connection *); /* What to do when active */
Expand Down Expand Up @@ -299,6 +300,8 @@ static void lowcomms_write_space(struct sock *sk)

static inline void lowcomms_connect_sock(struct connection *con)
{
if (test_bit(CF_CLOSE, &con->flags))
return;
if (!test_and_set_bit(CF_CONNECT_PENDING, &con->flags))
queue_work(send_workqueue, &con->swork);
}
Expand Down Expand Up @@ -1368,6 +1371,13 @@ int dlm_lowcomms_close(int nodeid)
log_print("closing connection to node %d", nodeid);
con = nodeid2con(nodeid, 0);
if (con) {
clear_bit(CF_CONNECT_PENDING, &con->flags);
clear_bit(CF_WRITE_PENDING, &con->flags);
set_bit(CF_CLOSE, &con->flags);
if (cancel_work_sync(&con->swork))
log_print("canceled swork for node %d", nodeid);
if (cancel_work_sync(&con->rwork))
log_print("canceled rwork for node %d", nodeid);
clean_one_writequeue(con);
close_connection(con, true);
}
Expand All @@ -1393,9 +1403,10 @@ static void process_send_sockets(struct work_struct *work)

if (test_and_clear_bit(CF_CONNECT_PENDING, &con->flags)) {
con->connect_action(con);
set_bit(CF_WRITE_PENDING, &con->flags);
}
clear_bit(CF_WRITE_PENDING, &con->flags);
send_to_sock(con);
if (test_and_clear_bit(CF_WRITE_PENDING, &con->flags))
send_to_sock(con);
}


Expand Down

0 comments on commit 7907740

Please sign in to comment.