git: 58a8f6e9ecab - main - cuse(3): Allow allocating a memory buffer of exactly 2 GBytes.

From: Hans Petter Selasky <hselasky_at_FreeBSD.org>
Date: Wed, 20 Jul 2022 08:47:11 UTC
The branch main has been updated by hselasky:

URL: https://cgit.FreeBSD.org/src/commit/?id=58a8f6e9ecabba975f2cda8416bcc36c2073a7a8

commit 58a8f6e9ecabba975f2cda8416bcc36c2073a7a8
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-20 08:41:11 +0000

    cuse(3): Allow allocating a memory buffer of exactly 2 GBytes.
    
    The manual page date will be bumped separately.
    
    MFC after:      1 week
    Sponsored by:   NVIDIA Networking
---
 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));