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
This commit is contained in:
Hans Petter Selasky 2022-07-18 17:13:27 +02:00
parent d14b53ee31
commit 58a8f6e9ec
3 changed files with 4 additions and 4 deletions

View File

@ -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.

View File

@ -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);

View File

@ -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));