git: b95d9d3b863d - stable/13 - cuse(3): Allow allocating a memory buffer of exactly 2 GBytes.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 27 Jul 2022 09:36:48 UTC
The branch stable/13 has been updated by hselasky:
URL: https://cgit.FreeBSD.org/src/commit/?id=b95d9d3b863dd60d915371579bb9a1be98cecdac
commit b95d9d3b863dd60d915371579bb9a1be98cecdac
Author: Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2022-07-18 15:13:27 +0000
Commit: Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2022-07-27 09:33:58 +0000
cuse(3): Allow allocating a memory buffer of exactly 2 GBytes.
The manual page date will be bumped separately.
Sponsored by: NVIDIA Networking
(cherry picked from commit 58a8f6e9ecabba975f2cda8416bcc36c2073a7a8)
---
lib/libcuse/cuse.3 | 2 +-
lib/libcuse/cuse.h | 2 +-
lib/libcuse/cuse_lib.c | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/libcuse/cuse.3 b/lib/libcuse/cuse.3
index aab8ebb4d4f4..0aff43ac2155 100644
--- a/lib/libcuse/cuse.3
+++ b/lib/libcuse/cuse.3
@@ -114,7 +114,7 @@ See
for known error codes.
.Sh LIBRARY USAGE
.Ft "void *"
-.Fn "cuse_vmalloc" "int size"
+.Fn "cuse_vmalloc" "unsigned size"
This function allocates
.Ar size
bytes of memory.
diff --git a/lib/libcuse/cuse.h b/lib/libcuse/cuse.h
index d502c5bd5415..f82401b98bf3 100644
--- a/lib/libcuse/cuse.h
+++ b/lib/libcuse/cuse.h
@@ -54,7 +54,7 @@ struct cuse_methods {
int cuse_init(void);
int cuse_uninit(void);
-void *cuse_vmalloc(int);
+void *cuse_vmalloc(unsigned);
int cuse_is_vmalloc_addr(void *);
void cuse_vmfree(void *);
unsigned long cuse_vmoffset(void *ptr);
diff --git a/lib/libcuse/cuse_lib.c b/lib/libcuse/cuse_lib.c
index ec300add5903..2653ed3067d5 100644
--- a/lib/libcuse/cuse_lib.c
+++ b/lib/libcuse/cuse_lib.c
@@ -163,7 +163,7 @@ cuse_vmoffset(void *_ptr)
}
void *
-cuse_vmalloc(int size)
+cuse_vmalloc(unsigned size)
{
struct cuse_alloc_info info;
unsigned long pgsize;
@@ -174,7 +174,7 @@ cuse_vmalloc(int size)
int error;
/* some sanity checks */
- if (f_cuse < 0 || size < 1 || (unsigned long)size > CUSE_ALLOC_BYTES_MAX)
+ if (f_cuse < 0 || size < 1 || size > CUSE_ALLOC_BYTES_MAX)
return (NULL);
memset(&info, 0, sizeof(info));