linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Konstantin Khlebnikov <koct9i@gmail.com>
To: David Herrmann <dh.herrmann@gmail.com>
Cc: "Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Michael Kerrisk" <mtk.manpages@gmail.com>,
	"Ryan Lortie" <desrt@desrt.ca>,
	"Linus Torvalds" <torvalds@linux-foundation.org>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	"Johannes Weiner" <hannes@cmpxchg.org>,
	"Tejun Heo" <tj@kernel.org>,
	"Greg Kroah-Hartman" <greg@kroah.com>,
	"John Stultz" <john.stultz@linaro.org>,
	"Kristian Høgsberg" <krh@bitplanet.net>,
	"Lennart Poettering" <lennart@poettering.net>,
	"Daniel Mack" <zonque@gmail.com>, "Kay Sievers" <kay@vrfy.org>
Subject: Re: [PATCH v2 2/3] shm: add memfd_create() syscall
Date: Wed, 21 May 2014 14:50:19 +0400	[thread overview]
Message-ID: <CALYGNiM5dVhW9rp8Xpbu=DpENobUtRpRNTteJXbg1s99_STNiw@mail.gmail.com> (raw)
In-Reply-To: <1397587118-1214-3-git-send-email-dh.herrmann@gmail.com>

On Tue, Apr 15, 2014 at 10:38 PM, David Herrmann <dh.herrmann@gmail.com> wrote:
> memfd_create() is similar to mmap(MAP_ANON), but returns a file-descriptor
> that you can pass to mmap(). It can support sealing and avoids any
> connection to user-visible mount-points. Thus, it's not subject to quotas
> on mounted file-systems, but can be used like malloc()'ed memory, but
> with a file-descriptor to it.
>
> memfd_create() does not create a front-FD, but instead returns the raw
> shmem file, so calls like ftruncate() can be used. Also calls like fstat()
> will return proper information and mark the file as regular file. If you
> want sealing, you can specify MFD_ALLOW_SEALING. Otherwise, sealing is not
> support (like on all other regular files).
>
> Compared to O_TMPFILE, it does not require a tmpfs mount-point and is not
> subject to quotas and alike.
>
> Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
> ---

<cut>

> +++ b/include/linux/syscalls.h
> @@ -802,6 +802,7 @@ asmlinkage long sys_timerfd_settime(int ufd, int flags,
>  asmlinkage long sys_timerfd_gettime(int ufd, struct itimerspec __user *otmr);
>  asmlinkage long sys_eventfd(unsigned int count);
>  asmlinkage long sys_eventfd2(unsigned int count, int flags);
> +asmlinkage long sys_memfd_create(const char *uname_ptr, u64 size, u64 flags);

Is it right to use u64 here? I think arguments sould be 'loff_t' and 'int'.

>  asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len);
>  asmlinkage long sys_old_readdir(unsigned int, struct old_linux_dirent __user *, unsigned int);
>  asmlinkage long sys_pselect6(int, fd_set __user *, fd_set __user *,

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2014-05-21 10:50 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-15 18:38 [PATCH v2 0/3] File Sealing & memfd_create() David Herrmann
2014-04-15 18:38 ` [PATCH v2 1/3] shm: add sealing API David Herrmann
2014-05-20  2:16   ` Hugh Dickins
2014-05-23 16:37     ` David Herrmann
2014-06-02 10:30       ` Hugh Dickins
2014-04-15 18:38 ` [PATCH v2 2/3] shm: add memfd_create() syscall David Herrmann
2014-05-20  2:20   ` Hugh Dickins
2014-05-23 16:57     ` David Herrmann
2014-06-02 10:59       ` Hugh Dickins
2014-06-02 17:50         ` Andy Lutomirski
2014-06-13 10:42         ` David Herrmann
2014-05-21 10:50   ` Konstantin Khlebnikov [this message]
2014-04-15 18:38 ` [PATCH v2 3/3] selftests: add memfd_create() + sealing tests David Herrmann
2014-05-20  2:22   ` Hugh Dickins
2014-05-23 17:06     ` David Herrmann
2014-05-14  5:09 ` [PATCH v2 0/3] File Sealing & memfd_create() Hugh Dickins
2014-05-14 16:15   ` Tony Battersby
2014-05-14 22:35     ` Hugh Dickins
2014-05-19 11:44       ` David Herrmann
2014-05-19 16:09         ` Jan Kara
2014-05-19 22:11           ` Hugh Dickins
2014-05-26 11:44             ` David Herrmann
2014-05-31  4:44               ` Hugh Dickins
2014-06-02  4:42         ` Minchan Kim
2014-06-02  9:14           ` Jan Kara
2014-06-02 16:04             ` David Herrmann
2014-06-03  8:31               ` Peter Zijlstra

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='CALYGNiM5dVhW9rp8Xpbu=DpENobUtRpRNTteJXbg1s99_STNiw@mail.gmail.com' \
    --to=koct9i@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=desrt@desrt.ca \
    --cc=dh.herrmann@gmail.com \
    --cc=greg@kroah.com \
    --cc=hannes@cmpxchg.org \
    --cc=john.stultz@linaro.org \
    --cc=kay@vrfy.org \
    --cc=krh@bitplanet.net \
    --cc=lennart@poettering.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mtk.manpages@gmail.com \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=zonque@gmail.com \
    /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