Skip to content

fs: Use device special nodes for devfs

Sascha Hauer barebox 2 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected] change-id 20251127-devfs-c138cff5482a

Versions newest first

  1. v2 Latest13 patches 15 repliesApplied
  2. v110 patches 0 repliesSuperseded

Changes in v2 from the cover letter

- Fix storage-by-uuid driver for devfs changes
- remove created device special files and links on devfs_remove()
- Link to v1: https://lore.barebox.org/[email protected]

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/13fs: devfs-core: add devfs_create_link_node()fs/devfs-core.c include/driver.h+9 -11 reply
2/13storage-by-alias: drop fake cdevdrivers/misc/storage-by-alias.c+7 -1131 reply
3/13fs: implement mknodfs/devfs.c fs/fs.c include/fcntl.h +1 more+67 -01 reply
4/13commands: add mknod commandcommands/Kconfig commands/Makefile commands/mknod.c+48 -01 reply
5/13fs: ramfs: add device file supportfs/ramfs.c+18 -01 reply
6/13cdev: add cdev_size() helperfs/devfs-core.c fs/devfs.c include/driver.h+8 -21 reply
7/13fs: fix st_size for device filesfs/fs.c+13 -11 reply
8/13fs: retire devfs as filesystemcommon/startup.c fs/devfs-core.c fs/devfs.c +1 more+39 -1731 reply
9/13fs: include cdevname in struct statfs/fs.c include/linux/stat.h+2 -01 reply
10/13fs: stat_print: get cdevname from statfs/fs.c+4 -211 reply
11/13common: cdev-alias: rename structcommon/cdev-alias.c+6 -61 reply
12/13fs: replace cdev links with aliasescommands/devinfo.c common/partitions.c drivers/block/dm/dm-core.c +4 more+121 -1042 replies
13/13ls: use ~0 for FILE_SIZE_STREAMcommands/ls.c+6 -21 reply

Reviews trailers per patch

All 13 patches have a Reviewed-by or Acked-by.

PatchAhmad Fatoum
1/13R-b
2/13R-b
3/13R-b
4/13R-b
5/13R-b
6/13R-b
7/13R-b
8/13R-b
9/13R-b
10/13R-b
11/13R-b
12/13A-b
13/13R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/13] fs: Use device special nodes for devfs

Until now we have a devfs which is a filesystem of its own. This comes with a few limitations:

- we cannot create directories under /dev/
- Links are implemented in the devfs filesystem. They do not show up as regular links

This series overcomes these limitations by implementing device special nodes. These nodes are limited to ramfs, so we cannot mount arbitrary filesystems and use the device special files found on them. Nevertheless we can create and use device special files on ramfs which is enough to drop the devfs filesystem implementation and just use ramfs on /dev/.

This will in future allow us to create /dev/disk/by-* structures under /dev/.

---
Changes in v2:
- Fix storage-by-uuid driver for devfs changes
- remove created device special files and links on devfs_remove()
- Link to v1: https://lore.barebox.org/[email protected]

---
Sascha Hauer (13):
fs: devfs-core: add devfs_create_link_node()
storage-by-alias: drop fake cdev
fs: implement mknod
commands: add mknod command
fs: ramfs: add device file support
cdev: add cdev_size() helper
fs: fix st_size for device files
fs: retire devfs as filesystem
fs: include cdevname in struct stat
fs: stat_print: get cdevname from stat
common: cdev-alias: rename struct
fs: replace cdev links with aliases
ls: use ~0 for FILE_SIZE_STREAM

 commands/Kconfig                |   4 +
 commands/Makefile               |   1 +
 commands/devinfo.c              |   7 +-
 commands/ls.c                   |   8 +-
 commands/mknod.c                |  43 ++++++++
 common/cdev-alias.c             |  12 +--
 common/partitions.c             |   2 +-
 common/startup.c                |   2 +-
 drivers/block/dm/dm-core.c      |   1 -
 drivers/misc/storage-by-alias.c | 120 ++--------------------
 fs/devfs-core.c                 | 214 +++++++++++++++++++++++++---------------
 fs/devfs.c                      | 180 +++------------------------------
 fs/fs.c                         |  75 +++++++++-----
 fs/ramfs.c                      |  18 ++++
 include/block.h                 |   2 -
 include/driver.h                |  20 +++-
 include/fcntl.h                 |   6 ++
 include/linux/fs.h              |  13 +++
 include/linux/stat.h            |   1 +
 19 files changed, 327 insertions(+), 402 deletions(-)

---
base-commit: 500df27eb054f86ce232c5bb30c3a7ea8f771e61
change-id: 20251127-devfs-c138cff5482a

Best regards,

Signature · 1 line
Sascha Hauer <[email protected]>