]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
convert ramfs and tmpfs
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 26 Feb 2024 06:25:24 +0000 (01:25 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 16 Nov 2025 06:35:02 +0000 (01:35 -0500)
commit2313598222f9d9d737f2db725334d000ffaff809
treec8916856d36d946589be191f7c322d099b40ca88
parente49ce25855532573c28fc403058d2b223048675e
convert ramfs and tmpfs

Quite a bit is already done by infrastructure changes (simple_link(),
simple_unlink()) - all that is left is replacing d_instantiate() +
pinning dget() (in ->symlink() and ->mknod()) with d_make_persistent(),
and, in case of shmem, using simple_unlink() and simple_link() in
->unlink() and ->link() resp., instead of open-coding those there.
Since d_make_persistent() accepts (and hashes) unhashed ones, shmem
situation gets simpler - we no longer care whether ->lookup() has hashed
the sucker.

With that done, we don't need kill_litter_super() for these filesystems
anymore - by the umount time all remaining dentries will be marked
persistent and kill_litter_super() will boil down to call of
kill_anon_super().

The same goes for devtmpfs and rootfs - they are handled by
ramfs or by shmem, depending upon config.

NB: strictly speaking, both devtmpfs and rootfs ought to use
ramfs_kill_sb() if they end up using ramfs; that's a separate
story and the only impact of "just use kill_{litter,anon}_super()"
is that we fail to free their sb->s_fs_info... on reboot.
That's orthogonal to the changes in this series - kill_litter_super()
is identical to kill_anon_super() for those at this point.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/base/devtmpfs.c
fs/ramfs/inode.c
init/do_mounts.c
mm/shmem.c