Make CUSE usable with platforms where the size of "unsigned long" is

different from the size of a pointer.
This commit is contained in:
Hans Petter Selasky 2015-12-22 09:41:33 +00:00
parent ac60e80129
commit 9fb69c9d9d
2 changed files with 3 additions and 3 deletions

View File

@ -1137,7 +1137,7 @@ cuse_server_ioctl(struct cdev *dev, unsigned long cmd,
if (pccmd != NULL) {
pcc = pccmd->client;
for (n = 0; n != CUSE_CMD_MAX; n++) {
pcc->cmds[n].sub.per_file_handle = *(unsigned long *)data;
pcc->cmds[n].sub.per_file_handle = *(uintptr_t *)data;
}
} else {
error = ENXIO;

View File

@ -53,7 +53,7 @@ struct cuse_alloc_info {
struct cuse_command {
struct cuse_dev *dev;
unsigned long fflags;
unsigned long per_file_handle;
uintptr_t per_file_handle;
unsigned long data_pointer;
unsigned long argument;
unsigned long command; /* see CUSE_CMD_XXX */
@ -76,7 +76,7 @@ struct cuse_create_dev {
#define CUSE_IOCTL_GET_SIG _IOR('C', 4, int)
#define CUSE_IOCTL_ALLOC_MEMORY _IOW('C', 5, struct cuse_alloc_info)
#define CUSE_IOCTL_FREE_MEMORY _IOW('C', 6, struct cuse_alloc_info)
#define CUSE_IOCTL_SET_PFH _IOW('C', 7, unsigned long)
#define CUSE_IOCTL_SET_PFH _IOW('C', 7, uintptr_t)
#define CUSE_IOCTL_CREATE_DEV _IOW('C', 8, struct cuse_create_dev)
#define CUSE_IOCTL_DESTROY_DEV _IOW('C', 9, struct cuse_dev *)
#define CUSE_IOCTL_ALLOC_UNIT _IOR('C',10, int)