lkml.org 
[lkml]   [2020]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 01/35] fs: introduce dmemfs module
On Thu, Nov 12, 2020 at 7:09 AM Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> On Wed, Nov 11, 2020 at 04:53:00PM +0800, yulei zhang wrote:
>
> > > ... same here, seeing that you only call that thing from the next two functions
> > > and you do *not* provide ->mknod() as a method (unsurprisingly - what would
> > > device nodes do there?)
> > >
> >
> > Thanks for pointing this out. we may need support the mknod method, otherwise
> > the dev is redundant and need to be removed.
>
> I'd suggest turning that into (static) __create_file(....) with
>
> static int dmemfs_create(struct inode *dir, struct dentry *dentry,
> umode_t mode, bool excl)
> {
> return __create_file(dir, dentry, mode | S_IFREG);
> }
>
> static int dmemfs_mkdir(struct inode *dir, struct dentry *dentry,
> umode_t mode)
> {
> return __create_file(dir, dentry, mode | S_IFDIR);
> }
>
> (i.e. even inc_nlink() of parent folded into that).
>
> [snip]
>
> > Yes, we seperate the full implementation for dmemfs_file_mmap into
> > patch 05/35, it
> > will assign the interfaces to handle the page fault.
>
> It would be less confusing to move the introduction of ->mmap() to that patch,
> then.

Thanks for the suggestion. will refactor the patches accordingly.

\
 
 \ /
  Last update: 2020-11-12 11:04    [W:0.073 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site