lkml.org 
[lkml]   [2020]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 01/35] fs: introduce dmemfs module
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.

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