How do we share ion buffers from user-space with other processes if they are exported/shared after fork? The ION_IOC_SHARE ioctl creates an fd for process-1. In 3.0 kernel, the ION_ION_IMPORT ioctl from process-2 calls ion_import_fd which calls fget(fd) which fails to find the file for the fd shared by process-1. In 3.4 kernel, dma_buf_get does the fget(fd) to get struct file which also fails for the same reason - fget searches in current->files.
- Nishanth Peethambaran
Hi Nishanth,
I'm not really taking "bugreports" on the ion code in 3.0. Consider it depricated in favor of 3.4. As for sharing file descriptors I'm not sure I understand your question. ION file descriptors are just like other fds, you can't call write on a file descriptor you didn't open in your process. fds are just offsets into your process local file table. If you want to share a file descriptor between processes you have to pass them properly using unix domain sockets, or in the case of android, the binder. These mechanisms cause the kernel to create a new file descriptor in the remote process that backs in the same file struct in the kernel. Think of it as inter-process dup.
Rebecca
On Mon, Aug 27, 2012 at 10:17 AM, Nishanth Peethambaran nishanth.peethu@gmail.com wrote:
How do we share ion buffers from user-space with other processes if they are exported/shared after fork? The ION_IOC_SHARE ioctl creates an fd for process-1. In 3.0 kernel, the ION_ION_IMPORT ioctl from process-2 calls ion_import_fd which calls fget(fd) which fails to find the file for the fd shared by process-1. In 3.4 kernel, dma_buf_get does the fget(fd) to get struct file which also fails for the same reason - fget searches in current->files.
- Nishanth Peethambaran
Linaro-mm-sig mailing list Linaro-mm-sig@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-mm-sig
linaro-mm-sig@lists.linaro.org