All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boaz Harrosh <openosd@gmail.com>
To: Nicolas Iooss <nicolas.iooss_linux@m4x.org>,
	Al Viro <viro@ZenIV.linux.org.uk>
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
Date: Sun, 22 Feb 2015 17:46:47 +0200	[thread overview]
Message-ID: <54E9F9E7.40508@gmail.com> (raw)
In-Reply-To: <54E87190.6070209@m4x.org>

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

      reply	other threads:[~2015-02-22 15:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-11  3:05 [PATCH] proc: get a reference to the owning module when opening file Nicolas Iooss
2015-02-17 20:14 ` Al Viro
2015-02-21 11:52   ` Nicolas Iooss
2015-02-22 15:46     ` Boaz Harrosh [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54E9F9E7.40508@gmail.com \
    --to=openosd@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.iooss_linux@m4x.org \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.