1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-11 04:13:46 +03:00

locking: introduce prioritized_section

Introduce prioritized_section() as a closer match to previous logic
of critical_section() that has been held over longer sequence of
ioctl commands - essentially it's matching operation on a single
cookie.

While 'critical_section()' now corresponds to locked memory - we hold
this memory only between suspend/resume thus notion of 'cookie' was
lost.

This patch restores some logic unintentionaly lost with dropping
memory locking for just activation/deactivation calls.
This commit is contained in:
Zdenek Kabelac 2018-03-15 09:07:24 +01:00
parent 043f58452a
commit 6365f011b0
3 changed files with 7 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.178 -
=====================================
Add prioritized_section() to restore cookie boundaries (2.02.177).
Enhance error messages when read error happens.
Enhance mirror log initialization for old mirror target.
Skip private crypto and stratis devices.

View File

@ -634,6 +634,11 @@ int critical_section(void)
return _critical_section;
}
int prioritized_section(void)
{
return _priority_raised;
}
/*
* The memlock_*_daemon functions will force the mlockall() call that we need
* to stay in memory, but they will have no effect on device scans (unlike

View File

@ -34,6 +34,7 @@ struct cmd_context;
void critical_section_inc(struct cmd_context *cmd, const char *reason);
void critical_section_dec(struct cmd_context *cmd, const char *reason);
int critical_section(void);
int prioritized_section(void);
void memlock_inc_daemon(struct cmd_context *cmd);
void memlock_dec_daemon(struct cmd_context *cmd);
int memlock_count_daemon(void);