Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752056AbbBVPqx (ORCPT ); Sun, 22 Feb 2015 10:46:53 -0500 Received: from mail-we0-f174.google.com ([74.125.82.174]:39968 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751810AbbBVPqv (ORCPT ); Sun, 22 Feb 2015 10:46:51 -0500 Message-ID: <54E9F9E7.40508@gmail.com> Date: Sun, 22 Feb 2015 17:46:47 +0200 From: Boaz Harrosh User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Nicolas Iooss , Al Viro CC: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] proc: get a reference to the owning module when opening file References: <1423623907-6950-1-git-send-email-nicolas.iooss_linux@m4x.org> <20150217201458.GA12422@ZenIV.linux.org.uk> <54E87190.6070209@m4x.org> In-Reply-To: <54E87190.6070209@m4x.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1565 Lines: 39 On 02/21/2015 01:52 PM, Nicolas Iooss wrote: <> > > I'm basically developing a project where I created an out-of-tree module > which uses mmap() as a kind of communication channel between a kernel > module and a userspace program (in short, a ring buffer). The virtual > file which is used for mmap() was initially created in debugfs, but as > this filesystem is not always mounted on production systems, I needed > another one and ended up using procfs. I did not consider creating a > character or block device in /dev as I wasn't at ease with grabbing a > major number which could potentially conflict with other out-of-tree > drivers. As using procfs seems not to be fine, I guess I'll anyway use > a block device with a major number in the experimental range (240-254). > > In short, the module I'm writing does not have to be in procfs, and I've > got funnier things to work on than cleaning up vm_operations_struct. > I know that some in-tree drivers do similar things with shmem (tmpfs). shmem even has an in-kernel API for drivers to create and lock pre-allocated files, so when user-mode loads they already find what they need. You should check it out it should have a much better mmap semantics for you, since it is a real FS. > Thank you for your detailed reply. > > Nicolas > <> Good luck Boaz -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/