Skip to content

Commit

Permalink
fs: dlm: move free writequeue into con free
Browse files Browse the repository at this point in the history
This patch just move the free of struct connection member writequeue
into the functionality when struct connection will be freed instead of
doing two iterations.

Signed-off-by: Alexander Aring <[email protected]>
Signed-off-by: David Teigland <[email protected]>
  • Loading branch information
Alexander Aring authored and teigland committed Aug 27, 2020
1 parent 3d2825c commit 0de9843
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions fs/dlm/lowcomms.c
Original file line number Diff line number Diff line change
Expand Up @@ -1550,13 +1550,6 @@ static void process_send_sockets(struct work_struct *work)
send_to_sock(con);
}


/* Discard all entries on the write queues */
static void clean_writequeues(void)
{
foreach_conn(clean_one_writequeue);
}

static void work_stop(void)
{
if (recv_workqueue)
Expand Down Expand Up @@ -1620,6 +1613,7 @@ static void free_conn(struct connection *con)
spin_lock(&connections_lock);
hlist_del_rcu(&con->list);
spin_unlock(&connections_lock);
clean_one_writequeue(con);
kfree_rcu(con, rcu);
}

Expand Down Expand Up @@ -1668,7 +1662,6 @@ void dlm_lowcomms_stop(void)

foreach_conn(shutdown_conn);
work_flush();
clean_writequeues();
foreach_conn(free_conn);
work_stop();
deinit_local();
Expand Down

0 comments on commit 0de9843

Please sign in to comment.