lkml.org 
[lkml]   [2018]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.

\
 
 \ /
  Last update: 2018-05-31 23:26    [W:0.402 / U:1.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site