[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180531212559.GK30522@ZenIV.linux.org.uk>
Date: Thu, 31 May 2018 22:25:59 +0100
From: Al Viro <viro@...IV.linux.org.uk>
To: David Howells <dhowells@...hat.com>
Cc: linux-fsdevel@...r.kernel.org, linux-afs@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 19/32] VFS: Implement fsopen() to prepare for a mount
[ver #8]
On Fri, May 25, 2018 at 01:07:27AM +0100, David Howells wrote:
> + inode = alloc_anon_inode(fscontext_fs_mnt->mnt_sb);
> + if (IS_ERR(inode))
> + return ERR_CAST(inode);
> + inode->i_fop = &fscontext_fs_fops;
That's almost certainly wrong - you need it only if you want it possible to
reopen via /proc/*/fd/*
> + fc->phase = FS_CONTEXT_CREATE_PARAMS;
> +
> + ret = -ENOMEM;
> + path.dentry = d_alloc_pseudo(fscontext_fs_mnt->mnt_sb, &empty_name);
> + if (!path.dentry)
> + goto err_inode;
> + path.mnt = mntget(fscontext_fs_mnt);
> +
> + d_instantiate(path.dentry, inode);
> +
> + f = alloc_file(&path, FMODE_READ | FMODE_WRITE, &fscontext_fs_fops);
Re your question on IRC - we might want that fs in longer run, but for now
just go with anon_inode_getfile() here. Easier that way and we can always
switch later.
Powered by blists - more mailing lists