diff options
author | наб <[email protected]> | 2022-02-20 15:04:49 +0100 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2022-03-08 09:33:04 -0800 |
commit | 8a3d77358aa8a6ad327b0837a3e6bd269bee6fb4 (patch) | |
tree | 266d6c36d3e3dd5f913871ca259240062983d842 /lib/libzfs/os | |
parent | 08eb2309ce256d555a3a46d3887ca3d9bb9ead92 (diff) |
libzfs: migrate single-use libzfs_set_pipe_max() to libzfs_core
Notably, this also means that the pipe is expanded before each
dataset is received, so updates to /p/s/f/pipe-max-size are reflected
for each new dataset
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Rich Ercolani <[email protected]>
Reviewed-by: Paul Dagnelie <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes #13133
Diffstat (limited to 'lib/libzfs/os')
-rw-r--r-- | lib/libzfs/os/freebsd/libzfs_compat.c | 6 | ||||
-rw-r--r-- | lib/libzfs/os/linux/libzfs_sendrecv_os.c | 52 |
2 files changed, 0 insertions, 58 deletions
diff --git a/lib/libzfs/os/freebsd/libzfs_compat.c b/lib/libzfs/os/freebsd/libzfs_compat.c index ce2dcef00..f5be2b90b 100644 --- a/lib/libzfs/os/freebsd/libzfs_compat.c +++ b/lib/libzfs/os/freebsd/libzfs_compat.c @@ -38,12 +38,6 @@ #define ZFS_KMOD "openzfs" #endif -void -libzfs_set_pipe_max(int infd) -{ - /* FreeBSD automatically resizes */ - (void) infd; -} static int execvPe(const char *name, const char *path, char * const *argv, diff --git a/lib/libzfs/os/linux/libzfs_sendrecv_os.c b/lib/libzfs/os/linux/libzfs_sendrecv_os.c deleted file mode 100644 index 593c38ec6..000000000 --- a/lib/libzfs/os/linux/libzfs_sendrecv_os.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - - -#include <libzfs.h> - -#include "../../libzfs_impl.h" - -#ifndef F_SETPIPE_SZ -#define F_SETPIPE_SZ (F_SETLEASE + 7) -#endif /* F_SETPIPE_SZ */ - -#ifndef F_GETPIPE_SZ -#define F_GETPIPE_SZ (F_GETLEASE + 7) -#endif /* F_GETPIPE_SZ */ - -void -libzfs_set_pipe_max(int infd) -{ - FILE *procf = fopen("/proc/sys/fs/pipe-max-size", "re"); - - if (procf != NULL) { - unsigned long max_psize; - long cur_psize; - if (fscanf(procf, "%lu", &max_psize) > 0) { - cur_psize = fcntl(infd, F_GETPIPE_SZ); - if (cur_psize > 0 && - max_psize > (unsigned long) cur_psize) - fcntl(infd, F_SETPIPE_SZ, - max_psize); - } - fclose(procf); - } -} |