mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
lvmlockd: ignore cmd close if no locks were taken
When a command closes its connection, don't waste time looking for locks to purge if it did not make any lock requests.
This commit is contained in:
parent
ce2e60ab45
commit
62a87c84ed
@ -3529,6 +3529,13 @@ static void client_purge(struct client *cl)
|
|||||||
struct lockspace *ls;
|
struct lockspace *ls;
|
||||||
struct action *act;
|
struct action *act;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the client made no lock requests, there can be
|
||||||
|
* no locks to release for it.
|
||||||
|
*/
|
||||||
|
if (!cl->lock_ops)
|
||||||
|
return;
|
||||||
|
|
||||||
pthread_mutex_lock(&lockspaces_mutex);
|
pthread_mutex_lock(&lockspaces_mutex);
|
||||||
list_for_each_entry(ls, &lockspaces, list) {
|
list_for_each_entry(ls, &lockspaces, list) {
|
||||||
if (!(act = alloc_action()))
|
if (!(act = alloc_action()))
|
||||||
@ -4345,6 +4352,9 @@ static void client_recv_action(struct client *cl)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (act->op == LD_OP_LOCK && act->mode != LD_LK_UN)
|
||||||
|
cl->lock_ops = 1;
|
||||||
|
|
||||||
switch (act->op) {
|
switch (act->op) {
|
||||||
case LD_OP_START:
|
case LD_OP_START:
|
||||||
rv = add_lockspace(act);
|
rv = add_lockspace(act);
|
||||||
|
@ -85,6 +85,7 @@ struct client {
|
|||||||
unsigned int recv : 1;
|
unsigned int recv : 1;
|
||||||
unsigned int dead : 1;
|
unsigned int dead : 1;
|
||||||
unsigned int poll_ignore : 1;
|
unsigned int poll_ignore : 1;
|
||||||
|
unsigned int lock_ops : 1;
|
||||||
char name[MAX_NAME+1];
|
char name[MAX_NAME+1];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user