From owner-svn-src-head@freebsd.org Tue Dec 22 09:55:45 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 760B1A4E2EC; Tue, 22 Dec 2015 09:55:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5169E136B; Tue, 22 Dec 2015 09:55:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBM9tifr053079; Tue, 22 Dec 2015 09:55:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBM9ti5P053076; Tue, 22 Dec 2015 09:55:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512220955.tBM9ti5P053076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 22 Dec 2015 09:55:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292594 - in head: lib/libcuse sys/fs/cuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 09:55:45 -0000 Author: hselasky Date: Tue Dec 22 09:55:44 2015 New Revision: 292594 URL: https://svnweb.freebsd.org/changeset/base/292594 Log: Make CUSE usable with platforms where the size of "unsigned long" is different from the size of a pointer. Modified: head/lib/libcuse/cuse_lib.c head/sys/fs/cuse/cuse.c head/sys/fs/cuse/cuse_ioctl.h Modified: head/lib/libcuse/cuse_lib.c ============================================================================== --- head/lib/libcuse/cuse_lib.c Tue Dec 22 09:41:33 2015 (r292593) +++ head/lib/libcuse/cuse_lib.c Tue Dec 22 09:55:44 2015 (r292594) @@ -711,8 +711,8 @@ cuse_copy_out(const void *src, void *use if (pe->is_local) { memcpy(user_dst, src, len); } else { - info.local_ptr = (unsigned long)src; - info.peer_ptr = (unsigned long)user_dst; + info.local_ptr = (uintptr_t)src; + info.peer_ptr = (uintptr_t)user_dst; info.length = len; error = ioctl(f_cuse, CUSE_IOCTL_WRITE_DATA, &info); @@ -744,8 +744,8 @@ cuse_copy_in(const void *user_src, void if (pe->is_local) { memcpy(dst, user_src, len); } else { - info.local_ptr = (unsigned long)dst; - info.peer_ptr = (unsigned long)user_src; + info.local_ptr = (uintptr_t)dst; + info.peer_ptr = (uintptr_t)user_src; info.length = len; error = ioctl(f_cuse, CUSE_IOCTL_READ_DATA, &info); Modified: head/sys/fs/cuse/cuse.c ============================================================================== --- head/sys/fs/cuse/cuse.c Tue Dec 22 09:41:33 2015 (r292593) +++ head/sys/fs/cuse/cuse.c Tue Dec 22 09:55:44 2015 (r292594) @@ -511,7 +511,7 @@ cuse_client_is_closing(struct cuse_clien static void cuse_client_send_command_locked(struct cuse_client_command *pccmd, - unsigned long data_ptr, unsigned long arg, int fflags, int ioflag) + uintptr_t data_ptr, unsigned long arg, int fflags, int ioflag) { unsigned long cuse_fflags = 0; struct cuse_server *pcs; @@ -1547,7 +1547,7 @@ cuse_client_read(struct cdev *dev, struc cuse_lock(); cuse_client_send_command_locked(pccmd, - (unsigned long)uio->uio_iov->iov_base, + (uintptr_t)uio->uio_iov->iov_base, (unsigned long)(unsigned int)len, pcc->fflags, ioflag); error = cuse_client_receive_command_locked(pccmd, 0, 0); @@ -1607,7 +1607,7 @@ cuse_client_write(struct cdev *dev, stru cuse_lock(); cuse_client_send_command_locked(pccmd, - (unsigned long)uio->uio_iov->iov_base, + (uintptr_t)uio->uio_iov->iov_base, (unsigned long)(unsigned int)len, pcc->fflags, ioflag); error = cuse_client_receive_command_locked(pccmd, 0, 0); Modified: head/sys/fs/cuse/cuse_ioctl.h ============================================================================== --- head/sys/fs/cuse/cuse_ioctl.h Tue Dec 22 09:41:33 2015 (r292593) +++ head/sys/fs/cuse/cuse_ioctl.h Tue Dec 22 09:55:44 2015 (r292594) @@ -40,8 +40,8 @@ struct cuse_dev; struct cuse_data_chunk { - unsigned long local_ptr; - unsigned long peer_ptr; + uintptr_t local_ptr; + uintptr_t peer_ptr; unsigned long length; }; @@ -54,7 +54,7 @@ struct cuse_command { struct cuse_dev *dev; unsigned long fflags; uintptr_t per_file_handle; - unsigned long data_pointer; + uintptr_t data_pointer; unsigned long argument; unsigned long command; /* see CUSE_CMD_XXX */ };