Message ID | 20241115-vfs-tmpfs-d443d413eb26@brauner (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [GIT,PULL] vfs tmpfs | expand |
On Fri, 15 Nov 2024 at 06:07, Christian Brauner <brauner@kernel.org> wrote: > > This adds case-insensitive support for tmpfs. Ugh. I've pulled this, but I don't love it. This pattern: if (IS_ENABLED(CONFIG_UNICODE) && IS_CASEFOLDED(dir)) d_add(dentry, inode); else d_instantiate(dentry, inode); needs an explanation, and probably a helper. And > include/linux/shmem_fs.h | 6 +- > mm/shmem.c | 265 ++++++++++++++++++++++++++++++++++-- I'm starting to think this should be renamed and/or possibly split up a bit. The actual path component handling functions should be moved out of mm/shmem.c. The whole "mm/shmem.c" thing made sense back in the days when this was mainly about memory management functions with some thing wrappers for exposing them as a filesystem, and tmpfs was kind of an odd special case. Those thin wrappers aren't very thin any more, and "shmem" is becoming something of a misnomer with the actual filesystem being called "tmpfs". We also actually have *two* different implementations of "tmpfs" - both in that same file - which is really annoying. The other one is based on the ramfs code. Would it be possible to try to make this a bit saner? Linus
The pull request you sent on Fri, 15 Nov 2024 15:06:58 +0100:
> git@gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs tags/vfs-6.13.tmpfs
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/7956186e751bc15541ede638008feedc0e427883
Thank you!
On Mon, Nov 18, 2024 at 11:26:12AM -0800, Linus Torvalds wrote: > On Fri, 15 Nov 2024 at 06:07, Christian Brauner <brauner@kernel.org> wrote: > > > > This adds case-insensitive support for tmpfs. > > Ugh. > > I've pulled this, but I don't love it. > > This pattern: > > if (IS_ENABLED(CONFIG_UNICODE) && IS_CASEFOLDED(dir)) > d_add(dentry, inode); > else > d_instantiate(dentry, inode); > > needs an explanation, and probably a helper. I think we had this discussion before where we decided to move all the checks inline. But yes, this could probably be refactored to be easier to understand. > > And > > > include/linux/shmem_fs.h | 6 +- > > mm/shmem.c | 265 ++++++++++++++++++++++++++++++++++-- > > I'm starting to think this should be renamed and/or possibly split up > a bit. The actual path component handling functions should be moved > out of mm/shmem.c. > > The whole "mm/shmem.c" thing made sense back in the days when this was > mainly about memory management functions with some thing wrappers for > exposing them as a filesystem, and tmpfs was kind of an odd special > case. > > Those thin wrappers aren't very thin any more, and "shmem" is becoming > something of a misnomer with the actual filesystem being called > "tmpfs". > > We also actually have *two* different implementations of "tmpfs" - > both in that same file - which is really annoying. The other one is > based on the ramfs code. > > Would it be possible to try to make this a bit saner? So one possibility would be to move tmpfs into fs and have fs/tmpfs/ (or mm/tmpfs/) which would also be nice because mm/shmem.c is actively confusing when you're looking for the tmpfs code. And then it could simply be split up. I'm all for it.
diff --cc include/linux/fs.h index 3e53ba079f17,001d580af862..eae7ce884030 --- a/include/linux/fs.h