public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Rohland <cr@sap.com>
To: David Howells <dhowells@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH,preliminary] cleanup shm handling
Date: 13 Dec 2000 14:52:23 +0100	[thread overview]
Message-ID: <qwwvgsoig2w.fsf@sap.com> (raw)
In-Reply-To: <21834.976708267@warthog.cambridge.redhat.com>
In-Reply-To: David Howells's message of "Wed, 13 Dec 2000 11:51:07 +0000"

Hi David,

On Wed, 13 Dec 2000, David Howells wrote:
>>> I'm currently writing a Win32 emulation kernel module to help
>>> speed Wine up,
>                                            ^^^^^^^^^^^^^
>> fd = shm_open ("xxx",...)
>> ptr = mmap (NULL, size, ..., fd, offset);
> 
> I am doing this from within kernel space. I'd like to avoid doing
> the full open and mmap if possible. I was wondering if there're some
> shortcuts I could make use of.

There will be a 

struct file *shmem_file_setup(char * name, loff_t size)

which gives you an open sruct file to an unlinked file of size
size. You can then do

down(&current->mm->mmap_sem);
user_addr = (void *) do_mmap (file, addr, size, prot, flags, 0);
up(&current->mm->mmap_sem);

with that struct file. You can look at shmget/shmat in ipc/shm.c. They
use the same procedure form kernel space. 

All this will only work with my patch.

Greetings
		Christoph

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2000-12-13 14:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-08 13:23 [PATCH,preliminary] cleanup shm handling Christoph Rohland
2000-12-08 15:13 ` David Howells
2000-12-08 20:04   ` Christoph Rohland
2000-12-13 11:51     ` David Howells
2000-12-13 13:52       ` Christoph Rohland [this message]
2000-12-13 16:43         ` David Howells
2000-12-13 17:15           ` Christoph Rohland
2000-12-13 17:29             ` David Howells
2000-12-08 18:26 ` Linus Torvalds
2000-12-08 22:21   ` Christoph Rohland
2000-12-08 22:36     ` Linus Torvalds

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=qwwvgsoig2w.fsf@sap.com \
    --to=cr@sap.com \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox