From: Andi Kleen <ak@muc.de>
To: Matt Mackall <mpm@selenic.com>
Cc: Hugh Dickins <hugh@veritas.com>, Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Allow to disable shmem.o
Date: 8 Aug 2004 16:28:29 +0200 [thread overview]
Date: Sun, 8 Aug 2004 16:28:29 +0200 [thread overview]
Message-ID: <20040808142829.GC94449@muc.de> (raw)
In-Reply-To: <20040808140705.GH16310@waste.org>
On Sun, Aug 08, 2004 at 09:07:05AM -0500, Matt Mackall wrote:
> +extern struct inode *ramfs_get_inode(struct super_block *sb, int mode, dev_t dev);
> +extern struct super_block *ramfs_get_sb(struct file_system_type *fs_type,
> + int flags, const char *dev_name, void *data);
> +extern struct file_operations ramfs_file_operations;
> +extern struct vm_operations_struct generic_file_vm_ops;
This should be all in header files.
> + */
> +struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags)
> +{
> + int error;
> + struct file *file;
> + struct inode *inode;
> + struct dentry *dentry, *root;
> + struct qstr this;
> +
> + if (IS_ERR(shm_mnt))
> + return (void *)shm_mnt;
Why this strange cast?
> +
> + error = -ENOMEM;
> + this.name = name;
> + this.len = strlen(name);
> + this.hash = 0; /* will go */
> + root = shm_mnt->mnt_root;
> + dentry = d_alloc(root, &this);
> + if (!dentry)
> + goto put_memory;
> +
> + error = -ENFILE;
> + file = get_empty_filp();
> + if (!file)
> + goto put_dentry;
> +
> + error = -ENOSPC;
> + inode = ramfs_get_inode(root->d_sb, S_IFREG | S_IRWXUGO, 0);
Hmm, won't this allow everybody else to open it in /proc/pid/fd/ ?
(existing shmem.c seems to use it too, but it looks a bit bogus)
-AndI
next prev parent reply other threads:[~2004-08-08 14:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-07 22:14 Andi Kleen
2004-08-08 13:03 ` Hugh Dickins
2004-08-08 14:07 ` Matt Mackall
2004-08-08 14:28 ` Andi Kleen [this message]
2004-08-08 16:22 ` Hugh Dickins
2004-08-08 16:04 ` Hugh Dickins
2004-08-08 14:19 ` Andi Kleen
2004-08-08 16:11 ` Hugh Dickins
2004-08-08 18:37 ` Andrew Morton
2004-08-08 19:01 ` Hugh Dickins
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=20040808142829.GC94449@muc.de \
--to=ak@muc.de \
--cc=akpm@osdl.org \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mpm@selenic.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
all inboxes | Powered by JetHome®