summaryrefslogtreecommitdiff
path: root/lib/label
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2021-10-29 14:49:36 -0500
committerDavid Teigland <teigland@redhat.com>2021-11-03 08:50:57 -0500
commit6ea8d975b23758e6e099bf51cf7334f27f9fd096 (patch)
tree29a344db64e2e9887db59e57ea2b0f039c5f8ccd /lib/label
parentb5b0369e4decbd7e2b4a160ba8ebad4e8f8a4094 (diff)
downloadlvm2-6ea8d975b23758e6e099bf51cf7334f27f9fd096.tar.gz
lvmdevices: increase open file limit
Diffstat (limited to 'lib/label')
-rw-r--r--lib/label/label.c4
-rw-r--r--lib/label/label.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/label/label.c b/lib/label/label.c
index 479a5037a..9fac3e464 100644
--- a/lib/label/label.c
+++ b/lib/label/label.c
@@ -891,7 +891,7 @@ static int _setup_bcache(void)
#define BASE_FD_COUNT 32 /* Number of open files we want apart from devs */
-static void _prepare_open_file_limit(struct cmd_context *cmd, unsigned int num_devs)
+void prepare_open_file_limit(struct cmd_context *cmd, unsigned int num_devs)
{
#ifdef HAVE_PRLIMIT
struct rlimit old = { 0 }, new;
@@ -1165,7 +1165,7 @@ int label_scan(struct cmd_context *cmd)
* which we want to keep open) is higher than the current
* soft limit.
*/
- _prepare_open_file_limit(cmd, dm_list_size(&scan_devs));
+ prepare_open_file_limit(cmd, dm_list_size(&scan_devs));
/*
* Do the main scan.
diff --git a/lib/label/label.h b/lib/label/label.h
index 8b510eb79..34563efd0 100644
--- a/lib/label/label.h
+++ b/lib/label/label.h
@@ -134,4 +134,6 @@ void dev_invalidate(struct device *dev);
void dev_set_last_byte(struct device *dev, uint64_t offset);
void dev_unset_last_byte(struct device *dev);
+void prepare_open_file_limit(struct cmd_context *cmd, unsigned int num_devs);
+
#endif